/* ========================================
   DAARA LOADER - Système de Gestion Scolaire
   Design moderne et professionnel
   ======================================== */

/* Container principal du loader */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999999;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

/* Loader principal */
.daara-loader {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: daaraFadeIn 0.8s ease-out;
}

.daara-loader-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Texte du loader */
.daara-loader-text {
    text-align: center;
    animation: daaraTextFade 2s ease-in-out infinite;
    margin-bottom: 2rem;
}

.daara-text {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 2.5rem;
    font-weight: 800;
    color: #dc3545;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.2em;
    display: block;
    margin-bottom: 0.5rem;
    animation: daaraTextGlow 3s ease-in-out infinite;
}

.daara-subtitle {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

/* Barre de progression */
.daara-progress {
    width: 200px;
    height: 4px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.daara-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #dc3545 0%, #ff6b6b 50%, #dc3545 100%);
    border-radius: 2px;
    width: 0%;
    animation: daaraProgressLoad 3s ease-in-out infinite;
    position: relative;
}

.daara-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: daaraProgressShine 2s ease-in-out infinite;
}

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

@keyframes daaraFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes daaraTextPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes daaraTextFade {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes daaraTextGlow {
    0%, 100% {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% {
        text-shadow: 2px 2px 8px rgba(220, 53, 69, 0.3);
    }
}

@keyframes daaraProgressLoad {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

@keyframes daaraProgressShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

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

@media (max-width: 768px) {
    .daara-text {
        font-size: 2rem;
    }

    .daara-subtitle {
        font-size: 0.8rem;
    }

    .daara-progress {
        width: 150px;
    }
}

@media (max-width: 480px) {
    .daara-text {
        font-size: 1.5rem;
    }

    .daara-subtitle {
        font-size: 0.7rem;
    }

    .daara-progress {
        width: 120px;
    }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    #global-loader {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }

    .daara-subtitle {
        color: #adb5bd;
    }

    .daara-progress {
        background: rgba(220, 53, 69, 0.2);
    }
}

/* ========================================
   LOADER HIDE ANIMATION
   ======================================== */

#global-loader.hide {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
}

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

@media (prefers-reduced-motion: reduce) {
    .daara-loader,
    .daara-loader-text,
    .daara-progress-bar {
        animation: none;
    }

    .daara-progress-bar {
        animation: daaraProgressLoad 1s ease-in-out infinite;
    }
}
