/* ===== PRELOAD STYLES ===== */
.preload {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

.preload-content {
    text-align: center;
    position: relative;
}

/* Logo Animé */
.preload-logo {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 40px;
}

.logo-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #6366f1 0%,
        #8b5cf6 25%,
        #10b981 50%,
        #0ea5e9 75%,
        #6366f1 100%
    );
    animation: rotateLogo 2s linear infinite;
    box-shadow: 
        0 0 60px rgba(99, 102, 241, 0.3),
        0 0 100px rgba(99, 102, 241, 0.1),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
}

.logo-inner {
    position: absolute;
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    background: #0f172a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 800;
    color: #6366f1;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Texte Typed */
.preload-text {
    margin-bottom: 30px;
}

.preload-title {
    font-size: 3.6rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, 
        #6366f1 0%, 
        #8b5cf6 25%, 
        #10b981 50%, 
        #0ea5e9 75%, 
        #6366f1 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 300% 300%;
    animation: gradientText 4s ease infinite;
}

.preload-subtitle {
    font-size: 1.8rem;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 1px;
}

/* Barre de progression */
.preload-progress {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 30px auto;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg,
        #6366f1 0%,
        #8b5cf6 25%,
        #10b981 50%,
        #0ea5e9 75%,
        #6366f1 100%
    );
    width: 0%;
    border-radius: 10px;
    transition: width 0.3s ease;
    animation: gradientProgress 2s linear infinite;
    background-size: 200% 100%;
}

.progress-percent {
    position: absolute;
    top: -30px;
    left: 0;
    font-size: 1.4rem;
    color: #6366f1;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Particules flottantes */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: linear-gradient(135deg, #6366f1, #10b981);
    border-radius: 50%;
    opacity: 0.3;
    animation: floatParticle linear infinite;
}

.particle:nth-child(1) { top: 20%; left: 10%; width: 8px; height: 8px; animation-duration: 15s; }
.particle:nth-child(2) { top: 60%; left: 85%; width: 12px; height: 12px; animation-duration: 20s; }
.particle:nth-child(3) { top: 80%; left: 20%; width: 6px; height: 6px; animation-duration: 12s; }
.particle:nth-child(4) { top: 30%; left: 70%; width: 10px; height: 10px; animation-duration: 18s; }
.particle:nth-child(5) { top: 40%; left: 40%; width: 7px; height: 7px; animation-duration: 14s; }
.particle:nth-child(6) { top: 70%; left: 60%; width: 9px; height: 9px; animation-duration: 16s; }

/* Message de chargement */
.loading-message {
    font-size: 1.4rem;
    color: #cbd5e1;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.dot {
    width: 6px;
    height: 6px;
    background: #6366f1;
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

/* Animations */
@keyframes rotateLogo {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes gradientText {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes gradientProgress {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes floatParticle {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes dotPulse {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.5);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .preload-title {
        font-size: 2.8rem;
    }
    
    .preload-subtitle {
        font-size: 1.5rem;
    }
    
    .preload-logo {
        width: 100px;
        height: 100px;
        margin-bottom: 30px;
    }
    
    .preload-progress {
        width: 250px;
    }
}

@media (max-width: 480px) {
    .preload-title {
        font-size: 2.2rem;
    }
    
    .preload-subtitle {
        font-size: 1.3rem;
    }
    
    .preload-logo {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }
    
    .preload-progress {
        width: 200px;
    }
    
    .logo-inner {
        font-size: 2.2rem;
    }
}