/* ========================================
   CODING ROADMAP - PREMIUM ANIMATIONS
   Journey Map Experience
   ======================================== */

/* ========================================
   KEYFRAME ANIMATIONS - ORB EFFECTS
   ======================================== */

@keyframes orb-float-1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }

    25% {
        transform: translate(40px, -60px) scale(1.1);
        opacity: 0.6;
    }

    50% {
        transform: translate(-30px, 40px) scale(0.9);
        opacity: 0.4;
    }

    75% {
        transform: translate(50px, 20px) scale(1.05);
        opacity: 0.55;
    }
}

@keyframes orb-float-2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.45;
    }

    33% {
        transform: translate(-50px, -40px) scale(1.15);
        opacity: 0.55;
    }

    66% {
        transform: translate(40px, 30px) scale(0.85);
        opacity: 0.4;
    }
}

@keyframes orb-pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.35;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.5;
    }
}

/* ========================================
   SCROLL INDICATOR ANIMATION
   ======================================== */

@keyframes scroll-beam {
    0% {
        top: -100%;
    }

    100% {
        top: 200%;
    }
}

/* ========================================
   TIMELINE FLOW ANIMATION
   ======================================== */

@keyframes timeline-flow {
    0% {
        background-position: 0% 0%;
    }

    50% {
        background-position: 0% 100%;
    }

    100% {
        background-position: 0% 0%;
    }
}

/* ========================================
   PULSE ANIMATIONS
   ======================================== */

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.3);
    }
}

@keyframes pulse-ring {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateX(-50%) scale(2.5);
        opacity: 0;
    }
}

@keyframes glow-pulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.2),
            0 0 40px rgba(99, 102, 241, 0.1);
    }

    50% {
        box-shadow: 0 0 40px rgba(99, 102, 241, 0.4),
            0 0 80px rgba(99, 102, 241, 0.2);
    }
}

/* ========================================
   FADE ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ========================================
   SCALE ANIMATIONS
   ======================================== */

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleInBounce {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    60% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   LINE DRAWING ANIMATION
   ======================================== */

@keyframes drawLine {
    from {
        stroke-dashoffset: 1000;
    }

    to {
        stroke-dashoffset: 0;
    }
}

@keyframes expandLine {
    from {
        width: 0;
    }

    to {
        width: 60px;
    }
}

/* ========================================
   SHIMMER & GLOW EFFECTS
   ======================================== */

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes borderGlow {

    0%,
    100% {
        border-color: rgba(99, 102, 241, 0.2);
    }

    50% {
        border-color: rgba(99, 102, 241, 0.5);
    }
}

/* ========================================
   ICON ANIMATIONS
   ======================================== */

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes iconRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    25% {
        transform: translateY(-6px) scale(1.05);
    }

    50% {
        transform: translateY(0) scale(1);
    }

    75% {
        transform: translateY(-3px) scale(1.02);
    }
}

/* ========================================
   TEXT ANIMATIONS
   ======================================== */

@keyframes textGradient {

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

    50% {
        background-position: 100% 50%;
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* ========================================
   HERO SECTION ANIMATIONS
   ======================================== */

.hero-content {
    animation: fadeInUp 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.hero-label {
    animation: fadeInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.2s both;
}

.hero-title {
    animation: fadeInUp 1s cubic-bezier(0.23, 1, 0.32, 1) 0.4s both;
    background-size: 300% auto;
    animation: fadeInUp 1s cubic-bezier(0.23, 1, 0.32, 1) 0.4s both,
        textGradient 8s ease-in-out infinite;
}

.hero-subtitle {
    animation: fadeInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.6s both;
}

.scroll-indicator {
    animation: fadeInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.9s both;
}

/* ========================================
   ROADMAP STAGE ANIMATIONS
   ======================================== */

.roadmap-stage {
    transition: opacity 1s cubic-bezier(0.23, 1, 0.32, 1),
        transform 1s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Staggered Content Animation */
.roadmap-stage:nth-child(odd).visible .stage-content {
    animation: fadeInLeft 0.9s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.roadmap-stage:nth-child(even).visible .stage-content {
    animation: fadeInRight 0.9s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* Stage Icon Animation */
.roadmap-stage .stage-icon {
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.roadmap-stage.visible .stage-icon {
    animation: scaleInBounce 0.7s cubic-bezier(0.23, 1, 0.32, 1) 0.3s both;
}

/* Stage Number Animation */
.stage-number {
    opacity: 0;
    transform: translateX(-15px);
    transition: opacity 0.5s ease 0.4s, transform 0.5s ease 0.4s;
}

.roadmap-stage.visible .stage-number {
    opacity: 1;
    transform: translateX(0);
}

/* Stage Title Animation */
.stage-title {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease 0.5s, transform 0.6s ease 0.5s;
}

.roadmap-stage.visible .stage-title {
    opacity: 1;
    transform: translateY(0);
}

/* Stage Philosophy Animation */
.stage-philosophy {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease 0.6s, transform 0.5s ease 0.6s;
}

.roadmap-stage.visible .stage-philosophy {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   SKILL ITEMS - STAGGERED ANIMATION
   ======================================== */

.skill-item {
    opacity: 0;
    transform: translateY(25px);
}

.roadmap-stage.visible .skill-item:nth-child(1) {
    animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.7s both;
}

.roadmap-stage.visible .skill-item:nth-child(2) {
    animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.8s both;
}

.roadmap-stage.visible .skill-item:nth-child(3) {
    animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.9s both;
}

.roadmap-stage.visible .skill-item:nth-child(4) {
    animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) 1s both;
}

/* Skill Icon Hover Animation */
.skill-item:hover .skill-icon {
    animation: iconBounce 0.6s ease;
}

/* ========================================
   STAGE OUTCOME ANIMATION
   ======================================== */

.stage-outcome {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 1.1s, transform 0.6s ease 1.1s;
}

.roadmap-stage.visible .stage-outcome {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   CARD HOVER EFFECTS
   ======================================== */

.stage-content {
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.5s ease,
        border-color 0.3s ease;
}

.stage-content:hover {
    animation: glow-pulse 3s ease-in-out infinite;
}

.stage-content:hover .stage-icon svg {
    animation: iconFloat 2s ease-in-out infinite;
}

/* ========================================
   TIMELINE NODE ANIMATION
   ======================================== */

.roadmap-stage::before {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s,
        box-shadow 0.4s ease;
}

.roadmap-stage.visible::before {
    animation: pulse-ring 1.5s ease-out 0.5s;
}

/* Additional Ring Effect */
.roadmap-stage.visible::before {
    position: absolute;
}

/* ========================================
   CONNECTOR LINE ANIMATION
   ======================================== */

.roadmap-stage::after {
    transition: width 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.4s;
}

/* ========================================
   COMPLETION SECTION ANIMATIONS
   ======================================== */

.completion-section .completion-icon {
    transition: opacity 1s cubic-bezier(0.23, 1, 0.32, 1),
        transform 1s cubic-bezier(0.23, 1, 0.32, 1);
}

.completion-section.visible .completion-icon {
    animation: scaleInBounce 0.9s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.completion-section.visible .completion-icon svg {
    animation: iconFloat 3s ease-in-out infinite 1s;
}

.completion-section.visible .completion-title {
    animation: fadeInUp 0.9s cubic-bezier(0.23, 1, 0.32, 1) 0.3s both;
    background-size: 300% auto;
}

.completion-section.visible .completion-text {
    animation: fadeInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.5s both;
}

/* ========================================
   INTERACTIVE HOVER STATES
   ======================================== */

.hero-label {
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.hero-label:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
    border-color: rgba(99, 102, 241, 0.5);
}

.parallel-indicator {
    transition: all 0.3s ease;
}

.parallel-indicator:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(192, 132, 252, 0.3);
}

.stage-outcome {
    transition: transform 0.3s ease, background 0.3s ease, opacity 0.6s ease 1.1s;
}

.stage-outcome:hover {
    transform: translateX(6px);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
}

/* ========================================
   PROGRESS BAR ANIMATION
   ======================================== */

.progress-bar {
    transition: width 150ms ease-out;
    animation: shimmer 2s infinite linear;
    background-size: 200% 100%;
    background-image: linear-gradient(90deg,
            rgba(99, 102, 241, 1) 0%,
            rgba(139, 92, 246, 1) 25%,
            rgba(255, 255, 255, 0.5) 50%,
            rgba(139, 92, 246, 1) 75%,
            rgba(99, 102, 241, 1) 100%);
}

/* ========================================
   FOCUS STATES
   ======================================== */

:focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 4px;
    transition: outline-offset 0.2s ease;
}

:focus-visible:active {
    outline-offset: 2px;
}

/* ========================================
   LOADING STATE
   ======================================== */

.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.08) 50%,
            transparent 100%);
    animation: shimmer 1.5s infinite;
    background-size: 200% 100%;
}

/* ========================================
   REDUCED MOTION SUPPORT
   ======================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        animation-delay: 0ms !important;
    }

    .gradient-orb {
        animation: none;
    }

    .scroll-line::before {
        animation: none;
    }

    .roadmap-stage {
        opacity: 1;
        transform: none;
    }

    .completion-icon {
        opacity: 1;
        transform: none;
    }

    .skill-item {
        opacity: 1;
        transform: none;
    }

    .stage-number,
    .stage-title,
    .stage-philosophy,
    .stage-outcome {
        opacity: 1;
        transform: none;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

.gradient-orb,
.stage-content,
.roadmap-stage,
.completion-icon,
.skill-item,
.stage-icon {
    will-change: transform, opacity;
}

/* GPU Acceleration */
.hero-content,
.stage-icon,
.skill-icon {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Composite Layer Optimization */
.timeline-line::before {
    will-change: background-position;
}

.progress-bar {
    will-change: width, background-position;
}