/* ==========================================================================
   Velorah® — Cinematic Hero Section Stylesheet
   ========================================================================== */

/* 1. Custom CSS Variables */
:root {
  /* Dark Color Theme (HSL values) */
  --background: 201 100% 13%;          /* Deep navy blue */
  --foreground: 0 0% 100%;              /* White */
  --muted-foreground: 240 4% 66%;        /* Muted gray */
  --primary: 0 0% 100%;
  --primary-foreground: 0 0% 4%;
  --secondary: 0 0% 10%;
  --muted: 0 0% 10%;
  --accent: 0 0% 10%;
  --border: 0 0% 18%;
  --input: 0 0% 18%;

  /* Font Families */
  --font-display: 'Instrument Serif', serif;
  --font-body: 'Inter', sans-serif;
}

/* 2. Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden !important; /* Hilangkan scroll secara mutlak */
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 3. Utility Classes (Tailwind-compatible) */
.text-foreground {
  color: hsl(var(--foreground));
}

.text-muted-foreground {
  color: hsl(var(--muted-foreground));
}

.bg-background {
  background-color: hsl(var(--background));
}

/* 4. Fullscreen Background Video */
.video-background-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.video-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

/* 5. Liquid Glass Effect */
.liquid-glass {
  background: rgba(255, 255, 255, 0.01);
  background-blend-mode: luminosity;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: hsl(var(--foreground));
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              background-color 0.35s ease, 
              box-shadow 0.35s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.liquid-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.4px;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.15) 20%,
    rgba(255,255,255,0) 40%, rgba(255,255,255,0) 60%,
    rgba(255,255,255,0.15) 80%, rgba(255,255,255,0.45) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.liquid-glass:hover,
.hover\:scale-\[1\.03\]:hover {
  transform: scale(1.03);
  background-color: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2), 0 8px 30px rgba(0, 0, 0, 0.25);
}

.liquid-glass:active {
  transform: scale(0.98);
}

/* Dynamic glow sheen following cursor inside liquid-glass */
.liquid-glass .sheen-glow {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  mix-blend-mode: overlay;
}

.liquid-glass:hover .sheen-glow {
  opacity: 1;
}

/* 6. Animations */
@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-rise {
  animation: fade-rise 0.8s ease-out both;
}

.animate-fade-rise-delay {
  animation: fade-rise 0.8s ease-out 0.2s both;
}

.animate-fade-rise-delay-2 {
  animation: fade-rise 0.8s ease-out 0.4s both;
}

/* 7. Typography Details */
.hero-h1 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -1.2px;
  max-width: 80rem; /* max-w-7xl */
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(1.6rem, min(3.5vw, 4.8vh), 2.85rem);
}

@media (max-width: 640px) {
  .hero-h1 {
    letter-spacing: -0.8px;
    font-size: clamp(1.4rem, 6.5vw, 2.1rem);
  }
}

/* Logo styling */
.logo {
  font-family: 'Instrument Serif', serif;
  font-size: 1.875rem; /* text-3xl */
  line-height: 2.25rem;
  letter-spacing: -0.025em; /* tracking-tight */
  color: hsl(var(--foreground));
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  user-select: none;
}

.logo sup {
  font-size: 0.75rem; /* text-xs */
  line-height: 1;
  margin-left: 2px;
  font-family: var(--font-body);
  font-weight: 400;
}

/* Navigation Links */
.nav-link {
  font-size: 0.875rem; /* text-sm */
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
  position: relative;
  padding: 0.25rem 0;
}

.nav-link:hover {
  color: hsl(var(--foreground));
}

.nav-link.active {
  color: hsl(var(--foreground));
  font-weight: 500;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: hsl(var(--foreground));
  opacity: 0.7;
}

/* Subtext */
.hero-subtext {
  color: hsl(var(--muted-foreground));
  font-size: clamp(0.875rem, min(1.2vw, 1.8vh), 1.125rem);
  line-height: 1.6;
  max-width: 42rem;
  margin-top: clamp(0.85rem, 2.5vh, 2rem);
  margin-left: auto;
  margin-right: auto;
}

/* Button sizing */
.nav-cta {
  padding: 0.55rem 1.4rem;
  font-size: 0.875rem;
  border-radius: 9999px;
}

.hero-cta {
  padding: clamp(0.85rem, 1.8vh, 1.25rem) clamp(2.2rem, 3.5vw, 3.5rem);
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  border-radius: 9999px;
  margin-top: clamp(1.25rem, 3.8vh, 3rem);
}

/* Viewport height optimizations to ensure 100% fit without scrolling */
@media (max-height: 820px) {
  .hero-h1 {
    font-size: clamp(1.4rem, 4.5vh, 2.2rem);
    letter-spacing: -1px;
  }
  .hero-subtext {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    line-height: 1.3;
  }
  .main-search-results-box {
    max-height: clamp(80px, 18vh, 150px);
  }
  .queue-panel {
    height: clamp(300px, 54vh, 460px) !important;
  }
  header nav {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
  #under-header-now-playing {
    margin-top: -0.35rem;
    margin-bottom: 0.15rem;
  }
  .header-track-card {
    padding: 0.2rem 0.75rem;
  }
}

@media (max-height: 680px) {
  .hero-h1 {
    font-size: clamp(1.2rem, 3.8vh, 1.75rem);
    letter-spacing: -0.8px;
  }
  .hero-subtext {
    display: none;
  }
  .main-search-results-box {
    max-height: clamp(70px, 15vh, 120px);
  }
  .queue-panel {
    height: clamp(240px, 48vh, 360px) !important;
  }
  header nav {
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
  }
  #under-header-now-playing {
    margin-top: -0.45rem;
    margin-bottom: 0.05rem;
  }
  .header-track-card {
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
  }
}

/* Mobile Navigation Drawer */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 36, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.mobile-nav-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-overlay .nav-link {
  font-size: 1.5rem;
  font-family: 'Instrument Serif', serif;
  color: hsl(var(--foreground));
}

.mobile-toggle-btn {
  background: transparent;
  border: none;
  color: hsl(var(--foreground));
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================================================
   Responsive Toast Notification (.journey-toast)
   ========================================================================= */
.journey-toast {
  position: fixed;
  top: max(0.85rem, env(safe-area-inset-top, 0.85rem));
  left: 50%;
  transform: translateX(-50%) translateY(-24px) scale(0.96);
  background: rgba(14, 22, 34, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 0.6rem 1.1rem;
  border-radius: 9999px;
  color: hsl(var(--foreground));
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  width: calc(100vw - 1.5rem);
  max-width: calc(100vw - 1.5rem);
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .journey-toast {
    top: 1.5rem;
    width: auto;
    min-width: 320px;
    max-width: min(92vw, 860px);
    padding: 0.7rem 1.75rem;
    font-size: 0.875rem;
  }
}

.journey-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.journey-toast svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #67e8f9;
}

@media (min-width: 640px) {
  .journey-toast svg {
    width: 18px;
    height: 18px;
  }
}

.journey-toast .toast-text {
  flex: 0 1 auto;
  min-width: 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* =========================================================================
   Under-Header Now Playing Bar (Centered)
   ========================================================================= */
#under-header-now-playing {
  margin-top: -0.25rem;
  margin-bottom: 0.35rem;
  z-index: 20;
}

.header-track-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  background: rgba(1, 1, 1, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: calc(100vw - 2rem);
}

.header-track-card:hover {
  background: rgba(16, 24, 38, 0.88);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.header-track-card:active {
  transform: translateY(0) scale(0.98);
}

/* Mini Equalizer inside Header Track Card */
.header-track-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.2px;
  height: 12px;
  flex-shrink: 0;
}

.header-eq-bar {
  width: 2.5px;
  height: 3px;
  background-color: #67e8f9;
  border-radius: 9999px;
  transition: height 0.2s ease;
}

.header-track-card.is-playing .header-eq-bar:nth-child(1) { animation: eq-bounce 0.7s infinite alternate ease-in-out; }
.header-track-card.is-playing .header-eq-bar:nth-child(2) { animation: eq-bounce 1.1s infinite 0.2s alternate ease-in-out; }
.header-track-card.is-playing .header-eq-bar:nth-child(3) { animation: eq-bounce 0.85s infinite 0.4s alternate ease-in-out; }
.header-track-card.is-playing .header-eq-bar:nth-child(4) { animation: eq-bounce 0.95s infinite 0.1s alternate ease-in-out; }

.header-now-playing-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}

/* Under-Header Marquee Viewport and Animation */
.header-marquee-viewport {
  position: relative;
  overflow: hidden;
  max-width: 190px;
  display: flex;
  align-items: center;
  mask-image: none;
  -webkit-mask-image: none;
  transition: max-width 0.2s ease;
}

@media (min-width: 420px) {
  .header-marquee-viewport {
    max-width: 260px;
  }
}

@media (min-width: 640px) {
  .header-marquee-viewport {
    max-width: 380px;
  }
}

@media (min-width: 860px) {
  .header-marquee-viewport {
    max-width: 500px;
  }
}

.header-marquee-viewport.is-overflowing {
  mask-image: linear-gradient(90deg, transparent 0%, #000 8px, #000 calc(100% - 8px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8px, #000 calc(100% - 8px), transparent 100%);
}

.header-marquee-content {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  will-change: transform;
}

.header-track-card:hover .header-marquee-content {
  animation-play-state: paused !important;
}

@keyframes headerMarqueePingPong {
  0%, 18% {
    transform: translateX(0);
  }
  48%, 68% {
    transform: translateX(var(--marquee-distance, -100px));
  }
  94%, 100% {
    transform: translateX(0);
  }
}

@media (max-width: 520px) {
  .header-now-playing-label {
    display: none;
  }
  .header-track-card {
    padding: 0.25rem 0.65rem;
    gap: 0.35rem;
  }
}

/* ==========================================================================
   8. Glassmorphic YouTube Music Player Styles
   ========================================================================== */

.hidden-yt-player {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 1px;
  height: 1px;
  opacity: 0.001;
  pointer-events: none;
  z-index: -1;
}

/* Docked Bottom Music Player */
.music-player-bar {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
  padding: 0.6rem 1.25rem;
  z-index: 30;
  width: 100%;
}

@media (min-width: 768px) {
  .music-player-bar {
    padding: 0.65rem 2rem;
  }
}

.track-thumbnail {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background-color: rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .track-thumbnail {
    width: 48px;
    height: 48px;
  }
}

/* Playing thumbnail glow */
.is-playing .track-thumbnail {
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Live Equalizer Bars */
.live-eq-container {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
  margin-left: 0.25rem;
}

.live-eq-bar {
  width: 2px;
  background: hsl(var(--foreground));
  height: 3px;
  border-radius: 1px;
  transition: height 0.2s ease;
}

.is-playing .live-eq-bar:nth-child(1) { animation: eq-bounce 0.7s infinite alternate ease-in-out; }
.is-playing .live-eq-bar:nth-child(2) { animation: eq-bounce 1.1s infinite 0.2s alternate ease-in-out; }
.is-playing .live-eq-bar:nth-child(3) { animation: eq-bounce 0.85s infinite 0.4s alternate ease-in-out; }
.is-playing .live-eq-bar:nth-child(4) { animation: eq-bounce 0.95s infinite 0.1s alternate ease-in-out; }

@keyframes eq-bounce {
  0% { height: 3px; }
  100% { height: 13px; }
}

/* Control Buttons */
.player-ctrl-btn {
  background: transparent;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.player-ctrl-btn:hover {
  color: hsl(var(--foreground));
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.08);
}

.player-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Progress Bar */
.progress-track-wrapper {
  position: relative;
  width: 100%;
  height: 14px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.progress-track {
  width: 100%;
  height: 3.5px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  position: relative;
  overflow: hidden;
  transition: height 0.15s ease;
}

.progress-track-wrapper:hover .progress-track {
  height: 5px;
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.85) 0%, #ffffff 100%);
  border-radius: inherit;
  transition: width 0.1s linear;
}

/* Volume Slider */
.glass-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
  width: 76px;
  transition: background 0.2s ease;
}

.glass-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: hsl(var(--foreground));
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease;
}

.glass-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* ==========================================================================
   9. Glassmorphic Search Modal
   ========================================================================== */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 15, 28, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-modal-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

.search-modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  background: rgba(10, 26, 44, 0.9);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-modal-backdrop.is-active .search-modal-card {
  transform: scale(1) translateY(0);
}

.search-input-box {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.8rem 6.5rem 0.8rem 2.75rem;
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.search-input-box:focus {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.08);
}

.search-clear-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: hsl(var(--muted-foreground));
  border-radius: 9999px;
  height: 1.85rem;
  padding: 0 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .search-clear-btn {
    height: 2.15rem;
    padding: 0 0.75rem;
    font-size: 0.78rem;
  }
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  color: hsl(var(--foreground));
  transform: scale(1.04);
}

.search-clear-btn:active {
  transform: scale(0.96);
}

.search-submit-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: hsl(var(--foreground));
  border-radius: 9999px;
  height: 1.85rem;
  padding: 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .search-submit-btn {
    height: 2.15rem;
    padding: 0 0.85rem;
    font-size: 0.8rem;
  }
}

.search-submit-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  transform: scale(1.04);
}

.search-submit-btn:active {
  transform: scale(0.96);
}

.search-input-box::placeholder {
  color: hsl(var(--muted-foreground));
  opacity: 0.75;
}

/* Quick Filter Tag Pills */
.filter-tag-pill {
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  user-select: none;
}

.filter-tag-pill:hover {
  color: hsl(var(--foreground));
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Main Landing Page Embedded Search Results Box (Full Transparent & Compact Height) */
.main-search-results-box {
  max-height: clamp(90px, 20vh, 160px);
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}

.search-results-container {
  overflow-y: auto;
  flex: 1;
  padding: 0.15rem 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.search-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.search-item-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateX(4px);
}

.search-thumb {
  width: 48px;
  height: 32px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
}

.search-duration-tag {
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  background: rgba(0, 0, 0, 0.45);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* ==========================================================================
   Docked Audio Visualizer / Music Spectrum (Fully Transparent & Full Width)
   ========================================================================== */
#visualizer-container,
.visualizer-docked {
  width: 100vw;
  width: 100%;
  max-width: 100vw;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0.25rem 0 0 0;
  z-index: 25;
  margin-bottom: 0;
  overflow: visible !important;
}

.visualizer-docked .visualizer-docked-inner {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow: visible !important;
}

.visualizer-docked .visualizer-canvas-wrapper {
  position: relative;
  width: 100% !important;
  background: transparent !important;
  border-radius: 0 !important;
  overflow: hidden;
  border: none !important;
  box-shadow: none !important;
  height: 3rem; /* ~48px */
}

#visualizer-status {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

#center-visualizer {
  width: 100%;
  height: 100%;
  display: block;
}

.viz-mode-btn {
  background: transparent;
  border: none;
  color: hsl(var(--muted-foreground));
  font-size: 0.65rem;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.viz-mode-btn:hover {
  color: hsl(var(--foreground));
  background: rgba(255, 255, 255, 0.1);
}

.viz-mode-btn.active {
  color: hsl(var(--foreground));
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

@media (max-height: 820px) {
  .visualizer-docked .visualizer-canvas-wrapper {
    height: 2.5rem !important; /* ~40px */
  }
}

@media (max-height: 680px) {
  .visualizer-docked {
    padding: 0.15rem 0 0 0 !important;
  }
  .visualizer-docked .visualizer-canvas-wrapper {
    height: 2rem !important; /* ~32px */
  }
}

/* ==========================================================================
   11. Playback Queue Panel (Desktop Right Docked / Mobile Slide Drawer)
   ========================================================================== */
.queue-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.queue-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

.queue-panel {
  position: fixed;
  z-index: 50;
  background: rgba(4, 12, 24, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

/* Desktop: Appears docked on the right side, vertical align center */
@media (min-width: 1024px) {
  .queue-panel {
    right: 1.25rem;
    top: 50%;
    bottom: auto;
    width: 295px;
    height: clamp(360px, 58vh, 560px);
    max-height: calc(100dvh - 8.5rem);
    transform: translateY(-50%);
    opacity: 1;
    pointer-events: auto;
  }

  .queue-panel.is-closed {
    transform: translate(calc(100% + 2rem), -50%);
    opacity: 0;
    pointer-events: none;
  }
}

/* Mobile & Tablet: Slide Drawer from Right, vertical align center */
@media (max-width: 1023px) {
  .queue-panel {
    right: 0.75rem;
    top: 50%;
    bottom: auto;
    width: 310px;
    max-width: calc(100vw - 1.5rem);
    height: clamp(320px, 68vh, 520px);
    max-height: calc(100dvh - 5rem);
    transform: translate(calc(100% + 1.5rem), -50%);
    opacity: 0;
    pointer-events: none;
  }

  .queue-panel.is-open {
    transform: translateY(-50%);
    opacity: 1;
    pointer-events: auto;
  }
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.queue-now-playing-box {
  background: rgba(255, 255, 255, 0.015);
}

.queue-items-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.queue-track-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.queue-track-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-add-queue {
  cursor: pointer;
  user-select: none;
}

.btn-add-queue:active {
  transform: scale(0.9);
}

.queue-autoplay-pill {
  user-select: none;
  transition: all 0.2s ease;
}

.queue-autoplay-pill:active {
  transform: scale(0.95);
}

.queue-autoplay-pill.is-off {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: hsl(var(--muted-foreground)) !important;
}

.queue-autoplay-pill.is-off #autoplay-dot {
  background: rgba(255, 255, 255, 0.3) !important;
  animation: none !important;
}

/* ==========================================================================
   12. Switch Video Mode & Fullscreen YouTube Video Clip Background
   ========================================================================== */
.switch-video {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  padding: 2px;
  user-select: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.switch-video-btn {
  background: transparent;
  border: none;
  color: hsl(var(--muted-foreground));
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.switch-video-btn:hover {
  color: hsl(var(--foreground));
  background: rgba(255, 255, 255, 0.1);
}

.switch-video-btn.active {
  color: hsl(var(--foreground));
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

/* Meta Action Buttons Next to (Default/Video): Eye, Fullscreen, Popout */
.btn-toggle-main-content,
.btn-meta-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: hsl(var(--muted-foreground));
  border-radius: 9999px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  user-select: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.btn-toggle-main-content:hover,
.btn-meta-action:hover {
  color: hsl(var(--foreground));
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.28);
  transform: scale(1.08);
}

.btn-toggle-main-content:active,
.btn-meta-action:active {
  transform: scale(0.92);
}

.btn-toggle-main-content.is-hidden-mode,
.btn-meta-action.is-active {
  background: rgba(6, 182, 212, 0.22);
  border-color: rgba(6, 182, 212, 0.5);
  color: #67e8f9;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

/* Zen Mode: Hide / Show Main Content Transition */
main,
#main-content {
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

main.main-content-hidden,
#main-content.main-content-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: scale(0.96) translateY(8px) !important;
}

/* Default Hero Video transition */
#hero-video {
  transition: opacity 0.5s ease;
}

#hero-video.is-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* YouTube Video Clip Backdrop */
.yt-video-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.yt-video-backdrop.hidden-backdrop {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: -1 !important;
  /* Mi Browser fix: opacity < 0.1 triggers Chromium EffectiveVisibility suspension, freezing the video decoder.
     Use opacity: 1 with clip-path to hide visually but keep decoder active. */
  opacity: 1 !important;
  clip-path: inset(0 0 99.9% 0) !important;
  pointer-events: none !important;
}

.yt-video-backdrop.active-backdrop {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0 !important;
  opacity: 1 !important;
  pointer-events: none !important;
}

.yt-player-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw; /* 16:9 aspect ratio */
  min-height: 100vh;
  min-width: 177.77vh; /* 16:9 aspect ratio */
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.yt-player-wrapper iframe,
.yt-player-wrapper #yt-player-container {
  width: 100% !important;
  height: 100% !important;
  display: block;
  border: none !important;
  pointer-events: none;
  filter: brightness(0.68) saturate(1.15);
}

.yt-video-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0, 8, 20, 0.35) 0%, rgba(0, 8, 20, 0.72) 100%);
  pointer-events: none;
  z-index: 1;
}

/* =========================================================================
   Video Quality Settings Modal & Buttons
   ========================================================================= */
.btn-open-quality {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-open-quality:hover {
  border-color: rgba(6, 182, 212, 0.4);
}

.quality-display-badge {
  color: #67e8f9;
  font-family: monospace;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.video-quality-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.video-quality-modal.hidden {
  display: none !important;
}

.video-quality-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 16, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: qFadeIn 0.2s ease-out;
}

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

.video-quality-dialog {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 370px;
  background: rgba(18, 22, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1.25rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  animation: qPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes qPopIn {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.video-quality-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quality-opt-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.quality-opt-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateX(2px);
}

.quality-opt-btn.active {
  background: rgba(6, 182, 212, 0.14);
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 2px 12px rgba(6, 182, 212, 0.15);
}

.quality-check-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  color: transparent;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.quality-opt-btn.active .quality-check-icon {
  color: #22d3ee;
  background: rgba(6, 182, 212, 0.25);
  border-color: rgba(6, 182, 212, 0.5);
}

.quality-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
}

.quality-desc {
  display: block;
  font-size: 0.68rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.1rem;
}

.quality-tag {
  font-size: 0.62rem;
  font-family: monospace;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  color: hsl(var(--muted-foreground));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.quality-opt-btn.active .quality-tag {
  background: rgba(6, 182, 212, 0.2);
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.4);
}

/* =========================================================================
   Visualizer Settings Popover & Toggle Menu
   ========================================================================= */
.viz-settings-toggle-btn {
  font-family: var(--font-body);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.viz-settings-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.viz-settings-toggle-btn.is-active {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(6, 182, 212, 0.45);
}

.viz-settings-toggle-btn.is-active #viz-setting-chevron {
  transform: rotate(180deg);
}

.viz-settings-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  z-index: 99999;
  width: 280px;
  max-width: calc(100vw - 2rem);
  background: rgba(16, 20, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1rem;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  padding: 0.85rem;
  animation: vizPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.viz-settings-popover.hidden {
  display: none !important;
}

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

.viz-quality-pill {
  font-size: 0.68rem;
  font-family: monospace;
  font-weight: 500;
  padding: 0.35rem 0.3rem;
  border-radius: 0.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.viz-quality-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.viz-quality-pill.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.5);
  color: #67e8f9;
  font-weight: 600;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.2);
}

.viz-quality-more {
  color: hsl(var(--muted-foreground));
  font-size: 0.65rem;
}

