/* ════════════════════════════════════════════════════════════
   NEPALI CHRISTIAN BHAJAN — -STYLE DARK UI
   Palette: #0f0f0f / #181818 / #242424 · accent #5b4827
════════════════════════════════════════════════════════════ */

:root {
  /* ── Core Palette — Dark Mode (default) ── */
  --bg:           #0f0f0f;
  --surface:      #181818;
  --panel:        #1a1a1a;
  --card:         #242424;
  --card-hover:   #2a2a2a;

  --border:       #282828;
  --border-mid:   #333333;
  --border-light: #404040;

  --text:         #ffffff;
  --text-sec:     #d0d0d0;
  --text-dim:     #a0a0a0;
  --text-muted:   #6a6a6a;
  --text-faint:   #5e5e5e;

  /* Accent — green ── */
  --accent:       #2e6b4a;
  --accent-light: #4d9e72;
  --accent-glow:  #325540;

  /* Functional colors */
  --accent-green: #4ec994;
  --accent-orange:#e8944a;
  --chord:        #7aafd4;
  --accent-gold:  #c8a96e;

  /* ── Typography ── */
  --font-body:      system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:      ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --font-devanagari:"Tiro Devanagari Sanskrit", serif;

  /* ── Spacing ── */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;

  /* ── Layout Dimensions ── */
  --nav-w:    14rem;    /* left nav */
  --list-w:   22rem;   /* center song list */
}

/* ══════════════════════════════════════════════════════════
   LIGHT MODE PALETTE
══════════════════════════════════════════════════════════ */
body.light-mode {
  --bg:           #f8f8f8;
  --surface:      #ffffff;
  --panel:        #fafafa;
  --card:         #eeeeee;
  --card-hover:   #e4e4e4;

  --border:       #d8d8d8;
  --border-mid:   #ccc;
  --border-light: #ffffff;

  --text:         #1a1a1a;
  --text-sec:     #333333;
  --text-dim:     #555555;
  --text-muted:   #888888;
  --text-faint:   #aaaaaa;

  --accent:       #2e6b4a;
  --accent-light: #4d9e72;
  --accent-glow:  #325540;

  --accent-green: #4ec994;
  --accent-orange:#d87a3a;
  --chord:        #4a7db0;
  --accent-gold:  #b8865e;
}

body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════════════════
    ROOT — 3-column fixed layout
══════════════════════════════════════════════════════════ */
.-root {
  display: grid;
  grid-template-columns: var(--nav-w) var(--list-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════
   LEFT NAV SIDEBAR
══════════════════════════════════════════════════════════ */
.nav-sidebar {
  background: #000000;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

body.light-mode .nav-sidebar {
  background: #f5f5f5;
}

/* Logo / Brand */
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-cross {
  font-size: 1.5rem;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}

.nav-brand-main {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-brand-sub {
  font-size: 0.625rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* Theme toggle button */
.theme-toggle-wrap {
  padding: var(--sp-3) var(--sp-2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.theme-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}

.theme-toggle:hover {
  background: var(--card);
  color: var(--text-sec);
  border-color: var(--border-mid);
}

.theme-icon {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.theme-label {
  flex: 1;
  text-align: left;
}

/* Nav list */
.nav-list {
  list-style: none;
  padding: var(--sp-3) var(--sp-2);
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
  user-select: none;
}

.nav-item:hover {
  background: var(--card);
  color: var(--text-sec);
}

.nav-item.active {
  background: var(--accent);
  color: var(--text);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px; 
  color: var(--text-dim); 
  transition: color 0.2s ease;
}

.nav-item.active .nav-icon {
  color: var(--accent-green);
}

.nav-item:hover .nav-icon {
  color: var(--text);
}

.nav-icon svg {
  display: block;
}

.nav-item[data-cat="Favorites"].active .nav-icon svg {
  fill: var(--accent-green);
}

.nav-label { flex: 1; }

/* Alpha bar inside nav */
.alpha-section {
  padding: var(--sp-3) var(--sp-3);
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0);
  flex-shrink: 0;
}

.alpha-lbl {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: var(--text-faint);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

.alpha-grid { display: flex; flex-wrap: wrap; gap: 3px; }

.a-btn {
  width: 1.25rem; height: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-devanagari);
  font-size: 0.5625rem;
  transition: all 0.1s;
  user-select: none;
}
.a-btn:hover { border-color: var(--border-mid); color: var(--text-sec); background: var(--card); }
.a-btn.on    { background: var(--accent); border-color: var(--accent); color: var(--text); font-weight: 600; }
.a-btn.none  { opacity: 0.18; pointer-events: none; }

/* ══════════════════════════════════════════════════════════
   CENTER PANEL — song list
══════════════════════════════════════════════════════════ */
.center-panel {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Top Bar ── */
.top-bar {
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  position: sticky;
  top: 0;
  z-index: 10;
}

.top-bar-left {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}

.top-bar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.top-bar-count {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
}

.top-bar-right {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.sort-filter-row {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

/* Search */
.search-wrap {
  flex: 1;
  position: relative;
}

.search-ico {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
  pointer-events: none;
  line-height: 1;
}

.search-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  padding: 0.45rem 2rem 0.45rem 1.9rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); background: var(--card-hover); }

.search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  padding: 2px 4px;
  transition: color 0.1s;
}
.search-clear:hover { color: var(--text); }

/* Sort */
.sort-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-wrap:hover .sort-icon {
  color: var(--text);
}

.sort-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  
  /* Styling the box */
  padding: var(--sp-1) var(--sp-6) var(--sp-1) var(--sp-2); 
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.875rem;
}

.sort-icon {
  position: absolute;
  right: 8px; 
  pointer-events: none; 
  color: var(--text-faint);
  width: 14px; 
  height: 14px;
}

.sort-wrap:hover .sort-icon {
  color: var(--text);
}

/* ── Song list ── */
.song-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-mid) transparent;
}
.song-list::-webkit-scrollbar { width: 4px; }
.song-list::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 2px; }

/* Group header */
.grp-hd {
  padding: var(--sp-4) var(--sp-4) var(--sp-1);
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: var(--text-faint);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 5;
}

.grp-hd::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Song row */
.sb-item {
  padding: var(--sp-2) var(--sp-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  transition: background 0.1s;
  border-left: 2px solid transparent;
}

.sb-item:hover { background: var(--card); }
.sb-item.on    { background: var(--card-hover); border-left-color: var(--accent); }

.sb-num {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-faint);
  min-width: 2rem;
  text-align: right;
  flex-shrink: 0;
}
.sb-item.on .sb-num { color: var(--accent); }

.sb-info { flex: 1; min-width: 0; }

.sb-ne {
  font-family: var(--font-devanagari);
  font-size: 0.9375rem;
  color: var(--text-sec);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-item.on .sb-ne { color: var(--text); }

.sb-artist {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.sb-tags {
  display: flex;
  gap: 3px;
  margin-top: var(--sp-1);
  flex-wrap: wrap;
}

.stag {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid;
  line-height: 1.6;
}

.stag-a   { color: var(--accent-green);  border-color: rgba(78,201,148,0.25);  background: rgba(78,201,148,0.07); }
.stag-v   { color: var(--accent-orange); border-color: rgba(232,148,74,0.25);  background: rgba(232,148,74,0.07); }
.stag-c   { color: var(--chord);         border-color: rgba(122,175,212,0.25); background: rgba(122,175,212,0.07); }
.stag-fav { color: var(--accent-orange); border-color: rgba(232,148,74,0.3);   background: rgba(232,148,74,0.12); }

.no-res {
  padding: var(--sp-8) var(--sp-4);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-faint);
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════
   RIGHT DETAIL PANEL
══════════════════════════════════════════════════════════ */
.detail-panel {
  background: var(--bg);
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--border-mid) transparent;
}
.detail-panel::-webkit-scrollbar { width: 4px; }
.detail-panel::-webkit-scrollbar-thumb { background: var(--border-mid); }

/* ── Welcome ── */
.welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-6);
  padding: var(--sp-12) var(--sp-8);
  text-align: center;
}

.w-cross {
  font-size: 10rem;
  color: var(--text-dim);
  opacity: 0.2;
  animation: wf 6s ease-in-out infinite;
}

@keyframes wf {
  0%,100% { transform: translateY(0); opacity: 0.2; }
  50%      { transform: translateY(-10px); opacity: 0.35; }
}

.w-rule {
  width: 2.5rem;
  height: 1px;
  background: var(--border-light);
}

.w-sub {
  font-size: 0.875rem;
  color: var(--text-faint);
  max-width: 20rem;
  line-height: 1.6;
}

/* ── Song Detail ── */
.song-detail { display: none; flex-direction: column; animation: fd 0.2s ease; }
.song-detail.on { display: flex; }

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

/* Hero */
.hero {
  padding: var(--sp-8) var(--sp-8) var(--sp-6);
  background: linear-gradient(180deg, #242424 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

body.light-mode .hero {
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.hero::before {
  content: '✝';
  position: absolute;
  right: var(--sp-8);
  top: var(--sp-5);
  font-size: 7rem;
  color: var(--text);
  opacity: 0.02;
  pointer-events: none;
  line-height: 1;
}

.h-pills {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.hpill {
  padding: 0.2rem 0.625rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid;
  line-height: 1.5;
}

.hp-num { background: var(--accent); color: #000; border-color: var(--accent); }
.hp-key { background: transparent; color: var(--chord); border-color: rgba(122,175,212,0.3); }
.hp-cat { background: transparent; color: var(--text-dim); border-color: var(--border-mid); }

.h-ne {
  font-family: var(--font-devanagari);
  font-size: 1.875rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: var(--sp-2);
  word-break: break-word;
}

.h-en {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: var(--sp-4);
}

/* Favorite button */
.fav-btn {
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 0.15rem 0.6rem;
  cursor: pointer;
  transition: all 0.15s;
}
.fav-btn:hover  { border-color: var(--accent-orange); color: var(--accent-orange); }
.fav-btn.active { border-color: var(--accent-orange); color: var(--accent-orange); background: rgba(232,148,74,0.08); }

/* Media row */
.media-row {
  padding: var(--sp-5) var(--sp-8);
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}


.mc {
  flex: 1;
  min-width: 15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.18s;
}
.mc:hover { border-color: var(--border-mid); }

/* Match audio width to video (540px max) */
.mc-audio {
  max-width: 540px;
  width: 100%;
}

.mc-video {
  max-width: 540px;
  width: 100%;
}

.mc-hdr {
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.mc-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mc-dot.audio { background: var(--accent-green); box-shadow: 0 0 4px rgba(78,201,148,0.5); }
.mc-dot.video { background: var(--accent-orange); box-shadow: 0 0 4px rgba(232,148,74,0.5); }

.mc-lbl {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Lyrics */
.lyrics-wrap {
  padding: var(--sp-6) var(--sp-8) var(--sp-12);
  background: var(--surface);
  flex: 1;
}

/* ══════════════════════════════════════════════════════════
   AUDIO PLAYER
══════════════════════════════════════════════════════════ */
.audio-body {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  height: 9rem;
  justify-content: center;
}

.waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 2.5rem;
  flex: 0 0 auto;
}

.wb {
  flex: 1;
  min-width: 2px;
  max-width: 5px;
  background: var(--border-mid);
  border-radius: 1px;
  transition: background 0.2s;
  animation: none;
}
.wb.playing {
  background: var(--accent);
  animation: wave var(--d, 0.8s) ease-in-out infinite alternate;
}
@keyframes wave {
  from { transform: scaleY(0.35); }
  to   { transform: scaleY(1); }
}

.ap-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.ap-play-btn {
  width: 2.5rem; 
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #000; 
  cursor: pointer;
  display: flex; 
  align-items: center; 
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.1s, opacity 0.15s;
  padding: 0;
}

.ap-play-btn svg.lucide-play {
  margin-left: 2px;
}

.ap-play-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor; 
}

.ap-play-btn:hover { opacity: 0.85; transform: scale(1.05); }

.ap-skip-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-1);
  transition: color 0.2s;
}

.ap-skip-btn:hover {
  color: var(--text);
}

.ap-skip-btn svg {
  width: 20px;
  height: 20px;
}

.skip-icon { font-size: 0.75rem; }
.skip-lbl  { font-size: 0.65rem; font-weight: 600; }

.ap-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ap-progress {
  width: 100%;
  cursor: pointer;
  padding: 0.3rem 0;
  /* No absolute positioning */
}

/* Make audio controls more resilient */
.ap-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;       /* Fallback for narrow spaces */
}

.ap-right {
  flex: 1;
  min-width: 120px;
}

.audio-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  height: auto;
  min-height: 9rem;
  justify-content: center;
}

.ap-track {
  width: 100%;
  height: 4px;
  background: var(--border-mid);
  border-radius: 2px;
  overflow: hidden;
}
.ap-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.1s linear;
}
.ap-progress:hover .ap-track { height: 6px; margin: -1px 0; }

.ap-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.ap-time { font-size: 0.7rem; color: var(--text-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }

.ap-vol-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
#ap-vol-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  transition: color 0.2s;
}
#ap-vol-icon:hover { 
  color: var(--text);
  opacity: 1; 
}

.ap-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 5rem; height: 3px;
  background: var(--border-mid);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.ap-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  cursor: pointer;
}
.ap-vol-slider:hover::-webkit-slider-thumb { background: var(--accent); }
.ap-vol-slider::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); border: none; }

.ap-error { font-size: 0.7rem; color: #e87a7a; padding-top: 0.2rem; }
.ap-error a { color: #e87a7a; }

/* ══════════════════════════════════════════════════════════
   VIDEO PLAYER
══════════════════════════════════════════════════════════ */
.vthumb-wrap { 
  display: flex; 
  flex-direction: column; 
  gap: 0; 
}

#video-embed-wrap {
  display: none; 
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  background: #000;
  transition: background-color 0.3s ease;
}

body.light-mode #video-embed-wrap {
  background: #e8e8e8;
}

.vthumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

body.light-mode .vthumb {
  background: #e8e8e8;
}

.vt-thumb-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s, opacity 0.2s;
}
.vthumb:hover .vt-thumb-img { transform: scale(1.03); opacity: 0.85; }

.vt-overlay {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(0,0,0,0.25);
  transition: background 0.2s;
}

.vthumb:hover .vt-play-circle { 
  transform: scale(1.1); 
  background: rgba(255,255,255,0.25); 
  border-color: #fff;
}

.vt-play-circle {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  color: #fff;
  /* Removed font-size 1.1rem; now using Flexbox for SVG */
  display: flex; 
  align-items: center; 
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
  padding: 0; /* Ensures SVG is centered */
} 

.vt-play-circle svg.lucide-play {
  margin-left: 3px;
}

.vt-play-circle svg.lucide-x {
  margin-left: 0;
}

.vthumb:hover .vt-play-circle { 
  transform: scale(1.1); 
  background: rgba(255,255,255,0.25); 
  border-color: #fff;
}

.vt-play-circle svg {
  width: 22px;
  height: 22px;
  display: block;
}

.yt-embed-wrap { 
  width: 100%; 
  aspect-ratio: 16/9; 
  border-radius: 8px; 
  overflow: hidden; 
  background: #000; 
  transition: background-color 0.3s ease;
}

body.light-mode .yt-embed-wrap {
  background: #e8e8e8;
}

.yt-embed-wrap iframe { 
  width: 100%; 
  height: 100%; 
  border: none; 
  display: block; 
}

.vt-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #000 0%, #0d0d0d 60%, #111 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; color: var(--text); opacity: 0.04;
}
.vt-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 2rem 2rem;
  opacity: 0.25;
}

.v-link {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--border-mid);
  padding: 0.2rem var(--sp-2);
  border-radius: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.13s;
}
.v-link:hover { border-color: var(--border-light); color: var(--text); background: var(--panel); }

.no-media { padding: var(--sp-4) var(--sp-5); font-size: 0.875rem; color: var(--text-faint); }

/* ══════════════════════════════════════════════════════════
   LYRICS TOOLBAR
══════════════════════════════════════════════════════════ */
.l-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

.tlbl {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.view-tog {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.view-tog button {
  padding: var(--sp-2) var(--sp-3);
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.view-tog button:last-child { border-right: none; }
.view-tog button:hover  { color: var(--text-dim); background: var(--panel); }
.view-tog button.active { background: var(--text); color: var(--bg); font-weight: 600; }

.tp-grp { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }

.tp-btn {
  width: 1.625rem; height: 1.625rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 0.875rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.tp-btn:hover { border-color: var(--border-mid); color: var(--text); }

.tp-key {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--chord);
  min-width: 1.5rem;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════
   LYRIC BODY
══════════════════════════════════════════════════════════ */
.l-body { max-width: 42rem; }

.verse { margin-bottom: var(--sp-8); }

.v-lbl {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-2);
}
.v-lbl::after { content: ''; flex: 0 0 1.25rem; height: 1px; background: var(--border); }

.chorus {
  background: rgba(255,255,255,0.02);
  border-left: 1.5px solid var(--accent);
  padding: var(--sp-2) var(--sp-4);
  border-radius: 0 6px 6px 0;
}

.lyric-line { margin-bottom: var(--sp-1); }

.lyric-text {
  font-family: var(--font-devanagari);
  font-size: 1.0625rem;
  color: var(--text-sec);
  line-height: 1.6;
  white-space: pre-wrap;
}
.lyric-text.bare { font-size: 1.1875rem; line-height: 1.7; color: var(--text); }

.chord-block { margin-bottom: 0.15rem; line-height: 1; }

pre.chord-line,
pre.lyric-pre {
  font-family: 'Courier New', Courier, monospace;
  margin: 0; padding: 0;
  white-space: pre;
  overflow-x: auto;
  background: transparent;
  border: none;
  line-height: 1.45;
}
pre.chord-line { font-size: 0.8rem; font-weight: 700; color: var(--chord); min-height: 1.1rem;  white-space: pre-wrap;
  word-break: break-all; }
pre.lyric-pre  { font-size: 1rem; color: var(--text-sec); font-family: var(--font-devanagari), 'Courier New', monospace;   white-space: pre-wrap;
  word-break: break-all;}

.lyric-text.bare {
  font-family: var(--font-devanagari);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-sec);
}

/* ══════════════════════════════════════════════════════════
   SCROLL TO TOP
══════════════════════════════════════════════════════════ */
.scroll-top {
  position: fixed;
  bottom: var(--sp-5); right: var(--sp-5);
  width: 2.125rem; height: 2.125rem;
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 0.8125rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s;
  z-index: 100;
}
.scroll-top.show { opacity: 1; pointer-events: auto; }
.scroll-top:hover { border-color: var(--border-light); color: var(--text); }


/* Container for the artist and their submenu */
.artist-group {
  border-bottom: 1px solid var(--border);
}

.artist-group:last-child {
  border-bottom: none;
}

/* Remove the individual item border when it's part of a group to avoid double lines */
.artist-group .artist-item {
  border-bottom: none;
}

.artist-submenu {
  background: rgba(0, 0, 0, 0.1); /* Slightly darker background for depth */
  padding: 4px 0 8px 0;
}

.artist-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* Allows submenu to drop to the next line */
  padding: 12px 16px;
  gap: 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.artist-item:hover {
  background: var(--card);
}

.artist-img-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
}

.artist-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artist-info {
  flex: 1; /* Takes up remaining space in the top row */
  min-width: 0;
}

.artist-count {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Light mode adjustment for submenu background */
body.light-mode .artist-submenu {
  background: rgba(0, 0, 0, 0.05);
}

.sub-song-item {
  /* 76px = 16px padding + 48px image + 12px gap to align with artist name */
  padding: 10px 16px 10px 76px; 
  font-size: 0.85rem;
  color: var(--text-sec);
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.sub-song-item:last-child {
  border-bottom: none;
}

.sub-song-item:hover {
  background: var(--card-hover);
  color: var(--text);
  border-left-color: var(--accent);
}

/* Fallback message if no songs found */
.sub-song-item.none {
  color: var(--text-muted);
  font-style: italic;
  cursor: default;
}

.artist-name {
  font-weight: 500;
  color: var(--text);
}

.artist-count {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.sub-song-item.active {
  background: var(--card-hover);
  color: var(--text);
  border-left-color: var(--accent-light);
  font-weight: 500;
}


/* Close button for video embed */
.video-close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0,0,0,0.7);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  z-index: 10;
  font-size: 1.2rem;
  transition: 0.1s;
}
.video-close-btn:hover {
  background: rgba(0,0,0,0.9);
  transform: scale(1.05);
}

/* Chevron animation */
.chevron {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.3s;
}

.expanded .chevron {
  color: var(--accent-light);
}

/* Light mode adjustments */
body.light-mode .artist-submenu {
  background: rgba(0, 0, 0, 0.03);
}


.mc-video {
  max-width: 540px; /* Limits size when it's the only item in the row */
  width: 100%;     /* Ensures it stays responsive on smaller screens */
  margin-right: auto; /* Keeps it left-aligned if it doesn't fill the row */
}

/* Ensure the video body doesn't overflow */
.video-body {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}
/* ══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — Added for mobile support
══════════════════════════════════════════════════════════ */

/* Mobile Bottom Navigation - Hidden on desktop */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 200;
  flex-direction: row;
  justify-content: space-around;
  align-items: stretch;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 8px 4px;
}

.mobile-nav-btn:active {
  background: rgba(78, 201, 148, 0.1);
}

.mobile-nav-btn.active {
  color: var(--accent-green);
}

.mobile-nav-btn svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

/* Mobile back button styling */
.mobile-back-btn {
  background: none !important;
  border: none !important;
  color: var(--accent-green) !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  margin-bottom: 1.5rem !important;
  padding: 0 !important;
  display: block !important;
  transition: color 0.2s ease;
}

.mobile-back-btn:hover {
  color: var(--accent-light) !important;
}

/* Tablet: Show bottom nav, hide left sidebar */
@media (max-width: 1100px) {
  .nav-sidebar {
    display: none;
  }
  
  .mobile-bottom-nav {
    display: flex;
  }
  
  .-root {
    grid-template-columns: var(--list-w) 1fr;
  }
}

/* Mobile: Full width, single column */
@media (max-width: 768px) {
  body {
    height: 100svh;
  }

  pre.chord-line, pre.lyric-pre {
    font-size: 0.7rem;
  }
  
  .-root {
    grid-template-columns: 1fr;
    height: 100svh;
  }
  
  .center-panel {
    border-right: none;
    display: flex;
  }
  
  .detail-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 70px;
    z-index: 150;
    /* Explicit height so Firefox computes the scrollable area correctly */
    height: calc(100svh - 70px);
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    /* Block children from stretching the panel beyond its bounds */
    flex-direction: column;
  }

  .detail-panel.show {
    display: block;
  }

  /* Remove flex:1 from lyrics-wrap on mobile — it fights the scroll container */
  .lyrics-wrap {
    flex: none;
    padding-bottom: 3rem;
  }
  
  .center-panel.hide {
    display: none;
  }
  
  .mobile-bottom-nav {
    display: flex;
  }
  
  /* Adjust spacing for bottom nav */
  .center-panel {
    margin-bottom: 0;
    padding-bottom: 0;
  }
  
  .song-list {
    margin-bottom: 0;
  }
  
  /* Make scroll to top button mobile-friendly */
  .scroll-top {
    bottom: 90px;
    right: 12px;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  
  .top-bar {
    padding: var(--sp-3) var(--sp-2);
  }
  
  .mobile-nav-btn span {
    font-size: 10px;
  }
  
  .song-item {
    padding: var(--sp-3);
  }
}
/* ══════════════════════════════════════════════════════════
   ARTIST AVATAR IN SONG LIST
══════════════════════════════════════════════════════════ */
.sb-left {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
}

.sb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-mid);
  display: block;
}

.sb-artist-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1px;
}

.sb-artist {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ══════════════════════════════════════════════════════════
   FAVORITES EMPTY STATE
══════════════════════════════════════════════════════════ */
.fav-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 3rem 1.5rem;
}
.fav-empty-icon {
  font-size: 2.5rem;
  color: var(--accent-orange);
  opacity: 0.45;
  line-height: 1;
}
.fav-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dim);
}
.fav-empty-sub {
  font-size: 0.8rem;
  color: var(--text-faint);
  text-align: center;
  max-width: 17rem;
  line-height: 1.55;
}