/* ========================================
   JOURNEY ANIMATIONS - Voyage Immersif
   Portfolio Prince Noukounwoui
   ======================================== */

/* --------------------------------
   1. JOURNEY PROGRESS INDICATOR
   Une ligne verticale qui montre
   la progression du voyage
   -------------------------------- */

.journey-progress {
    position: fixed;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    opacity: 0;
    animation: journeyFadeIn 1s ease-out 1.5s forwards;
}

@keyframes journeyFadeIn {
    to { opacity: 1; }
}

.journey-line {
    position: absolute;
    left: 50%;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(
        180deg,
        rgba(0, 122, 255, 0.1) 0%,
        rgba(0, 122, 255, 0.3) 50%,
        rgba(0, 122, 255, 0.1) 100%
    );
    transform: translateX(-50%);
    border-radius: 2px;
}

.journey-line-progress {
    position: absolute;
    left: 50%;
    top: 8px;
    width: 2px;
    height: 0%;
    background: linear-gradient(
        180deg,
        var(--primary-color) 0%,
        var(--secondary-color) 50%,
        var(--accent-color) 100%
    );
    transform: translateX(-50%);
    border-radius: 2px;
    transition: height 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.5);
}

.journey-step {
    position: relative;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid rgba(0, 122, 255, 0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

.journey-step::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.4s ease;
}

.journey-step:hover {
    transform: scale(1.3);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 122, 255, 0.4);
}

.journey-step.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.4);
    box-shadow:
        0 0 20px rgba(0, 122, 255, 0.6),
        0 0 40px rgba(0, 122, 255, 0.3);
}

.journey-step.active::before {
    background: rgba(0, 122, 255, 0.2);
    animation: journeyPulse 2s ease-in-out infinite;
}

.journey-step.completed {
    background: var(--success-color);
    border-color: var(--success-color);
}

.journey-step-label {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.journey-step:hover .journey-step-label,
.journey-step.active .journey-step-label {
    opacity: 1;
    transform: translateY(-50%) translateX(8px);
    color: var(--primary-color);
}

@keyframes journeyPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.8); opacity: 0; }
}

/* --------------------------------
   2. CINEMATIC SECTION REVEALS
   Animations de révélation pour
   chaque section du voyage
   -------------------------------- */

/* Base state for all animated elements */
.journey-reveal {
    opacity: 0;
    transform: translateY(60px);
    transition:
        opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.journey-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered reveals for children */
.journey-reveal-stagger > * {
    opacity: 0;
    transform: translateY(40px);
    transition:
        opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.journey-reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0.1s; }
.journey-reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.2s; }
.journey-reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.3s; }
.journey-reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.4s; }
.journey-reveal-stagger.revealed > *:nth-child(5) { transition-delay: 0.5s; }
.journey-reveal-stagger.revealed > *:nth-child(6) { transition-delay: 0.6s; }
.journey-reveal-stagger.revealed > *:nth-child(7) { transition-delay: 0.7s; }
.journey-reveal-stagger.revealed > *:nth-child(8) { transition-delay: 0.8s; }

.journey-reveal-stagger.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

/* Reveal from different directions */
.journey-reveal-left {
    opacity: 0;
    transform: translateX(-80px);
    transition:
        opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.journey-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.journey-reveal-right {
    opacity: 0;
    transform: translateX(80px);
    transition:
        opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.journey-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.journey-reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition:
        opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.journey-reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* --------------------------------
   3. SPLIT TEXT ANIMATIONS
   Animation lettre par lettre
   pour les titres de section
   -------------------------------- */

.journey-split-text {
    display: inline-block;
    overflow: hidden;
}

.journey-split-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    transition:
        opacity 0.4s ease,
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.journey-split-text.revealed .char {
    opacity: 1;
    transform: translateY(0);
}

/* Dynamic delays will be set via JS */

/* --------------------------------
   4. PARALLAX DEPTH LAYERS
   Effet de profondeur au scroll
   -------------------------------- */

.parallax-container {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    inset: -20%;
    background-size: cover;
    background-position: center;
    will-change: transform;
    transition: transform 0.1s linear;
}

.parallax-element {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* --------------------------------
   5. SECTION CHAPTER TRANSITIONS
   Transitions entre "chapitres"
   -------------------------------- */

.section {
    position: relative;
    /* overflow: hidden retiré pour éviter de cacher le contenu */
}

/* Chapter indicator */
.chapter-indicator {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

/* Désactivé (doublon avec la barre latérale) */
.chapter-indicator {
    display: none !important;
}

.section.in-view .chapter-indicator {
    opacity: 1;
}

.chapter-number {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(0, 122, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 2px;
}

.chapter-line {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
}

/* Section dividers with animation */
.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--primary-color),
        var(--secondary-color),
        var(--primary-color),
        transparent
    );
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 2px;
}

.section.in-view::before {
    width: 200px;
}

/* --------------------------------
   6. ENHANCED CARD ANIMATIONS
   Animations pour les cartes
   -------------------------------- */

/* État initial - visible par défaut pour éviter le contenu caché */
.domain-card,
.project-card,
.skill-item,
.certification-item,
.education-item {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition:
        opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease;
}

/* État caché - appliqué par JS quand l'animation est prête */
.journey-ready .domain-card,
.journey-ready .project-card,
.journey-ready .skill-item,
.journey-ready .certification-item,
.journey-ready .education-item {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
}

/* État visible après animation */
.journey-ready .domain-card.journey-visible,
.journey-ready .project-card.journey-visible,
.journey-ready .skill-item.journey-visible,
.journey-ready .certification-item.journey-visible,
.journey-ready .education-item.journey-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Hover lift effect enhanced */
.domain-card:hover,
.project-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 122, 255, 0.15),
        0 0 0 1px rgba(0, 122, 255, 0.1);
}

/* --------------------------------
   7. FLOATING PARTICLES JOURNEY
   Particules qui accompagnent
   le voyage du visiteur
   -------------------------------- */

.journey-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.journey-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    animation: journeyParticleFloat 15s infinite;
}

@keyframes journeyParticleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.6;
        transform: translateY(80vh) scale(1);
    }
    90% {
        opacity: 0.6;
        transform: translateY(10vh) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
}

/* --------------------------------
   8. SCROLL-TRIGGERED COUNTER
   Animation des compteurs
   -------------------------------- */

.stat-number {
    font-variant-numeric: tabular-nums;
}

.stat-item.counting .stat-number {
    animation: countPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* --------------------------------
   9. HERO JOURNEY ENTRANCE
   Animation d'entrée du hero
   -------------------------------- */

.hero.journey-loaded .hero-greeting {
    animation: heroGreetingIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s both;
}

.hero.journey-loaded .hero-title {
    animation: heroTitleIn 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.5s both;
}

.hero.journey-loaded .hero-dynamic-subtitle {
    animation: heroSubtitleIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.8s both;
}

.hero.journey-loaded .hero-stats {
    animation: heroStatsIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1s both;
}

.hero.journey-loaded .hero-location {
    animation: heroLocationIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.2s both;
}

.hero.journey-loaded .hero-buttons {
    animation: heroButtonsIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.4s both;
}

.hero.journey-loaded .hero-image {
    animation: heroImageIn 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both;
}

@keyframes heroGreetingIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroTitleIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes heroSubtitleIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes heroStatsIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroLocationIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes heroButtonsIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroImageIn {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* --------------------------------
   10. SCROLL INDICATOR ENHANCED
   Indicateur de scroll amélioré
   -------------------------------- */

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: scrollIndicatorIn 0.8s ease 2s both;
}

@keyframes scrollIndicatorIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.scroll-indicator::before {
    content: 'Scroll';
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.scroll-arrow {
    width: 24px;
    height: 40px;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    position: relative;
    opacity: 0.8;
}

.scroll-arrow::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 2px;
    animation: scrollArrowBounce 1.5s ease-in-out infinite;
}

@keyframes scrollArrowBounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) translateY(12px);
        opacity: 0.3;
    }
}

/* --------------------------------
   11. SECTION TITLE ANIMATIONS
   Animations des titres de section
   -------------------------------- */

.section-title {
    position: relative;
    overflow: hidden;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s;
}

.section.in-view .section-title::after {
    width: 80px;
}

.section-title i {
    display: inline-block;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section.in-view .section-title i {
    animation: iconBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes iconBounce {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* --------------------------------
   12. TIMELINE JOURNEY ANIMATION
   Animation de la timeline éducation
   Note: Ne pas cacher le contenu par défaut
   -------------------------------- */

/* Les styles de timeline sont gérés par le CSS principal */
/* Ces animations sont optionnelles et ne cachent pas le contenu */

/* --------------------------------
   13. LOADING SCREEN JOURNEY
   Écran de chargement du voyage
   -------------------------------- */

.journey-loader {
    position: fixed;
    inset: 0;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.journey-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.journey-loader-content {
    text-align: center;
}

.journey-loader-logo {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 24px;
    animation: loaderPulse 1.5s ease-in-out infinite;
}

@keyframes loaderPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

.journey-loader-bar {
    width: 200px;
    height: 3px;
    background: rgba(0, 122, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.journey-loader-progress {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.journey-loader-text {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --------------------------------
   14. SMOOTH PAGE TRANSITIONS
   Transitions douces entre sections
   -------------------------------- */

.section {
    transition: background-color 0.5s ease;
}

/* Gradient overlays for depth */
.section.bg-light::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(245, 245, 247, 0.5));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.section.in-view.bg-light::after {
    opacity: 1;
}

/* --------------------------------
   15. RESPONSIVE ADJUSTMENTS
   Adaptations pour mobile
   -------------------------------- */

@media (max-width: 1024px) {
    .journey-progress {
        display: none;
    }

    .chapter-indicator {
        display: none;
    }
}

@media (max-width: 768px) {
    .journey-reveal {
        transform: translateY(40px);
    }

    .journey-reveal-left,
    .journey-reveal-right {
        transform: translateY(40px);
    }

    .education-timeline::before {
        left: 20px;
    }

    .education-item::before {
        left: 20px;
    }
}

/* --------------------------------
   16. PERFORMANCE OPTIMIZATIONS
   Optimisations de performance
   -------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .journey-progress,
    .journey-particles,
    .chapter-indicator {
        display: none !important;
    }
}

/* GPU acceleration for animations */
.journey-reveal,
.journey-reveal-left,
.journey-reveal-right,
.journey-reveal-scale,
.domain-card,
.project-card,
.skill-item,
.education-item {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* --------------------------------
   17. MAGNETIC HOVER EFFECT
   Effet magnétique sur hover
   -------------------------------- */

.magnetic-hover {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --------------------------------
   18. GLOW EFFECTS
   Effets de lueur
   -------------------------------- */

.journey-glow {
    position: relative;
}

.journey-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    filter: blur(15px);
    transition: opacity 0.4s ease;
}

.journey-glow:hover::before {
    opacity: 0.5;
}

/* --------------------------------
   19. TEXT GRADIENT ANIMATION
   Animation de dégradé sur texte
   -------------------------------- */

.journey-gradient-text {
    background: linear-gradient(
        135deg,
        var(--primary-color) 0%,
        var(--secondary-color) 50%,
        var(--accent-color) 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 5s ease infinite;
}

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

/* --------------------------------
   20. CURSOR TRAIL ENHANCEMENT
   Amélioration de la traînée du curseur
   -------------------------------- */

.journey-cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(
        circle,
        rgba(0, 122, 255, 0.08) 0%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.journey-cursor-glow.visible {
    opacity: 1;
}

@media (max-width: 1024px) {
    .journey-cursor-glow {
        display: none;
    }
}
