/**
 * Retro Cassette Theme CSS
 *
 * 80s/90s cassette tape aesthetic with neon accents, retro tech vibes, and VHS nostalgia
 * Perfect for: Synth wave artists, retro enthusiasts, 80s cover bands, lo-fi producers
 *
 * OPTIMIZED: Uses base.css utilities to minimize custom code
 */

/* ============================================
   RETRO GRID BACKGROUND (Tron-style)
   ============================================ */

body {
    /* Retro grid pattern WITH dynamic background color from CSS variable */
    background:
        linear-gradient(0deg, transparent 24%, rgba(0, 245, 255, 0.05) 25%, rgba(0, 245, 255, 0.05) 26%, transparent 27%),
        linear-gradient(90deg, transparent 24%, rgba(255, 0, 110, 0.05) 25%, rgba(255, 0, 110, 0.05) 26%, transparent 27%),
        var(--page-background);  /* CRITICAL: Reference CSS variable so PostMessage changes are visible */
    background-size: 50px 50px;
    background-position: 0 0;
}

/* ============================================
   VHS SCAN LINES OVERLAY
   Uses base.css .texture-scanlines but customized
   ============================================ */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 9998;
    animation: vhs-flicker 0.3s infinite;
}

@keyframes vhs-flicker {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.95; }
}

/* ============================================
   NEON GLOW HEADINGS
   Uses base.css neon utilities with custom colors
   ============================================ */

h1, h2, h3 {
    text-shadow:
        0 0 10px var(--color-heading),
        0 0 20px var(--color-heading),
        0 0 30px var(--color-heading),
        0 0 40px var(--color-heading);
    animation: neon-pulse 2s ease-in-out infinite;
}

@keyframes neon-pulse {
    0%, 100% {
        text-shadow:
            0 0 10px var(--color-heading),
            0 0 20px var(--color-heading),
            0 0 30px var(--color-heading);
    }
    50% {
        text-shadow:
            0 0 15px var(--color-heading),
            0 0 30px var(--color-heading),
            0 0 45px var(--color-heading),
            0 0 60px var(--color-heading);
    }
}

/* ============================================
   CASSETTE TAPE CARDS
   Enhanced from base.css .card styles
   ============================================ */

.card {
    position: relative;
    border: 2px solid rgba(0, 245, 255, 0.3);
    box-shadow:
        0 0 20px rgba(255, 0, 110, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.card::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 0, 110, 0.5) 30%,
        rgba(176, 38, 255, 0.5) 70%,
        transparent 100%
    );
}

.card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(255, 0, 110, 0.6);
    box-shadow:
        0 0 30px rgba(255, 0, 110, 0.5),
        0 8px 24px rgba(0, 0, 0, 0.4),
        inset 0 0 30px rgba(0, 0, 0, 0.6);
}

/* ============================================
   CASSETTE BUTTON EFFECTS
   Uses base.css button utilities + custom enhancements
   ============================================ */

button, .btn {
    position: relative;
    overflow: hidden;
    border: 2px solid currentColor;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

button::before, .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before, .btn:active::before {
    width: 300px;
    height: 300px;
}

/* Neon glow on hover */
button:hover, .btn:hover {
    box-shadow:
        0 0 20px currentColor,
        0 0 40px currentColor,
        inset 0 0 20px rgba(255, 255, 255, 0.1);
}

/* ============================================
   DIGITAL DISPLAY ELEMENTS
   LCD/LED style for stats and numbers
   ============================================ */

.digital-display {
    font-family: 'Space Mono', monospace;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(0, 245, 255, 0.4);
    padding: 8px 16px;
    color: #00F5FF;
    text-shadow: 0 0 10px #00F5FF;
    letter-spacing: 3px;
}

/* ============================================
   CRT SCREEN CURVATURE
   Subtle screen curve effect
   ============================================ */

.hero-section,
.content-block:first-of-type {
    border-radius: 12px;
    box-shadow:
        inset 0 0 100px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 0, 110, 0.2);
}

/* ============================================
   RETRO PROGRESS BARS & METERS
   VU meter style for music players
   ============================================ */

.progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, #00FF88, #FFB000, #FF0055);
    box-shadow: 0 0 10px currentColor;
    transition: width 0.3s ease;
}

/* ============================================
   CASSETTE TAPE SPINNING ANIMATION
   For music player or decorative elements
   ============================================ */

.cassette-reel {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 0, 110, 0.6);
    border-radius: 50%;
    position: relative;
    animation: spin-reel 3s linear infinite;
}

.cassette-reel::before,
.cassette-reel::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(176, 38, 255, 0.4);
}

.cassette-reel::before {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.cassette-reel::after {
    width: 40px;
    height: 2px;
    transform: translate(-50%, -50%) rotate(45deg);
}

@keyframes spin-reel {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   GLITCH EFFECT (subtle)
   For page load or hover states
   ============================================ */

.glitch {
    position: relative;
}

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

.glitch::before {
    animation: glitch-1 2s infinite;
    color: #00F5FF;
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 2s infinite;
    color: #FF006E;
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(2px, -2px); }
    40% { transform: translate(2px, 2px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(-2px, 2px); }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    body {
        background-size: 30px 30px;
    }

    h1, h2, h3 {
        text-shadow:
            0 0 5px var(--color-heading),
            0 0 10px var(--color-heading),
            0 0 15px var(--color-heading);
    }
}

/* ============================================
   REDUCED MOTION SUPPORT
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body::before {
        animation: none;
    }

    .cassette-reel {
        animation: none;
    }
}
