/**
 * SYSTÈME DE CHARGEMENT (LOADER) AVEC LOGO UNIET
 * ================================================
 * CSS pour l'animation de chargement avec le logo de l'université
 * qui apparaît lors du chargement initial et de la navigation entre les pages
 * 
 * @author UNIET Dev Team
 * @version 1.0.0
 */

/* ============================================
   CONTENEUR PRINCIPAL DU LOADER
   ============================================ */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* État caché du loader - transition rapide */
#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ============================================
   CONTENEUR DU LOGO ET ANIMATION
   ============================================ */
.loader-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

/* Animation d'apparition du contenu */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   LOGO AVEC ANIMATION DE ROTATION
   ============================================ */
.loader-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

/* Image du logo */
.loader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(33, 150, 243, 0.3));
}

/* Animation de pulsation du logo */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ============================================
   CERCLE DE PROGRESSION ROTATIF
   ============================================ */
.loader-spinner {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 3px solid rgba(33, 150, 243, 0.1);
    border-top-color: #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animation de rotation du cercle */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   TEXTE DE CHARGEMENT
   ============================================ */
.loader-text {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

/* ============================================
   NOM DE L'UNIVERSITÉ
   ============================================ */
.loader-university {
    color: #2196F3;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ============================================
   BARRE DE PROGRESSION
   ============================================ */
.loader-progress-bar {
    width: 250px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 20px auto 0;
    overflow: hidden;
    position: relative;
}

/* Progression animée */
.loader-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196F3, #00BCD4);
    border-radius: 2px;
    animation: progressAnimation 2s ease-in-out infinite;
}

/* Animation de la barre de progression */
@keyframes progressAnimation {
    0% {
        width: 0%;
        opacity: 0.5;
    }
    50% {
        width: 70%;
        opacity: 1;
    }
    100% {
        width: 100%;
        opacity: 0.5;
    }
}

/* ============================================
   POINTS DE CHARGEMENT ANIMÉS
   ============================================ */
.loader-dots {
    display: inline-block;
    color: #ffffff;
    font-size: 24px;
    letter-spacing: 5px;
}

.loader-dots span {
    animation: blink 1.4s infinite;
    animation-fill-mode: both;
}

.loader-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loader-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Animation de clignotement des points */
@keyframes blink {
    0%, 80%, 100% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
}

/* ============================================
   VERSION MOBILE (RESPONSIVE)
   ============================================ */
@media (max-width: 768px) {
    .loader-logo {
        width: 100px;
        height: 100px;
    }
    
    .loader-university {
        font-size: 20px;
    }
    
    .loader-text {
        font-size: 16px;
    }
    
    .loader-progress-bar {
        width: 200px;
    }
}

/* ============================================
   EFFET DE DÉGRADÉ SUR LE FOND
   ============================================ */
#page-loader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(33, 150, 243, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 188, 212, 0.1) 0%, transparent 50%);
    animation: gradientMove 8s ease-in-out infinite;
}

/* Animation du dégradé de fond */
@keyframes gradientMove {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(20px, 20px) scale(1.1);
    }
}
