/* Cyberpunk Background Styles */

/* Base gradient layer */
.cyberpunk-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(
        180deg,
        #0a0a12 0%,
        #0d0d1a 20%,
        #12111f 40%,
        #1a1528 60%,
        #251a35 80%,
        #2d1f3d 100%
    );
    overflow: hidden;
}

/* Rain canvas */
#rain-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.4;
    pointer-events: none;
}

/* City silhouette container */
.city-silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45%;
    min-height: 300px;
    max-height: 500px;
    z-index: 2;
    pointer-events: none;
}

/* City layers for parallax depth */
.city-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.city-layer-back {
    opacity: 0.3;
    transform: scale(1.1);
    filter: blur(2px);
}

.city-layer-mid {
    opacity: 0.5;
    transform: scale(1.05);
    filter: blur(1px);
}

.city-layer-front {
    opacity: 0.8;
}

/* Building windows that blink */
.window {
    fill: transparent;
    opacity: 0;
}

.window.lit {
    fill: #ffeaa7;
    opacity: 1;
    filter: drop-shadow(0 0 6px #ffeaa7) drop-shadow(0 0 12px rgba(255, 234, 167, 0.5));
    animation: windowFlicker var(--flicker-duration, 4s) ease-in-out infinite;
    animation-delay: var(--flicker-delay, 0s);
}

.window.lit-cyan {
    fill: #00f5ff;
    filter: drop-shadow(0 0 8px #00f5ff) drop-shadow(0 0 16px rgba(0, 245, 255, 0.6));
}

.window.lit-magenta {
    fill: #ff00ff;
    filter: drop-shadow(0 0 8px #ff00ff) drop-shadow(0 0 16px rgba(255, 0, 255, 0.6));
}

.window.lit-orange {
    fill: #ff6b35;
    filter: drop-shadow(0 0 8px #ff6b35) drop-shadow(0 0 16px rgba(255, 107, 53, 0.6));
}

@keyframes windowFlicker {
    0%, 85%, 100% { opacity: 1; }
    86% { opacity: 0.3; }
    87% { opacity: 1; }
    88% { opacity: 0.5; }
    90% { opacity: 1; }
}

/* Neon signs */
.neon-sign {
    position: absolute;
    bottom: 15%;
    font-family: 'Arial Black', sans-serif;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 3;
    pointer-events: none;
}

.neon-sign-1 {
    left: 8%;
    color: #ff00ff;
    text-shadow:
        0 0 5px #ff00ff,
        0 0 10px #ff00ff,
        0 0 20px #ff00ff,
        0 0 40px #ff00ff;
    animation: neonFlicker1 3s ease-in-out infinite;
}

.neon-sign-2 {
    right: 12%;
    bottom: 22%;
    color: #00f5ff;
    text-shadow:
        0 0 5px #00f5ff,
        0 0 10px #00f5ff,
        0 0 20px #00f5ff,
        0 0 40px #00f5ff;
    animation: neonFlicker2 4s ease-in-out infinite;
}

@keyframes neonFlicker1 {
    0%, 100% { opacity: 1; }
    5% { opacity: 0.8; }
    10% { opacity: 1; }
    15% { opacity: 0.4; }
    20% { opacity: 1; }
    50% { opacity: 0.9; }
    55% { opacity: 0.3; }
    57% { opacity: 1; }
}

@keyframes neonFlicker2 {
    0%, 100% { opacity: 1; }
    20% { opacity: 0.9; }
    25% { opacity: 0.4; }
    27% { opacity: 1; }
    60% { opacity: 0.8; }
    65% { opacity: 0.2; }
    67% { opacity: 0.9; }
    70% { opacity: 1; }
}

/* Fog/haze layers */
.fog-layer {
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 300%;
    height: 40%;
    z-index: 4;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(100, 50, 150, 0.05) 25%,
        rgba(50, 100, 150, 0.08) 50%,
        rgba(100, 50, 150, 0.05) 75%,
        transparent 100%
    );
}

.fog-layer-1 {
    animation: fogDrift 60s linear infinite;
    opacity: 0.6;
}

.fog-layer-2 {
    animation: fogDrift 45s linear infinite reverse;
    opacity: 0.4;
    height: 30%;
}

@keyframes fogDrift {
    0% { transform: translateX(0); }
    100% { transform: translateX(33.33%); }
}

/* Atmospheric glow at horizon */
.horizon-glow {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    z-index: 0;
    background: radial-gradient(
        ellipse 150% 50% at 50% 100%,
        rgba(139, 92, 246, 0.15) 0%,
        rgba(100, 50, 150, 0.08) 30%,
        transparent 70%
    );
    pointer-events: none;
}

/* Scanlines overlay (subtle) */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    opacity: 0.5;
}

/* Distant city lights (tiny dots) */
.distant-lights {
    position: absolute;
    bottom: 35%;
    left: 0;
    width: 100%;
    height: 10%;
    z-index: 1;
    pointer-events: none;
}

.distant-light {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.3;
    animation: distantTwinkle 3s ease-in-out infinite;
}

@keyframes distantTwinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Flying vehicle streaks (occasional) */
.vehicle-streak {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00f5ff, #00f5ff, transparent);
    z-index: 3;
    pointer-events: none;
    opacity: 0;
}

.vehicle-streak.active {
    animation: vehicleFly 3s linear forwards;
}

@keyframes vehicleFly {
    0% {
        opacity: 0;
        transform: translateX(-100px);
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateX(calc(100vw + 100px));
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .window.lit,
    .neon-sign,
    .fog-layer,
    .distant-light,
    .vehicle-streak {
        animation: none;
    }

    .window.lit {
        opacity: 0.7;
    }

    .neon-sign {
        opacity: 1;
    }

    #rain-canvas {
        display: none;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .city-silhouette {
        height: 35%;
        min-height: 200px;
    }

    .neon-sign {
        font-size: 10px;
    }

    .scanlines {
        display: none;
    }

    #rain-canvas {
        opacity: 0.3;
    }
}
