/* ========================================
   LOADER - Design Moderne et Professionnel
   ======================================== */

/* Container principal avec dégradé élégant */
.loading-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #F8FAFC 0%, #E0E7FF 50%, #DBEAFE 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

/* Logo avec animation douce */
.loading-logo {
    margin-bottom: 15px;
}

.loading-logo img {
    width: 140px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(15, 98, 254, 0.15));
    animation: pulse-logo 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Spinner moderne avec double cercle */
.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 28px;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(15, 98, 254, 0.1);
    border-radius: 50%;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #0F62FE;
    border-right-color: #0F62FE;
    border-radius: 50%;
    animation: spin-modern 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    box-shadow: 0 0 20px rgba(15, 98, 254, 0.3);
}

/* Texte de chargement élégant */
.loading-text {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #1F2937;
    text-align: center;
    animation: fade-slide 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Barre de progression optionnelle */
.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(15, 98, 254, 0.1);
    border-radius: 9999px;
    margin-top: 20px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0F62FE 0%, #3B82F6 100%);
    border-radius: 9999px;
    animation: progress-flow 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(15, 98, 254, 0.5);
}

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

/* Rotation fluide du spinner */
@keyframes spin-modern {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Pulsation douce du logo */
@keyframes pulse-logo {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

/* Fade et slide du texte */
@keyframes fade-slide {
    0%, 100% {
        opacity: 0.6;
        transform: translateY(0px);
    }
    50% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Animation de la barre de progression */
@keyframes progress-flow {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablettes */
@media (max-width: 768px) {
    .loading-logo img {
        width: 110px;
    }

    .loading-spinner {
        width: 65px;
        height: 65px;
    }

    .loading-text {
        font-size: 1rem;
        padding: 0 20px;
    }

    .loading-progress {
        width: 160px;
    }
}

/* Smartphones */
@media (max-width: 480px) {
    .loading-logo img {
        width: 90px;
    }

    .loading-spinner {
        width: 55px;
        height: 55px;
        margin-bottom: 20px;
    }

    .loading-spinner::after {
        border-width: 3px;
    }

    .loading-text {
        font-size: 0.9375rem;
    }

    .loading-progress {
        width: 140px;
        height: 3px;
    }
}

/* ========================================
   ÉTATS DU LOADER
   ======================================== */

/* Disparition progressive */
.loading-area.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* État de succès (optionnel) */
.loading-area.success .loading-spinner::after {
    border-top-color: #10B981;
    border-right-color: #10B981;
}

/* État d'erreur (optionnel) */
.loading-area.error .loading-spinner::after {
    border-top-color: #EF4444;
    border-right-color: #EF4444;
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}
