/**
 * Collective Vibrations Theme
 *
 * Psychedelic and groovy - vintage concert poster meets modern festival website.
 * Perfect for jam bands, Grateful Dead/Phish-style artists, festival performers,
 * improvisational musicians, and hippie/groovy artists.
 *
 * Design Philosophy:
 * - Vibrant psychedelic colors (pink, yellow, purple, turquoise)
 * - Wavy organic shapes and flowing movement
 * - Kaleidoscope patterns and color shifts
 * - Festival poster typography
 * - Joyful, groovy, improvisational vibes
 */

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

:root {
    /* Psychedelic colors */
    --vibrant-pink: #FF6B9D;
    --sunny-yellow: #FFD93D;
    --rich-purple: #6C3483;
    --turquoise: #00BCD4;
    --warm-cream: #FFF9E5;

    /* Groovy effects */
    --wave-offset: 0px;
    --color-shift-hue: 0deg;
    --kaleidoscope-rotation: 0deg;
}

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

body {
    position: relative;
    /* Psychedelic radial patterns WITH dynamic background color from CSS variable */
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 107, 157, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 217, 61, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(108, 52, 131, 0.05) 0%, transparent 60%),
        var(--page-background);  /* CRITICAL: Reference CSS variable so PostMessage changes are visible */
    background-attachment: fixed;
}

/* Animated psychedelic overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(255, 107, 157, 0.1) 0%,
            rgba(255, 217, 61, 0.1) 25%,
            rgba(108, 52, 131, 0.1) 50%,
            transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: psychedelicPulse 8s ease-in-out infinite;
}

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

/* Groovy wave overlay */
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(255, 107, 157, 0.05) 50%,
        rgba(255, 217, 61, 0.08) 100%);
    pointer-events: none;
    z-index: -2;
    clip-path: polygon(
        0% 60%,
        10% 50%,
        20% 55%,
        30% 45%,
        40% 50%,
        50% 40%,
        60% 50%,
        70% 45%,
        80% 55%,
        90% 50%,
        100% 60%,
        100% 100%,
        0% 100%
    );
    animation: wavyFlow 10s ease-in-out infinite;
}

@keyframes wavyFlow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-20px); }
}

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

h1, h2, h3 {
    position: relative;
    letter-spacing: 0.03em;
}

/* Psychedelic gradient text */
h1 {
    background: linear-gradient(135deg,
        var(--vibrant-pink) 0%,
        var(--sunny-yellow) 25%,
        var(--turquoise) 50%,
        var(--rich-purple) 75%,
        var(--vibrant-pink) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbowShift 8s ease-in-out infinite;
}

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

/* Groovy wavy underline */
h2::after {
    content: '';
    display: block;
    width: 120px;
    height: 4px;
    background: linear-gradient(90deg,
        var(--vibrant-pink) 0%,
        var(--sunny-yellow) 33%,
        var(--turquoise) 66%,
        var(--rich-purple) 100%);
    margin: 1rem auto 0;
    border-radius: 4px;
    animation: wavyUnderline 3s ease-in-out infinite;
}

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

@keyframes wavyUnderline {
    0%, 100% {
        clip-path: polygon(
            0% 50%,
            20% 30%,
            40% 50%,
            60% 70%,
            80% 50%,
            100% 50%,
            100% 100%,
            0% 100%
        );
    }
    50% {
        clip-path: polygon(
            0% 50%,
            20% 70%,
            40% 50%,
            60% 30%,
            80% 50%,
            100% 50%,
            100% 100%,
            0% 100%
        );
    }
}

/* Psychedelic text shadow */
h1, h2, h3 {
    text-shadow:
        2px 2px 0px rgba(255, 107, 157, 0.3),
        4px 4px 0px rgba(255, 217, 61, 0.2),
        6px 6px 0px rgba(108, 52, 131, 0.1);
}

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

button, .btn, a.button {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 30px;
}

/* Groovy gradient animation */
button::before, .btn::before, a.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
        var(--vibrant-pink),
        var(--sunny-yellow),
        var(--turquoise),
        var(--rich-purple));
    background-size: 400% 400%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: groovyGradient 6s ease infinite;
}

@keyframes groovyGradient {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
}

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

button:hover, .btn:hover, a.button:hover {
    transform: scale(1.05) rotate(-1deg);
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.4);
}

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

.card, .content-block {
    background: var(--color-surface, #FFFFFF);
    border: 2px solid transparent;
    background-image: linear-gradient(white, white),
                      linear-gradient(135deg,
                          var(--vibrant-pink),
                          var(--sunny-yellow),
                          var(--turquoise));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    transition: all 0.4s ease;
    box-shadow: 0 6px 24px rgba(108, 52, 131, 0.15);
    border-radius: 24px;
    position: relative;
}

/* Psychedelic corner decoration */
.card::before,
.content-block::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
    background: radial-gradient(
        circle,
        var(--vibrant-pink) 0%,
        var(--sunny-yellow) 33%,
        var(--turquoise) 66%,
        transparent 100%
    );
    border-radius: 50%;
    opacity: 0.2;
    animation: colorShiftPulse 4s ease-in-out infinite;
}

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

.card:hover, .content-block:hover {
    box-shadow: 0 12px 40px rgba(255, 107, 157, 0.3);
    transform: translateY(-8px) rotate(1deg);
}

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

nav, .header {
    background: var(--header-background);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg,
        var(--vibrant-pink),
        var(--sunny-yellow),
        var(--turquoise),
        var(--rich-purple)) 1;
    box-shadow: 0 4px 20px rgba(108, 52, 131, 0.1);
}

nav a, .menu-item {
    position: relative;
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* Groovy wave underline */
nav a::after, .menu-item::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--vibrant-pink) 0%,
        var(--sunny-yellow) 50%,
        var(--turquoise) 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

nav a:hover::after, .menu-item:hover::after {
    width: 100%;
    animation: wavyUnderline 2s ease-in-out infinite;
}

nav a:hover, .menu-item:hover {
    color: var(--vibrant-pink);
    transform: scale(1.05);
}

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

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

/* Kaleidoscope background - only show when hero has no background image */
.hero:not(:has(> div[class*="absolute"][class*="inset-0"]))::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        repeating-conic-gradient(
            from 0deg at 50% 50%,
            rgba(255, 107, 157, 0.1) 0deg,
            rgba(255, 217, 61, 0.1) 60deg,
            rgba(0, 188, 212, 0.1) 120deg,
            rgba(108, 52, 131, 0.1) 180deg,
            rgba(255, 107, 157, 0.1) 240deg,
            rgba(255, 217, 61, 0.1) 300deg,
            rgba(255, 107, 157, 0.1) 360deg
        );
    animation: kaleidoscope 20s linear infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
}

@keyframes kaleidoscope {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

.music-player,
#amplitude-player {
    background: var(--card-background);
    border: 3px solid transparent;
    background-image: linear-gradient(var(--card-background), var(--card-background)),
                      linear-gradient(135deg,
                          var(--vibrant-pink),
                          var(--sunny-yellow),
                          var(--turquoise));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.3);
    border-radius: 24px;
}

/* Groovy album art border */
.album-art img,
[data-amplitude-song-info="cover_art_url"] {
    border: 4px solid transparent;
    background-image: linear-gradient(white, white),
                      linear-gradient(135deg,
                          var(--vibrant-pink),
                          var(--sunny-yellow),
                          var(--turquoise));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    transition: all 0.4s ease;
    border-radius: 16px;
    animation: borderShift 6s ease-in-out infinite;
}

@keyframes borderShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
}

/* Play button psychedelic gradient */
.amplitude-play-pause,
button[class*="play"] {
    background: linear-gradient(135deg,
        var(--vibrant-pink) 0%,
        var(--sunny-yellow) 50%,
        var(--turquoise) 100%);
    background-size: 200% 200%;
    border: none;
    animation: groovyGradient 4s ease infinite;
}

.amplitude-play-pause:hover {
    transform: scale(1.15) rotate(5deg);
}

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

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    border: 2px solid rgba(255, 107, 157, 0.3);
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    border-radius: 16px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--vibrant-pink);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.2),
                0 4px 20px rgba(255, 107, 157, 0.3);
    background: rgba(255, 255, 255, 1);
    outline: none;
}

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

footer {
    background: var(--footer-background);
    border-top: 3px solid transparent;
    border-image: linear-gradient(90deg,
        var(--vibrant-pink),
        var(--sunny-yellow),
        var(--turquoise),
        var(--rich-purple)) 1;
    box-shadow: 0 -4px 20px rgba(108, 52, 131, 0.1);
}

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

footer .social-links a:hover {
    color: var(--vibrant-pink);
    transform: scale(1.2) rotate(5deg);
}

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

img {
    transition: all 0.4s ease;
}

/* Vibrant saturation boost */
img:not([class*="logo"]):not([class*="icon"]) {
    filter: saturate(1.15) contrast(1.05);
}

img:hover {
    filter: saturate(1.25) contrast(1.08) hue-rotate(5deg);
}

/* Gallery with groovy borders */
.gallery img,
[class*="gallery"] img {
    border: 4px solid transparent;
    background-image: linear-gradient(white, white),
                      linear-gradient(135deg,
                          var(--vibrant-pink),
                          var(--sunny-yellow),
                          var(--turquoise));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border-radius: 20px;
}

.gallery img:hover {
    transform: scale(1.03) rotate(2deg);
}

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

/* Psychedelic dividers */
.divider {
    height: 4px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--vibrant-pink) 20%,
        var(--sunny-yellow) 40%,
        var(--turquoise) 60%,
        var(--rich-purple) 80%,
        transparent 100%);
    background-size: 200% 100%;
    margin: 2rem 0;
    border-radius: 4px;
    animation: dividerFlow 4s linear infinite;
}

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

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

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

    .hero::before {
        animation-duration: 30s;
    }

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

    .card:hover, .content-block:hover {
        transform: translateY(-4px);
    }
}

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

    h1 {
        -webkit-text-fill-color: var(--heading-color);
        background: none;
    }
}
