/* AraMuse v2.5 — White & Sky Blue + Midnight Dark Theme + Spotify/YT Music Mobile UX */

:root {
  --aramuse-accent: #0284c7;
  --aramuse-accent-soft: #0ea5e9;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

.aramuse-bg {
  background-color: #f4faff;
  background-image:
    radial-gradient(at 0% 0%, rgba(186, 230, 253, 0.45) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(224, 242, 254, 0.6) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(186, 230, 253, 0.25) 0px, transparent 55%);
}

html.dark .aramuse-bg {
  background-color: #0b1120;
  background-image:
    radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.14) 0px, transparent 48%),
    radial-gradient(at 100% 0%, rgba(56, 189, 248, 0.10) 0px, transparent 48%),
    radial-gradient(at 50% 100%, rgba(2, 132, 199, 0.08) 0px, transparent 55%);
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.03); }
}

.animate-spin-slow {
  animation: pulseGlow 4s ease-in-out infinite;
}

.paused {
  animation-play-state: paused !important;
  opacity: 0.25 !important;
}

/* Guaranteed high-contrast active pills (prevents hover/class-order override bugs) */
.tab-pill {
  background-color: #f0f9ff;
  color: #334155;
  border: 1px solid rgba(186, 230, 253, 0.7);
}
.tab-pill:hover {
  background-color: #e0f2fe;
}
html.dark .tab-pill {
  background-color: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}
html.dark .tab-pill:hover {
  background-color: #334155;
}
.tab-pill.is-active,
.tab-pill.is-active:hover,
html.dark .tab-pill.is-active,
html.dark .tab-pill.is-active:hover {
  background-color: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.28);
}

/* Mobile Navigation (Spotify / YT Music style) */
.mobile-nav-btn {
  color: #64748b;
  transition: color 0.2s ease, transform 0.15s ease;
}
html.dark .mobile-nav-btn {
  color: #94a3b8;
}
.mobile-nav-btn.is-active {
  color: #0284c7;
}
html.dark .mobile-nav-btn.is-active {
  color: #38bdf8;
}

/* Hide native browser search clear X so only our custom clear button appears */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* Mobile Layout Views (< 1024px): Zero scrolling needed to see Search Results! */
@media (max-width: 1023px) {
  #desktop-now-playing-card,
  #desktop-stage-card {
    display: none !important;
  }

  #track-list {
    max-height: none !important;
    overflow-y: visible !important;
  }

  body[data-mobile-view="search"] #left-column,
  body[data-mobile-view="library"] #left-column,
  body[data-mobile-view="search"] #mood-card,
  body[data-mobile-view="library"] #mood-card {
    display: none !important;
  }

  body[data-mobile-view="search"] #mobile-search-discover.is-hidden,
  body:not([data-mobile-view="search"]) #mobile-search-discover {
    display: none !important;
  }

  /* In mobile search view with no results yet, hide empty library card so Discover sits cleanly on top */
  body[data-mobile-view="search"] #library-card.is-mobile-hidden {
    display: none !important;
  }

  /* In mobile search view with results, hide extra library tabs header so results sit RIGHT below the search bar like Spotify/YT Music */
  body[data-mobile-view="search"] #library-tabs-header {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  #mobile-search-discover {
    display: none !important;
  }
}

/* Mobile Full-Screen Now Playing Sheet */
#mobile-player-sheet {
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}
#mobile-player-sheet.is-open {
  transform: translateY(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Hide scrollbars cleanly for horizontal pill strips */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0f9ff; }
::-webkit-scrollbar-thumb { background: #bae6fd; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #38bdf8; }

html.dark ::-webkit-scrollbar-track { background: #0f172a; }
html.dark ::-webkit-scrollbar-thumb { background: #1e293b; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #38bdf8; }

/* Custom Range Seekbar (Accessible + Smooth) */
input[type="range"].seek-range {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
input[type="range"].seek-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 9999px;
  background: transparent;
}
input[type="range"].seek-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background: #0284c7;
  border: 2px solid #ffffff;
  margin-top: -4px;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.45);
  transition: transform 0.12s ease;
}
input[type="range"].seek-range:hover::-webkit-slider-thumb,
input[type="range"].seek-range:focus-visible::-webkit-slider-thumb {
  transform: scale(1.2);
}

/* Equalizer Vertical Sliders */
input[type="range"].eq-slider {
  -webkit-appearance: none;
  background: #bae6fd;
  outline: none;
  border-radius: 9999px;
}

html.dark input[type="range"].eq-slider {
  background: #1e293b;
}

input[type="range"].eq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0ea5e9;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.45);
  transition: transform 0.12s ease;
}

input[type="range"].eq-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Synced Lyrics Karaoke Highlighting */
.lyric-line {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  color: #64748b;
}

html.dark .lyric-line {
  color: #94a3b8;
}

.lyric-line:hover {
  color: #0284c7;
}

.lyric-line.active {
  color: #0284c7;
  font-size: 1.15rem;
  font-weight: 800;
  text-shadow: 0 4px 18px rgba(14, 165, 233, 0.22);
  transform: scale(1.03);
}

html.dark .lyric-line.active {
  color: #38bdf8;
  text-shadow: 0 4px 20px rgba(56, 189, 248, 0.35);
}

/* Fullscreen & Mobile Sheet Karaoke Lyrics */
.fs-lyric-line {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  color: rgba(255, 255, 255, 0.42);
}

.fs-lyric-line:hover {
  color: rgba(255, 255, 255, 0.78);
}

.fs-lyric-line.active {
  color: #ffffff;
  transform: scale(1.05);
  text-shadow: 0 0 28px rgba(56, 189, 248, 0.65);
}

/* Focus visible rings for keyboard accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

/* Toast animations */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.toast-item {
  animation: toastIn 0.22s ease forwards;
}
