/**
 * Electric Pulse Theme
 *
 * Neon cyberpunk aesthetic with vibrant neon gradients, futuristic typography,
 * and high-energy vibes. Perfect for EDM artists, DJs, electronic producers,
 * club nights, and modern hip-hop.
 *
 * Design Philosophy:
 * - Dark cyberpunk backgrounds with neon accents
 * - Glitch effects and scan lines for futuristic feel
 * - High-contrast neon colors (hot pink, cyan, purple)
 * - Sharp edges with minimal rounding
 * - Neon glow effects on interactive elements
 */

/* ============================================
   Theme Variables & Enhancements
   ============================================ */

:root {
    /* Neon glow colors */
    --neon-pink: #FF006E;
    --neon-cyan: #00F5FF;
    --neon-purple: #8338EC;
    --neon-green: #00FF88;

    /* Neon glow effects */
    --neon-glow-pink: 0 0 10px rgba(255, 0, 110, 0.5),
                      0 0 20px rgba(255, 0, 110, 0.3),
                      0 0 30px rgba(255, 0, 110, 0.2);

    --neon-glow-cyan: 0 0 10px rgba(0, 245, 255, 0.5),
                      0 0 20px rgba(0, 245, 255, 0.3),
                      0 0 30px rgba(0, 245, 255, 0.2);

    --neon-glow-purple: 0 0 10px rgba(131, 56, 236, 0.5),
                        0 0 20px rgba(131, 56, 236, 0.3),
                        0 0 30px rgba(131, 56, 236, 0.2);

    /* Scan line effect */
    --scan-line-opacity: 0.05;

    /* Glitch effect variables */
    --glitch-offset: 2px;
}

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

body {
    position: relative;
    /* Subtle grid pattern WITH dynamic background color from CSS variable */
    background:
        linear-gradient(rgba(0, 245, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 255, 0.03) 1px, transparent 1px),
        var(--page-background);  /* CRITICAL: Reference CSS variable so PostMessage changes are visible */
    background-size: 50px 50px, 50px 50px;
    background-attachment: fixed;
}

/* Animated scan lines */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, var(--scan-line-opacity)) 0px,
        transparent 1px,
        transparent 2px,
        rgba(255, 255, 255, var(--scan-line-opacity)) 3px
    );
    pointer-events: none;
    z-index: 9998;
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

/* Cyber grid overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(90deg, transparent 0%, rgba(0, 245, 255, 0.05) 50%, transparent 100%);
    pointer-events: none;
    z-index: 9997;
    animation: cyberSweep 10s ease-in-out infinite;
}

@keyframes cyberSweep {
    0%, 100% { transform: translateX(-100%); opacity: 0; }
    50% { transform: translateX(100%); opacity: 1; }
}

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

h1, h2, h3 {
    position: relative;
    text-shadow: var(--neon-glow-cyan);
    letter-spacing: 0.05em;
}

/* Glitch effect on h1 */
h1 {
    position: relative;
}

h1::before,
h1::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

h1::before {
    left: var(--glitch-offset);
    text-shadow: calc(var(--glitch-offset) * -1) 0 var(--neon-pink);
    animation: glitch-1 2s infinite;
    clip: rect(0, 900px, 0, 0);
}

h1::after {
    left: calc(var(--glitch-offset) * -1);
    text-shadow: var(--glitch-offset) 0 var(--neon-cyan);
    animation: glitch-2 3s infinite;
    clip: rect(0, 900px, 0, 0);
}

@keyframes glitch-1 {
    0%, 100% { clip: rect(42px, 9999px, 44px, 0); }
    20% { clip: rect(12px, 9999px, 59px, 0); }
    40% { clip: rect(84px, 9999px, 90px, 0); }
    60% { clip: rect(25px, 9999px, 40px, 0); }
    80% { clip: rect(65px, 9999px, 75px, 0); }
}

@keyframes glitch-2 {
    0%, 100% { clip: rect(65px, 9999px, 119px, 0); }
    20% { clip: rect(92px, 9999px, 20px, 0); }
    40% { clip: rect(10px, 9999px, 80px, 0); }
    60% { clip: rect(50px, 9999px, 55px, 0); }
    80% { clip: rect(35px, 9999px, 100px, 0); }
}

/* Neon underline for h2 */
h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg,
        var(--neon-pink) 0%,
        var(--neon-purple) 50%,
        transparent 100%);
    box-shadow: var(--neon-glow-pink);
    margin: 1rem auto 0;
    animation: neonPulse 2s ease-in-out infinite;
}

section h2::after {
    margin-left: 0;
    margin-right: auto;
}

@keyframes neonPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============================================
   Button Enhancements
   ============================================ */

button, .btn, a.button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.875rem;
    border: 2px solid transparent;
}

/* Neon border glow */
button::before, .btn::before, a.button::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
        var(--neon-pink),
        var(--neon-purple),
        var(--neon-cyan),
        var(--neon-pink));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: neonBorderRotate 4s linear infinite;
    background-size: 400% 400%;
}

@keyframes neonBorderRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

button:hover::before,
.btn:hover::before,
a.button:hover::before {
    opacity: 1;
}

button:hover, .btn:hover, a.button:hover {
    transform: scale(1.05);
    box-shadow: var(--neon-glow-pink);
}

/* Primary button neon effect */
button[style*="background"],
.btn-primary {
    background: var(--neon-pink) !important;
    box-shadow: var(--neon-glow-pink);
}

button[style*="background"]:hover,
.btn-primary:hover {
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.8),
                0 0 40px rgba(255, 0, 110, 0.5);
}

/* ============================================
   Card & Content Block Enhancements
   ============================================ */

.card, .content-block {
    background: var(--color-surface, #1A1A24);
    border: 1px solid rgba(0, 245, 255, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Cyber corner accents */
.card::before,
.content-block::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 30px;
    border-top: 2px solid var(--neon-cyan);
    border-right: 2px solid var(--neon-cyan);
    box-shadow: var(--neon-glow-cyan);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.card:hover::before,
.content-block:hover::before {
    opacity: 1;
}

.card:hover, .content-block:hover {
    border-color: var(--neon-pink);
    box-shadow: 0 0 30px rgba(255, 0, 110, 0.3),
                0 8px 40px rgba(0, 0, 0, 0.7);
    transform: translateY(-4px);
}

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

nav, .header {
    background: var(--header-background);
    border-bottom: 1px solid rgba(0, 245, 255, 0.3);
    box-shadow: 0 2px 20px rgba(0, 245, 255, 0.2);
    position: relative;
}

/* Cyber grid on nav */
nav::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--neon-cyan) 50%,
        transparent 100%);
    box-shadow: var(--neon-glow-cyan);
    animation: navGlow 3s ease-in-out infinite;
}

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

nav a, .menu-item {
    position: relative;
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.875rem;
}

/* Neon underline on hover */
nav a::after, .menu-item::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--neon-cyan);
    box-shadow: var(--neon-glow-cyan);
    transition: width 0.3s ease;
}

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

nav a:hover, .menu-item:hover {
    color: var(--neon-cyan);
    text-shadow: var(--neon-glow-cyan);
}

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

.hero, section[class*="hero"] {
    position: relative;
    overflow: hidden;
}

/* Animated neon gradient background */
.hero:not(:has(> div[class*="absolute"][class*="inset-0"]))::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(255, 0, 110, 0.15) 0%,
        rgba(131, 56, 236, 0.1) 30%,
        transparent 70%
    );
    animation: heroGlow 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

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

/* Only target content container, not background image */
.hero > .relative {
    z-index: 10;
}

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

.music-player,
#amplitude-player {
    background: var(--card-background);
    border: 2px solid rgba(0, 245, 255, 0.4);
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.2);
    border-radius: var(--card-border-radius, 12px);
    position: relative;
}

/* Neon progress bar */
.amplitude-song-slider,
progress {
    accent-color: var(--neon-pink);
}

/* Album art neon border */
.album-art img,
[data-amplitude-song-info="cover_art_url"] {
    border: 2px solid var(--neon-cyan);
    box-shadow: var(--neon-glow-cyan);
    transition: all 0.3s ease;
}

.album-art:hover img {
    border-color: var(--neon-pink);
    box-shadow: var(--neon-glow-pink);
}

/* Play button neon pulse */
.amplitude-play-pause,
button[class*="play"] {
    background: linear-gradient(135deg,
        var(--neon-pink) 0%,
        var(--neon-purple) 100%);
    border: none;
    box-shadow: var(--neon-glow-pink);
    animation: playButtonPulse 2s ease-in-out infinite;
}

@keyframes playButtonPulse {
    0%, 100% {
        box-shadow: var(--neon-glow-pink);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 0, 110, 0.8),
                    0 0 40px rgba(255, 0, 110, 0.5);
    }
}

.amplitude-play-pause:hover {
    transform: scale(1.1);
}

/* ============================================
   Form Elements
   ============================================ */

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    border: 2px solid rgba(0, 245, 255, 0.3);
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--neon-cyan);
    box-shadow: var(--neon-glow-cyan);
    background: rgba(0, 0, 0, 0.7);
    outline: none;
}

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

footer {
    background: var(--footer-background);
    border-top: 2px solid rgba(0, 245, 255, 0.3);
    box-shadow: 0 -4px 30px rgba(0, 245, 255, 0.1);
    position: relative;
}

/* Neon top border */
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        var(--neon-pink) 0%,
        var(--neon-purple) 50%,
        var(--neon-cyan) 100%);
    box-shadow: 0 0 10px rgba(255, 0, 110, 0.5);
}

footer .social-links a {
    transition: all 0.3s ease;
}

footer .social-links a:hover {
    color: var(--neon-cyan);
    text-shadow: var(--neon-glow-cyan);
    transform: translateY(-3px);
}

/* ============================================
   Image Treatments
   ============================================ */

img {
    transition: all 0.4s ease;
}

img:not([class*="logo"]):not([class*="icon"]) {
    filter: brightness(0.95) contrast(1.1);
}

img:hover {
    filter: brightness(1) contrast(1.15);
}

/* Gallery images with neon borders */
.gallery img,
[class*="gallery"] img {
    border: 2px solid rgba(131, 56, 236, 0.4);
    box-shadow: 0 0 20px rgba(131, 56, 236, 0.2);
}

.gallery img:hover {
    border-color: var(--neon-pink);
    box-shadow: var(--neon-glow-pink);
}

/* ============================================
   Decorative Elements
   ============================================ */

/* Cyber dividers */
.divider {
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--neon-cyan) 25%,
        var(--neon-pink) 50%,
        var(--neon-cyan) 75%,
        transparent 100%);
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
    margin: 2rem 0;
    animation: dividerPulse 3s ease-in-out infinite;
}

@keyframes dividerPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Data corruption effect */
.glitch-text {
    position: relative;
    animation: textGlitch 5s infinite;
}

@keyframes textGlitch {
    0%, 90%, 100% { transform: translate(0); }
    91% { transform: translate(-2px, 2px); }
    92% { transform: translate(2px, -2px); }
    93% { transform: translate(-2px, -2px); }
}

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

@media (max-width: 768px) {
    /* Simplify effects on mobile */
    body::before,
    body::after {
        display: none;
    }

    h1::before,
    h1::after {
        display: none;
    }

    .card::before,
    .content-block::before {
        display: none;
    }

    /* Reduce animation intensity */
    @keyframes neonPulse {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.8; }
    }
}

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

    body::before,
    body::after {
        display: none;
    }
}
