@charset "UTF-8";

/**
 * Modern Loading Overlay - Reusable Component
 * 
 * Purpose: Powerful and attractive loading screen with multiple variants
 * Apple-inspired design with smooth animations
 * 
 * @version 1.0.0
 * @date 2026-01-25
 */

/* ============================================================
   LOADING OVERLAY - Full Screen Overlay
   ============================================================ */

.nx-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.nx-loading-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nx-loading-overlay-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   LOADING SPINNER - Modern Ring Animation
   ============================================================ */

.nx-loading-spinner {
    position: relative;
    display: inline-block;
}

.nx-spinner-ring {
    position: absolute;
    border: 3px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

/* Size Variants */
.nx-loading-spinner-small {
    width: 32px;
    height: 32px;
}

.nx-loading-spinner-small .nx-spinner-ring {
    width: 32px;
    height: 32px;
    border-width: 2px;
}

.nx-loading-spinner-medium {
    width: 48px;
    height: 48px;
}

.nx-loading-spinner-medium .nx-spinner-ring {
    width: 48px;
    height: 48px;
    border-width: 3px;
}

.nx-loading-spinner-large {
    width: 64px;
    height: 64px;
}

.nx-loading-spinner-large .nx-spinner-ring {
    width: 64px;
    height: 64px;
    border-width: 4px;
}

/* Ring Positioning - Multiple Rings for Depth */
.nx-spinner-ring:nth-child(1) {
    top: 0;
    left: 0;
    animation-delay: 0s;
    opacity: 1;
}

.nx-spinner-ring:nth-child(2) {
    top: 8%;
    left: 8%;
    width: 84%;
    height: 84%;
    animation-delay: -0.15s;
    opacity: 0.8;
}

.nx-spinner-ring:nth-child(3) {
    top: 16%;
    left: 16%;
    width: 68%;
    height: 68%;
    animation-delay: -0.3s;
    opacity: 0.6;
}

.nx-spinner-ring:nth-child(4) {
    top: 24%;
    left: 24%;
    width: 52%;
    height: 52%;
    animation-delay: -0.45s;
    opacity: 0.4;
}

/* Color Variants */
.nx-loading-spinner-default {
    color: #007aff; /* Apple Blue */
}

.nx-loading-spinner-primary {
    color: var(--bs-primary, #0d6efd);
}

.nx-loading-spinner-success {
    color: #34c759; /* Apple Green */
}

.nx-loading-spinner-warning {
    color: #ff9500; /* Apple Orange */
}

.nx-loading-spinner-danger {
    color: #ff3b30; /* Apple Red */
}

/* ============================================================
   LOADING MESSAGE
   ============================================================ */

.nx-loading-message {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ============================================================
   INLINE LOADER (For Product Area)
   ============================================================ */

.nx-inline-loader {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 2rem;
    background: rgba(245, 245, 247, 0.5);
    border-radius: 12px;
}

.nx-inline-loader .nx-loading-spinner {
    margin: 0 auto;
}

.nx-inline-loader .nx-loading-message {
    margin-top: 1rem;
}

/* ============================================================
   RESPONSIVE - MOBILE
   ============================================================ */

@media (max-width: 575px) {
    .nx-loading-overlay-content {
        padding: 1.5rem;
        border-radius: 16px;
        gap: 1rem;
    }

    .nx-loading-spinner-medium {
        width: 40px;
        height: 40px;
    }

    .nx-loading-spinner-medium .nx-spinner-ring {
        width: 40px;
        height: 40px;
    }

    .nx-loading-message {
        font-size: 12px;
    }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .nx-loading-overlay,
    .nx-loading-overlay-content,
    .nx-spinner-ring,
    .nx-loading-message {
        animation: none;
    }

    .nx-spinner-ring {
        animation: spin 2s linear infinite;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .nx-loading-overlay-backdrop {
        background: rgba(255, 255, 255, 0.95);
    }

    .nx-loading-overlay-content {
        border: 2px solid #000000;
    }
}

/* ============================================================
   LEGACY SUPPORT - Update Simple Loader
   ============================================================ */

.simple-loader {
    width: 48px;
    height: 48px;
    border: 4px solid #f5f5f7;
    border-top-color: #007aff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
