/* Custom Animations and Styling for Party Hub Lounge */

/* Absolute enforcement that .hidden elements are never displayed or blocking clicks */
.hidden {
  display: none !important;
}

/* YouTube Audio-only offscreen wrapper (never throttled by browser unlike display:none) */
.audio-only-frame {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 240px !important;
  height: 240px !important;
  opacity: 0.01 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

/* Vinyl Rotation */
@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.vinyl-disk.spinning {
  animation: spinSlow 4.5s linear infinite;
}

.vinyl-disk {
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Needle Tone-arm positioning */
#tone-arm.active {
  transform: rotate(26deg);
}

/* Lyrics Styling */
.lyric-line {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  line-height: 1.5;
}

.lyric-line:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.lyric-line.active {
  color: #ffffff !important;
  font-weight: 700;
  font-size: 1.05rem;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.25), rgba(236, 72, 153, 0.15));
  border-left: 4px solid #8b5cf6;
  text-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
  transform: scale(1.02) translateX(4px);
  box-shadow: 0 4px 15px -3px rgba(139, 92, 246, 0.2);
}

/* Animated Audio Equalizer Waveform */
@keyframes waveBounce {
  0%, 100% {
    height: 8px;
    opacity: 0.4;
  }
  50% {
    height: 36px;
    opacity: 1;
  }
}

.waveform-bar {
  width: 4px;
  background: linear-gradient(to top, #8b5cf6, #ec4899);
  border-radius: 9999px;
  animation: waveBounce 1.2s ease-in-out infinite;
}

.waveform-bar:nth-child(1) { animation-delay: 0.0s; }
.waveform-bar:nth-child(2) { animation-delay: 0.15s; }
.waveform-bar:nth-child(3) { animation-delay: 0.3s; }
.waveform-bar:nth-child(4) { animation-delay: 0.45s; }
.waveform-bar:nth-child(5) { animation-delay: 0.6s; }
.waveform-bar:nth-child(6) { animation-delay: 0.75s; }
.waveform-bar:nth-child(7) { animation-delay: 0.9s; }
.waveform-bar:nth-child(8) { animation-delay: 1.05s; }
.waveform-bar:nth-child(9) { animation-delay: 0.2s; }
.waveform-bar:nth-child(10) { animation-delay: 0.5s; }

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(17, 24, 39, 0.6);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.4);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.8);
}

/* Floating Emoji Reaction Animation */
@keyframes floatUpFade {
  0% {
    transform: translateY(0) scale(0.6) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 1;
    transform: translateY(-20px) scale(1.3) rotate(5deg);
  }
  80% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-260px) scale(1) rotate(-10deg);
    opacity: 0;
  }
}

.floating-reaction {
  position: fixed;
  bottom: 120px;
  pointer-events: none;
  font-size: 2.5rem;
  z-index: 9999;
  animation: floatUpFade 2.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  will-change: transform, opacity;
}

/* ========================================================================== */
/* DYNAMIC AMBIENT BACKDROP (AUDIO-REACTIVE LUXURY AURA)                      */
/* ========================================================================== */
#ambient-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -10;
  overflow: hidden;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.38;
}

.ambient-glow-orb {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  will-change: transform, opacity, filter;
  transition: transform 0.8s ease, opacity 0.8s ease;
}

/* Orb 1: Deep Indigo / Violet */
.orb-1 {
  width: 620px;
  height: 620px;
  top: -120px;
  left: 8%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.38) 0%, rgba(76, 29, 149, 0.14) 55%, transparent 75%);
  filter: blur(75px);
  animation: orbFloat1 22s ease-in-out infinite alternate;
}

/* Orb 2: Warm Rose / Magenta Glow */
.orb-2 {
  width: 580px;
  height: 580px;
  bottom: -100px;
  right: 6%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.30) 0%, rgba(139, 92, 246, 0.12) 60%, transparent 80%);
  filter: blur(80px);
  animation: orbFloat2 26s ease-in-out infinite alternate;
}

/* Orb 3: Cyan / Electric Blue Whisper */
.orb-3 {
  width: 480px;
  height: 480px;
  top: 30%;
  left: 48%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.22) 0%, rgba(59, 130, 246, 0.08) 55%, transparent 75%);
  filter: blur(85px);
  animation: orbFloat3 20s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(70px, 45px) scale(1.12); }
  100% { transform: translate(-40px, 80px) scale(0.96); }
}

@keyframes orbFloat2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-60px, -70px) scale(1.15); }
  100% { transform: translate(50px, -35px) scale(0.92); }
}

@keyframes orbFloat3 {
  0% { transform: translate(0, 0) scale(1); opacity: 0.18; }
  50% { transform: translate(-50px, 35px) scale(1.22); opacity: 0.32; }
  100% { transform: translate(60px, -50px) scale(0.88); opacity: 0.15; }
}

/* When Music is Playing: Rhythmic Tempo Breathing (Sangat Lembut & Mewah) */
body.music-playing #ambient-backdrop {
  opacity: 0.72;
}

body.music-playing .orb-1 {
  animation: orbFloat1 22s ease-in-out infinite alternate, tempoBreathe 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

body.music-playing .orb-2 {
  animation: orbFloat2 26s ease-in-out infinite alternate, tempoBreathe 1.8s cubic-bezier(0.4, 0, 0.2, 1) 0.6s infinite;
}

body.music-playing .orb-3 {
  animation: orbFloat3 20s ease-in-out infinite alternate, tempoBreathe 1.8s cubic-bezier(0.4, 0, 0.2, 1) 1.2s infinite;
}

@keyframes tempoBreathe {
  0%, 100% {
    transform: scale(1);
    filter: blur(75px) brightness(1);
  }
  50% {
    transform: scale(1.06);
    filter: blur(70px) brightness(1.22);
  }
}

/* Floating Sticker Pop */
.floating-sticker-wrapper {
  animation: stickerWiggle 2.4s ease-in-out forwards;
}

@keyframes stickerWiggle {
  0% { transform: scale(0.6) rotate(-8deg); }
  20% { transform: scale(1.15) rotate(6deg); }
  45% { transform: scale(1.05) rotate(-4deg); }
  75% { transform: scale(1) rotate(2deg); }
  100% { transform: scale(0.9) rotate(0deg); }
}

/* ========================================================================== */
/* SNOWFLUFF MASCOT DANCING & CHILL ANIMATIONS                               */
/* ========================================================================== */

/* Idle / Resting Bob */
@keyframes snowfluffBob {
  0%, 100% {
    transform: translateY(0) scale(1, 1) rotate(0deg);
  }
  25% {
    transform: translateY(-4px) scale(1.03, 0.98) rotate(-2deg);
  }
  75% {
    transform: translateY(-3px) scale(1.02, 0.98) rotate(2deg);
  }
}

.snowfluff-bounce {
  animation: snowfluffBob 2.4s ease-in-out infinite;
  transform-origin: bottom center;
  will-change: transform;
}

/* LIVELY DANCE WHEN MUSIC PLAYS (Synchronized Beat & Bounce) */
@keyframes snowfluffDanceBeat {
  0% {
    transform: translateY(0) scale(1, 1) rotate(0deg);
  }
  12% {
    /* Squash & prep to hop left */
    transform: translateY(3px) scale(1.15, 0.85) rotate(-3deg);
  }
  28% {
    /* Hop high into air tilted left with stretch */
    transform: translateY(-13px) scale(0.90, 1.14) rotate(-14deg);
  }
  42% {
    /* Land on left with cute belly squash */
    transform: translateY(1.5px) scale(1.10, 0.90) rotate(-4deg);
  }
  50% {
    /* Return to center groove */
    transform: translateY(-1px) scale(1.02, 0.98) rotate(0deg);
  }
  62% {
    /* Squash & prep to hop right */
    transform: translateY(3px) scale(1.15, 0.85) rotate(3deg);
  }
  78% {
    /* Hop high into air tilted right with stretch */
    transform: translateY(-13px) scale(0.90, 1.14) rotate(14deg);
  }
  92% {
    /* Land on right with cute belly squash */
    transform: translateY(1.5px) scale(1.10, 0.90) rotate(4deg);
  }
  100% {
    transform: translateY(0) scale(1, 1) rotate(0deg);
  }
}

.snowfluff-dancing {
  animation: snowfluffDanceBeat 0.88s cubic-bezier(0.28, 0.84, 0.42, 1) infinite !important;
  transform-origin: bottom center;
  will-change: transform;
  filter: drop-shadow(0 6px 14px rgba(139, 92, 246, 0.45));
}

/* Floor Shadow synchronized with jump */
.snowfluff-floor-shadow {
  position: absolute;
  bottom: 1px;
  width: 26px;
  height: 5px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 9999px;
  filter: blur(1px);
  pointer-events: none;
  transform: scale(1);
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

@keyframes shadowPulseDance {
  0%, 50%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  28%, 78% {
    transform: scale(0.5);
    opacity: 0.15;
  }
  12%, 62%, 42%, 92% {
    transform: scale(1.25);
    opacity: 0.75;
  }
}

.snowfluff-floor-shadow.active {
  animation: shadowPulseDance 0.88s ease-in-out infinite;
}

/* Floating Musical Notes when Dancing */
.snowfluff-notes-layer {
  position: absolute;
  inset: -6px;
  pointer-events: none;
  z-index: 20;
}

@keyframes noteFloatLeft {
  0% {
    opacity: 0;
    transform: translate(4px, 4px) scale(0.4) rotate(0deg);
  }
  25% {
    opacity: 1;
    transform: translate(-10px, -10px) scale(1.1) rotate(-15deg);
  }
  75% {
    opacity: 0.8;
    transform: translate(-16px, -24px) scale(1) rotate(-25deg);
  }
  100% {
    opacity: 0;
    transform: translate(-20px, -34px) scale(0.7) rotate(-40deg);
  }
}

@keyframes noteFloatRight {
  0% {
    opacity: 0;
    transform: translate(-4px, 4px) scale(0.4) rotate(0deg);
  }
  25% {
    opacity: 1;
    transform: translate(10px, -12px) scale(1.1) rotate(15deg);
  }
  75% {
    opacity: 0.8;
    transform: translate(16px, -26px) scale(1) rotate(25deg);
  }
  100% {
    opacity: 0;
    transform: translate(22px, -36px) scale(0.7) rotate(40deg);
  }
}

@keyframes noteFloatSparkle {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.3);
  }
  40% {
    opacity: 1;
    transform: translate(0, -14px) scale(1.3);
  }
  80% {
    opacity: 0.7;
    transform: translate(-2px, -24px) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translate(-4px, -32px) scale(0.4);
  }
}

.dance-note {
  position: absolute;
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.dance-note.note-left {
  left: 0px;
  bottom: 10px;
  animation: noteFloatLeft 1.4s ease-out infinite;
}

.dance-note.note-right {
  right: 0px;
  bottom: 10px;
  animation: noteFloatRight 1.6s ease-out 0.65s infinite;
}

.dance-note.note-top {
  left: 50%;
  top: -2px;
  transform: translateX(-50%);
  animation: noteFloatSparkle 1.2s ease-out 0.3s infinite;
}

/* Joyful 360 Spin Jump when clicked */
@keyframes snowfluffSpinJump {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  20% {
    transform: translateY(4px) scale(1.2, 0.8) rotate(0deg);
  }
  45% {
    transform: translateY(-26px) scale(1.15) rotate(180deg);
  }
  70% {
    transform: translateY(-30px) scale(1.2) rotate(360deg);
  }
  85% {
    transform: translateY(2px) scale(1.12, 0.88) rotate(360deg);
  }
  100% {
    transform: translateY(0) scale(1) rotate(360deg);
  }
}

.snowfluff-spin-jump {
  animation: snowfluffSpinJump 0.72s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes snowfluffWiggle {
  0%, 100% {
    transform: rotate(0deg) scale(1.1);
  }
  25% {
    transform: rotate(-8deg) scale(1.15);
  }
  75% {
    transform: rotate(8deg) scale(1.15);
  }
}

.snowfluff-wiggle {
  animation: snowfluffWiggle 0.5s ease-in-out 2;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-item {
  animation: toastIn 0.25s ease-out forwards;
}

/* ========================================================================== */
/* LIGHTWEIGHT SMOOTH TRANSITIONS & MICRO-INTERACTIONS                       */
/* ========================================================================== */

/* 1. Page Transition: Smooth Entry & Exit */
body {
  animation: pageFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.page-fade-out {
  opacity: 0 !important;
  transform: translateY(-8px) scale(0.995) !important;
  transition: opacity 0.18s cubic-bezier(0.4, 0, 1, 1), transform 0.18s cubic-bezier(0.4, 0, 1, 1) !important;
  pointer-events: none !important;
}

/* 2. Tactile Button Click & Micro-Interactions */
button, 
.reaction-btn, 
.preset-pill, 
.tab-btn-music, 
.tab-btn-social,
.btn-interactive {
  position: relative;
  overflow: hidden;
  will-change: transform;
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

button:active, 
.reaction-btn:active, 
.preset-pill:active,
.btn-interactive:active {
  transform: scale(0.95) !important;
}

/* Ripple wave effect */
@keyframes rippleExpand {
  0% {
    transform: scale(0);
    opacity: 0.45;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

.btn-ripple-wave {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, rgba(139, 92, 246, 0.3) 60%, transparent 100%);
  animation: rippleExpand 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 20;
}

/* 3. Subtab Glide-in Animation */
@keyframes tabGlideIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tab-content-anim {
  animation: tabGlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

/* 4. Modal Spring Animations */
@keyframes modalBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalBackdropOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes modalCardIn {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(16px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalCardOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
}

.modal-backdrop-anim {
  animation: modalBackdropIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-backdrop-exit {
  animation: modalBackdropOut 0.15s ease-in forwards;
}

.modal-card-anim {
  animation: modalCardIn 0.28s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
  will-change: transform, opacity;
}

.modal-card-exit {
  animation: modalCardOut 0.16s ease-in forwards;
  will-change: transform, opacity;
}

/* 5. Interactive Card Hover Lift */
.interactive-card {
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.24s ease, border-color 0.24s ease;
  will-change: transform;
}

.interactive-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px -10px rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
}

/* 6. Mobile Layout Optimizer */
@media (max-width: 1023px) {
  .mobile-pane-hidden {
    display: none !important;
  }
}
@media (min-width: 1024px) {
  .mobile-pane-hidden {
    display: flex !important;
  }
}
