/* ============================================
   CIRCUIT BOARD ANIMATION OVERLAYS
   Creates living, breathing circuit animations
   ============================================ */

/* ============================================
   HERO ANIMATION SEQUENCE STATES
   ============================================ */

/* Video Background - plays once then freezes */
.circuit-video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 0;
    object-fit: cover;
    opacity: 1;
}

/* Center dark overlay for text readability */
.hero-text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 60%;
    background: radial-gradient(
        ellipse at center,
        rgba(10, 10, 10, 0.85) 0%,
        rgba(10, 10, 10, 0.6) 40%,
        rgba(10, 10, 10, 0.3) 70%,
        transparent 100%
    );
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease;
}

.hero-overlay-revealed {
    opacity: 1 !important;
}

/* ============================================
   CENTERED MASSIVE BUTTON (Initial State)
   ============================================ */

.hero-button-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    transition: opacity 0.5s ease, transform 0.3s ease;
}

/* Hide button after activation */
.hero.hero-activated .hero-button-center {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
}

.activate-button-massive {
    position: relative;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 4px solid #FF4500;
    padding: 3rem 6rem;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    color: #ffffff;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow:
        0 0 40px rgba(255, 69, 0, 0.6),
        0 0 80px rgba(255, 69, 0, 0.3),
        inset 0 0 30px rgba(255, 69, 0, 0.1);
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow:
            0 0 40px rgba(255, 69, 0, 0.6),
            0 0 80px rgba(255, 69, 0, 0.3);
    }
    50% {
        box-shadow:
            0 0 60px rgba(255, 69, 0, 0.8),
            0 0 120px rgba(255, 69, 0, 0.5);
    }
}

.activate-button-massive:hover {
    transform: scale(1.05);
    border-color: #ffffff;
}

.activate-button-massive:active {
    transform: scale(0.95);
}

/* Button press animation */
.activate-button-massive.pressing {
    animation: buttonPress 0.5s ease-out forwards;
}

@keyframes buttonPress {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
        box-shadow:
            0 0 100px rgba(255, 69, 0, 1),
            0 0 200px rgba(255, 69, 0, 0.8),
            inset 0 0 50px rgba(255, 69, 0, 0.5);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   HERO CONTENT (Hidden → Revealed after video)
   ============================================ */

.hero-content-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(30px) scale(0.95);
    transition: opacity 3s ease, transform 3s ease;
}

.hero-content-revealed {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) scale(1) !important;
    animation: materialize 3s ease forwards;
}

@keyframes materialize {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(10px);
    }
    50% {
        opacity: 0.5;
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Animated energy traces flowing through circuits */
.circuit-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(90deg, transparent 0%, transparent 48%, rgba(255, 69, 0, 0.8) 49%, rgba(255, 69, 0, 0.8) 51%, transparent 52%, transparent 100%),
        linear-gradient(0deg, transparent 0%, transparent 48%, rgba(0, 212, 255, 0.6) 49%, rgba(0, 212, 255, 0.6) 51%, transparent 52%, transparent 100%);
    background-size: 200px 200px, 200px 200px;
    background-position: 0 0, 0 0;
    opacity: 0.3;
    mix-blend-mode: screen;
    animation: energyFlow 8s linear infinite;
    z-index: 2;
}

@keyframes energyFlow {
    0% {
        background-position: 0 0, 0 0;
    }
    100% {
        background-position: 200px 200px, -200px -200px;
    }
}

/* Pulsing hotspots on the circuit board */
.hero::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 25% 30%, rgba(255, 69, 0, 0.6) 0%, transparent 3%),
        radial-gradient(circle at 75% 40%, rgba(255, 69, 0, 0.5) 0%, transparent 2%),
        radial-gradient(circle at 50% 70%, rgba(0, 212, 255, 0.4) 0%, transparent 2.5%),
        radial-gradient(circle at 80% 25%, rgba(255, 69, 0, 0.6) 0%, transparent 2%),
        radial-gradient(circle at 30% 80%, rgba(255, 69, 0, 0.5) 0%, transparent 3%),
        radial-gradient(circle at 60% 50%, rgba(0, 212, 255, 0.3) 0%, transparent 2%),
        radial-gradient(circle at 15% 60%, rgba(255, 69, 0, 0.4) 0%, transparent 2.5%),
        radial-gradient(circle at 85% 75%, rgba(0, 212, 255, 0.5) 0%, transparent 2%);
    animation: hotspotPulse 3s ease-in-out infinite;
    z-index: 3;
    pointer-events: none;
    mix-blend-mode: screen;
}

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

/* Scanning beam effect */
.hero-scan-line {
    position: absolute;
    top: -50%;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 69, 0, 0) 20%,
        rgba(255, 69, 0, 0.8) 50%,
        rgba(255, 69, 0, 0) 80%,
        transparent 100%
    );
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.8);
    animation: scanDown 6s ease-in-out infinite;
    z-index: 4;
    pointer-events: none;
}

@keyframes scanDown {
    0% {
        top: -10%;
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        top: 110%;
        opacity: 0;
    }
}

/* Glowing circuit trace overlay */
.circuit-glow-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/circuit-hero.jpg');
    background-size: cover;
    background-position: center;
    filter: brightness(2) contrast(1.5) saturate(2);
    opacity: 0;
    mix-blend-mode: screen;
    animation: glowPulseOverlay 4s ease-in-out infinite;
    z-index: 2;
    pointer-events: none;
}

@keyframes glowPulseOverlay {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 0.3;
    }
}

/* Animated grid overlay */
.circuit-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 99px,
            rgba(255, 69, 0, 0.1) 99px,
            rgba(255, 69, 0, 0.1) 100px
        ),
        repeating-linear-gradient(90deg,
            transparent,
            transparent 99px,
            rgba(255, 69, 0, 0.1) 99px,
            rgba(255, 69, 0, 0.1) 100px
        );
    opacity: 0;
    animation: gridFade 8s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes gridFade {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 0.3;
    }
}

/* Weapon section animations */
.weapon-section .circuit-glow-overlay {
    background-image: url('images/circuit-data.jpg');
}

/* Activation state - intensify all effects */
.hero.activated .circuit-bg::after {
    animation-duration: 2s;
    opacity: 0.8;
}

.hero.activated::before {
    animation-duration: 1s;
}

.hero.activated .circuit-glow-overlay {
    animation-duration: 1s;
    opacity: 0.6;
}

/* Continuous subtle shimmer on traces */
@keyframes traceShimmer {
    0%, 100% {
        filter: brightness(1) saturate(1);
    }
    50% {
        filter: brightness(1.3) saturate(1.5);
    }
}

.circuit-bg {
    animation: circuitPulse 8s ease-in-out infinite, traceShimmer 6s ease-in-out infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero::before {
        background-image:
            radial-gradient(circle at 25% 30%, rgba(255, 69, 0, 0.5) 0%, transparent 5%),
            radial-gradient(circle at 75% 70%, rgba(0, 212, 255, 0.4) 0%, transparent 5%);
    }

    .circuit-bg::after {
        opacity: 0.2;
    }
}
