/* ############## */
/* LOADER ANIMÉ  */
/* ############## */
.loader-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 1;
    white-space: nowrap;
    display: inline-block;
    max-width: 100%;
}

.loader-name span {
    display: inline-block;
    animation: bounce 2s infinite;
}

.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loader-container.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: white;
    max-width: 300px;
    padding: 20px;
}

/* Spinner principal */
.loader-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    position: relative;
}

.loader-spinner::before {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 3px solid transparent;
    border-top: 3px solid #f39c12;
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

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

/* Nom animé */
.loader-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 1;
}

.loader-name span {
    display: inline-block;
    animation: bounce 2s infinite;
}

.loader-name span:nth-child(1) {
    animation-delay: 0.1s;
}
.loader-name span:nth-child(2) {
    animation-delay: 0.2s;
}
.loader-name span:nth-child(3) {
    animation-delay: 0.3s;
}
.loader-name span:nth-child(4) {
    animation-delay: 0.4s;
}
.loader-name span:nth-child(5) {
    animation-delay: 0.5s;
}
.loader-name span:nth-child(6) {
    animation-delay: 0.6s;
}
.loader-name span:nth-child(7) {
    animation-delay: 0.7s;
}
.loader-name span:nth-child(8) {
    animation-delay: 0.8s;
}
.loader-name span:nth-child(9) {
    animation-delay: 0.9s;
}
.loader-name span:nth-child(10) {
    animation-delay: 1s;
}

@keyframes bounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

/* Sous-titre */
.loader-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
    opacity: 1;
}

/* Barre de progression */
.loader-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
    opacity: 1;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2c3e50, #f39c12);
    border-radius: 2px;
    width: 0%;
    animation: progress 2s ease-in-out infinite;
}

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

/* Points de chargement */
.loader-dots {
    margin-top: 15px;
    opacity: 1;
}

.loader-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3498db;
    margin: 0 3px;
    animation: dots 1.4s infinite ease-in-out;
}

.loader-dots span:nth-child(1) {
    animation-delay: -0.32s;
}
.loader-dots span:nth-child(2) {
    animation-delay: -0.16s;
}
.loader-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes dots {
    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .loader-spinner {
        width: 50px;
        height: 50px;
        border-width: 2px;
    }

    .loader-spinner::before {
        border-width: 2px;
    }

    .loader-name {
        font-size: 1.2rem;
    }

    .loader-progress {
        width: 150px;
    }

    .loader-content {
        padding: 15px;
    }
}

/* assurer que le contenu principal est visible */
body {
    opacity: 1 !important;
    transition: opacity 0.5s ease-out;
}

/* Animation d'entrée pour le contenu principal */
.main-content {
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.main-content.loaded {
    opacity: 1;
}
