/**
 * Midnight Stage Theme
 *
 * Dark concert aesthetic with neon glows, pulsing animations, and spotlight effects.
 * Perfect for rock, indie, and alternative music artists.
 */

/* ============================================
   Theme Variables
   (Extend base theme colors from ThemePreset)
   ============================================ */

:root {
    /* Neon glow effects */
    --neon-glow-primary: 0 0 10px var(--color-accent),
                         0 0 20px var(--color-accent),
                         0 0 30px var(--color-accent);

    --neon-glow-secondary: 0 0 10px var(--color-secondary),
                            0 0 20px var(--color-secondary);

    /* Stage lighting effect */
    --spotlight-gradient: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0) 70%
    );
}

/* ============================================
   Body & Background
   ============================================ */

body {
    /* Subtle dark texture */
    background: linear-gradient(
        180deg,
        var(--color-background) 0%,
        color-mix(in srgb, var(--color-background) 90%, var(--color-accent) 10%) 100%
    );
    position: relative;
}

/* Ensure all page content is above background effects */
body > * {
    position: relative;
    z-index: 1;
}

/* Spotlight effect that follows cursor */
body::before {
    content: '';
    position: fixed;
    top: var(--spotlight-y, 50%);
    left: var(--spotlight-x, 50%);
    width: 600px;
    height: 600px;
    background: var(--spotlight-gradient);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: top 0.3s ease-out, left 0.3s ease-out;
    opacity: 0.3;
}

/* ============================================
   Typography Enhancements
   ============================================ */

h1, h2, h3 {
    position: relative;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Neon glow on primary headings */
h1 {
    text-shadow: var(--neon-glow-primary);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

/* ============================================
   Buttons & Interactive Elements
   ============================================ */

button, .btn {
    background: linear-gradient(
        135deg,
        var(--color-accent) 0%,
        color-mix(in srgb, var(--color-accent) 80%, black 20%) 100%
    );
    box-shadow: 0 0 20px rgba(var(--color-accent-rgb), 0.3);
    border: 1px solid var(--color-accent);
    transition: all 0.3s ease;
}

button:hover, .btn:hover {
    box-shadow: var(--neon-glow-primary);
    transform: translateY(-2px) scale(1.02);
}

/* Pulsing effect on primary CTA */
.btn-primary {
    animation: pulse-button 2s ease-in-out infinite;
}

@keyframes pulse-button {
    0%, 100% {
        box-shadow: 0 0 20px rgba(var(--color-accent-rgb), 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(var(--color-accent-rgb), 0.6);
    }
}

/* ============================================
   Navigation
   ============================================ */

nav, .header {
    background: rgba(var(--color-background-rgb), 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(var(--color-accent-rgb), 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

nav a, .menu-item {
    position: relative;
    transition: all 0.3s ease;
}

nav a::after, .menu-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    box-shadow: var(--neon-glow-primary);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

nav a:hover::after, .menu-item:hover::after {
    width: 80%;
}

/* ============================================
   Hero Section
   ============================================ */

.hero, .page-section[data-section-type="hero"] {
    position: relative;
    overflow: hidden;
}

/* Animated gradient background */
.hero:not(:has(> div[class*="absolute"][class*="inset-0"]))::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        var(--color-accent),
        var(--color-secondary),
        var(--color-accent)
    );
    background-size: 200% 200%;
    opacity: 0.1;
    animation: gradient-shift 10s ease infinite;
    z-index: 0;
    pointer-events: none;
}

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

/* Content container should be above background and effects */
.hero > .relative {
    z-index: 10;
}

/* ============================================
   Cards & Content Blocks
   ============================================ */

.card, .content-block {
    background: rgba(var(--color-surface-rgb), 0.05);
    border: 1px solid rgba(var(--color-accent-rgb), 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.card:hover, .content-block:hover {
    border-color: var(--color-accent);
    box-shadow: 0 0 20px rgba(var(--color-accent-rgb), 0.3);
    transform: translateY(-4px);
}

/* ============================================
   Music Player Integration
   ============================================ */

.music-player {
    background: rgba(var(--color-surface-rgb), 0.1);
    border: 1px solid rgba(var(--color-accent-rgb), 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

/* Visualizer bars animation */
.player-visualizer .bar {
    background: linear-gradient(
        to top,
        var(--color-accent),
        var(--color-secondary)
    );
    animation: visualizer-pulse 0.6s ease-in-out infinite;
}

.player-visualizer .bar:nth-child(2) {
    animation-delay: 0.1s;
}

.player-visualizer .bar:nth-child(3) {
    animation-delay: 0.2s;
}

.player-visualizer .bar:nth-child(4) {
    animation-delay: 0.3s;
}

@keyframes visualizer-pulse {
    0%, 100% {
        height: 20%;
    }
    50% {
        height: 100%;
    }
}

/* ============================================
   Images & Media
   ============================================ */

img {
    transition: all 0.4s ease;
}

img:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(var(--color-accent-rgb), 0.4);
}

/* ============================================
   Footer
   ============================================ */

footer {
    background: rgba(var(--color-background-rgb), 0.95);
    border-top: 1px solid rgba(var(--color-accent-rgb), 0.3);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

/* ============================================
   Scroll Animations (Theme-Specific)
   ============================================ */

[data-animate] {
    /* Override base animation for more dramatic effect */
    transform: translateY(40px) scale(0.95);
}

[data-animate].animate-in {
    transform: translateY(0) scale(1);
}

/* ============================================
   Special Effects
   ============================================ */

/* Stage smoke effect (subtle) */
@keyframes smoke-drift {
    0%, 100% {
        transform: translateX(0) translateY(0);
        opacity: 0.05;
    }
    50% {
        transform: translateX(20px) translateY(-10px);
        opacity: 0.1;
    }
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: radial-gradient(
        ellipse at bottom,
        rgba(255, 255, 255, 0.05) 0%,
        transparent 70%
    );
    animation: smoke-drift 10s ease-in-out infinite;
    pointer-events: none;
    z-index: 1; /* Layer smoke ABOVE background image (z-0) but BELOW content (z-10) */
}

/* ============================================
   Cursor Trail Effect (Optional)
   JavaScript will handle positioning
   ============================================ */

.cursor-trail {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--color-accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    box-shadow: var(--neon-glow-primary);
    animation: trail-fade 0.5s ease-out forwards;
}

@keyframes trail-fade {
    from {
        opacity: 0.8;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0);
    }
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    /* Reduce glow effects on mobile for performance */
    h1 {
        text-shadow: 0 0 10px var(--color-accent);
    }

    body::before {
        /* Disable spotlight on mobile */
        display: none;
    }

    .card:hover, .content-block:hover {
        /* Simpler hover on touch devices */
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    /* Disable all animations for accessibility */
    * {
        animation: none !important;
        transition: none !important;
    }

    h1, button, .btn {
        text-shadow: none;
        box-shadow: none;
    }
}
