/* Styles pour l'écran de chargement futuriste */

#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: #070d1f;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.cyber-loader {
    position: relative;
    width: 200px;
    height: 200px;
}

.loader-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #3fafff;
    animation: spin 1.5s linear infinite;
}

.loader-circle:nth-child(2) {
    border: 4px solid transparent;
    border-bottom-color: #00d4ff;
    animation: spin 2s linear infinite reverse;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
}

.loader-circle:nth-child(3) {
    border: 4px solid transparent;
    border-left-color: #007bff;
    animation: spin 1s linear infinite;
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
}

.loader-core {
    position: absolute;
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    background: radial-gradient(circle, rgba(0,212,255,1) 0%, rgba(0,83,233,0.8) 100%);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite alternate;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
}

.loader-text {
    margin-top: 40px;
    font-family: 'Orbitron', sans-serif;
    color: #00d4ff;
    font-size: 18px;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: flicker 2s linear infinite;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

.progress-bar {
    width: 250px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    margin-top: 20px;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3fafff 0%, #00d4ff 100%);
    transition: width 0.2s ease-out;
    position: relative;
    animation: progressPulse 1.5s ease infinite;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 5px;
    background-color: #ffffff;
    opacity: 0.8;
    animation: progressGlow 1s ease-in-out infinite;
}

.loader-status {
    margin-top: 15px;
    font-family: 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; }
}

@keyframes flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
    20%, 24%, 55% { opacity: 0.5; }
}

@keyframes progressPulse {
    0% { box-shadow: 0 0 5px rgba(0, 212, 255, 0.5); }
    50% { box-shadow: 0 0 15px rgba(0, 212, 255, 0.8); }
    100% { box-shadow: 0 0 5px rgba(0, 212, 255, 0.5); }
}

@keyframes progressGlow {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

/* Styles pour l'apparition progressive du contenu */
/* Classes pour les animations initiales (après chargement) et au scroll */
.fade-in, .scroll-animation {
    opacity: 0;
    transform: translateY(20px);
}

/* Animation initiale après chargement */
.fade-in {
    animation: fadeInAnimation 0.8s ease forwards paused;
    /* Augmenter le délai de base pour s'adapter au chargement plus long */
    animation-delay: 0.5s; /* Délai de base augmenté */
}

/* Animation déclenchée au scroll */
.scroll-animation.animate {
    animation: fadeInAnimation 0.8s ease forwards;
}

body.content-loaded .fade-in {
    animation-play-state: running;
}

@keyframes fadeInAnimation {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Masquer initialement tout le contenu principal */
body:not(.content-loaded) section > .container > * {
    opacity: 0;
}

/* Animation spécifique pour les titres principaux */
body.content-loaded h1,
body.content-loaded .section-title {
    animation: glowFadeIn 1s ease-out forwards;
    /* Augmenter le délai pour s'adapter au chargement plus long */
    animation-delay: 0.6s;
}

/* Animation au scroll pour les titres */
.scroll-animation.title.animate {
    animation: glowFadeIn 1s ease-out forwards;
}

@keyframes glowFadeIn {
    0% {
        opacity: 0;
        text-shadow: 0 0 0 rgba(63, 175, 255, 0);
        transform: translateY(30px);
    }
    50% {
        opacity: 0.7;
        text-shadow: 0 0 15px rgba(63, 175, 255, 0.7);
    }
    100% {
        opacity: 1;
        text-shadow: 0 0 8px rgba(63, 175, 255, 0.4);
        transform: translateY(0);
    }
}

/* Animation spéciale pour les éléments de navigation */
.navbar-link,
.modern-nav a {
    opacity: 0;
    animation: slideInFromTop 0.5s ease forwards;
    animation-play-state: paused;
    /* Délai ajusté pour la navigation */
    animation-delay: 0.3s;
}

body.content-loaded .navbar-link,
body.content-loaded .modern-nav a {
    animation-play-state: running;
}

@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Effet de décalage pour les éléments dans chaque section */
body.content-loaded .fade-in {
    animation-fill-mode: forwards;
}

/* Effet de décalage pour les animations au scroll */
.scroll-animation {
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/* Animation séquentielle pour les éléments en ligne (comme les compétences) */
.scroll-animation.animate:nth-child(1) { animation-delay: 0s; }
.scroll-animation.animate:nth-child(2) { animation-delay: 0.1s; }
.scroll-animation.animate:nth-child(3) { animation-delay: 0.2s; }
.scroll-animation.animate:nth-child(4) { animation-delay: 0.3s; }
.scroll-animation.animate:nth-child(5) { animation-delay: 0.4s; }
.scroll-animation.animate:nth-child(6) { animation-delay: 0.5s; }

/* Animation différente pour les icônes */
body.content-loaded .skill-box i,
body.content-loaded .social-icon i,
body.content-loaded .contact-item i {
    animation: scaleIn 0.7s ease-out forwards;
    transform: scale(0);
    opacity: 0;
    animation-delay: 0.8s;
}

/* Animation au scroll pour les icônes */
.scroll-animation.icon.animate {
    animation: scaleIn 0.7s ease-out forwards;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    70% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation pour les boutons */
body.content-loaded .cta-button,
body.content-loaded .project-link,
body.content-loaded .download-btn,
body.content-loaded .submit-btn {
    animation: buttonFadeIn 0.8s ease-out forwards;
    opacity: 0;
    transform: scale(0.9);
    animation-delay: 1s;
}

/* Animation au scroll pour les boutons */
.scroll-animation.button.animate {
    animation: buttonFadeIn 0.8s ease-out forwards;
}

@keyframes buttonFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
        box-shadow: 0 0 0 rgba(63, 175, 255, 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(63, 175, 255, 0.7);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 10px rgba(63, 175, 255, 0.3);
    }
}

/* Animations alternatives pour le scroll */
.scroll-animation.fade-left.animate {
    animation: fadeInFromLeft 0.7s ease forwards;
}

.scroll-animation.fade-right.animate {
    animation: fadeInFromRight 0.7s ease forwards;
}

@keyframes fadeInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInFromRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animations déclenchées au défilement */
.scroll-reveal {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.visible {
    opacity: 1;
}

/* Animation par type d'élément */
.scroll-reveal-title {
    transform: translateY(30px);
}
.scroll-reveal-title.visible {
    transform: translateY(0);
}

.scroll-reveal-fade {
    transform: translateY(20px);
}
.scroll-reveal-fade.visible {
    transform: translateY(0);
}

.scroll-reveal-left {
    transform: translateX(-50px);
}
.scroll-reveal-left.visible {
    transform: translateX(0);
}

.scroll-reveal-right {
    transform: translateX(50px);
}
.scroll-reveal-right.visible {
    transform: translateX(0);
}

.scroll-reveal-scale {
    transform: scale(0.8);
}
.scroll-reveal-scale.visible {
    transform: scale(1);
}

.scroll-reveal-button {
    transform: translateY(20px) scale(0.9);
    opacity: 0;
}
.scroll-reveal-button.visible {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.scroll-reveal-rotate {
    transform: rotate(-30deg) scale(0.7);
    opacity: 0;
}
.scroll-reveal-rotate.visible {
    transform: rotate(0) scale(1);
    opacity: 1;
}
