/* ==================== FLUENT UI - LOADER & SPINNER COMPONENTS ==================== */

/* Page Loader */
.fluent-page-loader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.fluent-page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.fluent-loader-content { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.fluent-loader-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fluent-loader-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: loaderSpin 1.5s ease-in-out infinite;
}

.fluent-loader-ring:nth-child(1) { width: 80px; height: 80px; border-top-color: var(--fluent-primary); animation-delay: 0s; }
.fluent-loader-ring:nth-child(2) { width: 60px; height: 60px; border-right-color: #00BCF2; animation-delay: 0.15s; animation-direction: reverse; }
.fluent-loader-ring:nth-child(3) { width: 40px; height: 40px; border-bottom-color: #50E6FF; animation-delay: 0.3s; }

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

.fluent-loader-logo { animation: loaderPulse 1.5s ease-in-out infinite; }

@keyframes loaderPulse {
    0%, 100% { opacity: 0.6; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

.fluent-loader-text {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    letter-spacing: 1px;
    animation: loaderTextPulse 1.5s ease-in-out infinite;
}

@keyframes loaderTextPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Top Progress Bar */
.fluent-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fluent-progress-bar.active { opacity: 1; }

.fluent-progress-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--fluent-primary) 0%, #00BCF2 50%, #50E6FF 100%);
    box-shadow: 0 0 10px rgba(0, 120, 212, 0.7), 0 0 5px rgba(0, 188, 242, 0.5);
    transition: width 0.3s ease;
    border-radius: 0 2px 2px 0;
}

.fluent-progress-bar.active .fluent-progress-bar-inner {
    animation: progressIndeterminate 1.5s ease-in-out infinite;
}

@keyframes progressIndeterminate {
    0% { width: 0%; margin-left: 0%; }
    50% { width: 30%; margin-left: 40%; }
    100% { width: 0%; margin-left: 100%; }
}

/* Mini Spinner */
.fluent-spinner-mini {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 120, 212, 0.2);
    border-top-color: var(--fluent-primary);
    border-radius: 50%;
    animation: loaderSpin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

/* Loading Overlay */
.fluent-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: inherit;
}

/* Standard Spinner */
.fluent-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 120, 212, 0.2);
    border-top-color: var(--fluent-primary);
    border-radius: 50%;
    animation: loaderSpin 0.8s linear infinite;
}

/* Skeleton Loading */
.fluent-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 4px;
}

.fluent-skeleton-text { height: 14px; margin-bottom: 8px; }
.fluent-skeleton-text:last-child { width: 60%; }
.fluent-skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.fluent-skeleton-button { width: 100px; height: 36px; }

@keyframes skeletonShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .fluent-loader-spinner {
        width: 60px;
        height: 60px;
    }

    .fluent-loader-ring:nth-child(1) { width: 60px; height: 60px; }
    .fluent-loader-ring:nth-child(2) { width: 45px; height: 45px; }
    .fluent-loader-ring:nth-child(3) { width: 30px; height: 30px; }

    .fluent-loader-logo {
        width: 24px;
        height: 24px;
    }

    .fluent-loader-text {
        font-size: 12px;
    }

    .fluent-spinner {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .fluent-loader-spinner {
        width: 50px;
        height: 50px;
    }

    .fluent-loader-ring:nth-child(1) { width: 50px; height: 50px; }
    .fluent-loader-ring:nth-child(2) { width: 38px; height: 38px; }
    .fluent-loader-ring:nth-child(3) { width: 26px; height: 26px; }

    .fluent-loader-content {
        gap: 16px;
    }

    .fluent-spinner {
        width: 24px;
        height: 24px;
    }
}
