/* 
 * Path-Specific Animations for Bitcoin Sovereign Academy
 * Add captivating visual elements to enhance learning experience
 */

/* ===============================================
   HOMEPAGE: Bitcoin Network Animation
   =============================================== */
@keyframes nodePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
        box-shadow: 0 0 15px #f7931a;
    }
}

@keyframes lineFlow {
    0% {
        stroke-dashoffset: 1000;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.network-line {
    stroke-dasharray: 5, 5;
    animation: lineFlow 20s linear infinite;
}

.network-node {
    animation: nodePulse 3s ease-in-out infinite;
}

/* ===============================================
   CURIOUS PATH: Question → Lightbulb Animation
   =============================================== */
.curiosity-animation {
    display: inline-block;
    font-size: 3.5rem;
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
}

.curiosity-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 1s ease, transform 1s ease;
}

.curiosity-icon.question {
    opacity: 1;
}

.curiosity-icon.lightbulb {
    opacity: 0;
}

.curiosity-animation:hover .question {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5) rotate(90deg);
}

.curiosity-animation:hover .lightbulb {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
    filter: drop-shadow(0 0 20px #ffd700);
}

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

.curiosity-animation.auto-animate .question {
    animation: curiosityPulse 3s ease-in-out infinite;
}

/* ===============================================
   BUILDER PATH: Code Blocks → Bitcoin Logo
   =============================================== */
.builder-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-size: 2rem;
    margin: 2rem auto;
    height: 80px;
    position: relative;
}

.code-block {
    display: inline-block;
    font-family: monospace;
    color: #9C27B0;
    opacity: 0.8;
    animation: codeFloat 2s ease-in-out infinite;
}

.code-block:nth-child(1) { animation-delay: 0s; }
.code-block:nth-child(2) { animation-delay: 0.2s; }
.code-block:nth-child(3) { animation-delay: 0.4s; }
.code-block:nth-child(4) { animation-delay: 0.6s; }

@keyframes codeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.builder-animation:hover .code-block {
    animation: codeAssemble 1.5s ease-out forwards;
    transform-origin: center;
}

@keyframes codeAssemble {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-20px) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(2);
        opacity: 0;
    }
}

.builder-logo {
    position: absolute;
    font-size: 4rem;
    opacity: 0;
    transform: scale(0);
    transition: all 1s ease;
}

.builder-animation:hover .builder-logo {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 20px #9C27B0);
}

/* ===============================================
   PRAGMATIST PATH: Tool Carousel
   =============================================== */
.pragmatist-tools {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 2.5rem;
    margin: 2rem auto;
    flex-wrap: wrap;
}

.tool-icon {
    display: inline-block;
    transition: all 0.3s ease;
    animation: toolBounce 2s ease-in-out infinite;
}

.tool-icon:nth-child(1) { animation-delay: 0s; }
.tool-icon:nth-child(2) { animation-delay: 0.3s; }
.tool-icon:nth-child(3) { animation-delay: 0.6s; }
.tool-icon:nth-child(4) { animation-delay: 0.9s; }
.tool-icon:nth-child(5) { animation-delay: 1.2s; }

@keyframes toolBounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(-5deg);
    }
    75% {
        transform: translateY(-5px) rotate(5deg);
    }
}

.tool-icon:hover {
    transform: scale(1.3) rotate(360deg);
    filter: drop-shadow(0 0 15px #00BCD4);
}

/* ===============================================
   SOVEREIGN PATH: Shield Pulse
   =============================================== */
.sovereign-shield {
    display: inline-block;
    font-size: 4rem;
    animation: shieldPulse 2.5s ease-in-out infinite;
}

@keyframes shieldPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px #E53935);
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 25px #E53935);
    }
}

.sovereign-shield:hover {
    animation: shieldActivate 0.5s ease-out;
}

@keyframes shieldActivate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1.15) rotate(0deg);
    }
}

/* ===============================================
   HURRIED PATH: Speed Lines
   =============================================== */
.hurried-speed {
    position: relative;
    display: inline-block;
    font-size: 3.5rem;
}

.speed-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FFA726, transparent);
    top: 50%;
    transform: translateY(-50%);
    animation: speedRush 1.5s ease-in-out infinite;
}

.speed-line:nth-child(2) { animation-delay: 0.3s; top: 40%; }
.speed-line:nth-child(3) { animation-delay: 0.6s; top: 60%; }

@keyframes speedRush {
    0% {
        left: -100%;
        width: 0;
        opacity: 0;
    }
    50% {
        width: 200px;
        opacity: 1;
    }
    100% {
        left: 100%;
        width: 0;
        opacity: 0;
    }
}

/* ===============================================
   OBSERVER PATH: Chart Animation
   =============================================== */
.observer-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.5rem;
    height: 60px;
    margin: 2rem auto;
}

.chart-bar {
    width: 8px;
    background: linear-gradient(180deg, #4caf50, #2196f3);
    border-radius: 4px 4px 0 0;
    animation: chartGrow 2s ease-in-out infinite;
}

.chart-bar:nth-child(1) { animation-delay: 0s; height: 20px; }
.chart-bar:nth-child(2) { animation-delay: 0.2s; height: 40px; }
.chart-bar:nth-child(3) { animation-delay: 0.4s; height: 60px; }
.chart-bar:nth-child(4) { animation-delay: 0.6s; height: 35px; }
.chart-bar:nth-child(5) { animation-delay: 0.8s; height: 50px; }

@keyframes chartGrow {
    0%, 100% {
        transform: scaleY(1);
        opacity: 0.7;
    }
    50% {
        transform: scaleY(1.3);
        opacity: 1;
    }
}

/* ===============================================
   RESPONSIVE ADJUSTMENTS
   =============================================== */
@media (max-width: 768px) {
    .curiosity-animation,
    .builder-animation,
    .sovereign-shield {
        font-size: 2.5rem;
    }

    .pragmatist-tools {
        font-size: 2rem;
        gap: 1rem;
    }

    .observer-chart {
        height: 40px;
    }
}

/* ===============================================
   UTILITY: Fade In on Scroll
   =============================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    animation: fadeInUp 0.8s ease-out;
}
