/* iLmava — dark "listening room" theme.
   Signature motif: a 3-bar equalizer, used as the logo mark and as the
   "now playing" indicator anywhere a track is active. */

:root {
  --bg: #0c0c10;
  --bg-elevated: #15151b;
  --panel: #1a1a22;
  --card: #1e1e27;
  --card-hover: #262631;
  --line: #2a2a34;
  --text: #f3f1ea;
  --text-dim: #9c9aa8;
  --text-faint: #6b6a76;
  --accent: #e8b34c;
  --accent-ink: #1a1408;
  --accent2: #6f6ff0;
  --danger: #e35b5b;
  --radius: 10px;
  --sidebar-w: 244px;
  --player-h: 88px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
h1, h2, h3, .brand-word { font-family: 'Space Grotesk', 'Inter', sans-serif; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* Equalizer mark */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq span { width: 3px; background: var(--accent); border-radius: 1px; animation: eqbar 900ms ease-in-out infinite; }
.eq span:nth-child(1) { height: 40%; animation-delay: -0.6s; }
.eq span:nth-child(2) { height: 100%; animation-delay: -0.2s; }
.eq span:nth-child(3) { height: 65%; animation-delay: -0.9s; }
@keyframes eqbar { 0%,100% { height: 20%; } 50% { height: 100%; } }
.eq.paused span { animation-play-state: paused; height: 30% !important; }

/* ---------- App shell ---------- */
.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr var(--player-h);
  grid-template-areas: "sidebar main" "player player";
}

/* Sidebar */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-elevated);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 18px 12px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; }
.brand .eq { height: 18px; }
.brand-word { font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.brand-sub { font-size: 10.5px; color: var(--text-faint); margin-top: -2px; letter-spacing: .04em; text-transform: uppercase; }

.nav-group { margin-bottom: 18px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); padding: 0 10px 8px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px;
  border-radius: 8px; color: var(--text-dim); font-size: 14px; font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-link i { width: 18px; text-align: center; font-size: 15px; }
.nav-link:hover { background: var(--card); color: var(--text); }
.nav-link.active { background: var(--card); color: var(--accent); }

.chan-list { flex: 1; overflow-y: auto; }
.chan-list-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 8px; font-size: 13px; color: var(--text-dim);
}
.chan-list-item:hover { background: var(--card); color: var(--text); }
.chan-list-item.active { color: var(--accent); background: var(--card); }
.chan-dot {
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}

/* Deterministic channel color palettes */
.pal-1 { background: linear-gradient(135deg,#e8b34c,#c07a1f); }
.pal-2 { background: linear-gradient(135deg,#6f6ff0,#3d3d9e); }
.pal-3 { background: linear-gradient(135deg,#4fb3a9,#1f6e66); }
.pal-4 { background: linear-gradient(135deg,#e07b7b,#a13d3d); }
.pal-5 { background: linear-gradient(135deg,#c78be0,#7a3d99); }
.pal-6 { background: linear-gradient(135deg,#7bc4e0,#3d7fa1); }

/* Main column */
.main-col { grid-area: main; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); flex-shrink: 0; display: flex; align-items: center; gap: 14px;
  padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(12,12,16,.85);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5;
}
.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 18px; padding: 6px; }
.searchbox {
  flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 9px 16px;
}
.searchbox input {
  flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-size: 13.5px;
}
.searchbox i { color: var(--text-faint); font-size: 13px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  background: none; border: none; color: var(--text-dim); font-size: 15px; width: 36px; height: 36px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--card); color: var(--text); }
.icon-btn.on { color: var(--accent); }

.content { flex: 1; overflow-y: auto; padding: 26px 30px 50px; }
.content-inner { max-width: 1180px; margin: 0 auto; }

/* Shelves / sections */
.section { margin-bottom: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { font-size: 19px; margin: 0; font-weight: 700; }
.section-head .see-all { font-size: 12.5px; color: var(--accent); font-weight: 600; }
.shelf { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 6px; scroll-behavior: smooth; }
.shelf::-webkit-scrollbar { height: 8px; }
.shelf::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* Track cards (grid/shelf items) */
.track-card { width: 160px; flex-shrink: 0; cursor: pointer; }
.tc-art-wrap { position: relative; width: 160px; height: 160px; border-radius: var(--radius); overflow: hidden; background: var(--card); }
.tc-art { width: 100%; height: 100%; object-fit: cover; }
.tc-play {
  position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); border: none; display: flex; align-items: center; justify-content: center;
  font-size: 14px; opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s;
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
}
.track-card:hover .tc-play { opacity: 1; transform: translateY(0); }
.tc-title { margin-top: 9px; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-artist { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-card.playing .tc-title { color: var(--accent); }

/* Category chips */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chip {
  flex-shrink: 0; padding: 8px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--text-dim); white-space: nowrap; transition: background .12s, color .12s;
}
.chip:hover, .chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Channel grid */
.chan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 16px; }
.chan-card { display: block; }
.chan-art {
  width: 100%; aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 700; color: #fff; box-shadow: 0 10px 24px rgba(0,0,0,.35);
}
.chan-name { margin-top: 10px; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan-count { font-size: 11.5px; color: var(--text-faint); }

/* Track list rows (Search / Artist / Category / Liked) */
.list-head {
  display: flex; align-items: center; gap: 14px; padding: 0 10px 10px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line); font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em;
}
.track-list { display: flex; flex-direction: column; }
.track-item {
  display: flex; align-items: center; gap: 14px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  transition: background .1s;
}
.track-item:hover { background: var(--card); }
.track-item.playing { background: var(--card); }
.track-item.playing .ti-title { color: var(--accent); }
.ti-num { width: 26px; flex-shrink: 0; position: relative; text-align: center; }
.ti-index { color: var(--text-faint); font-size: 13px; }
.ti-play { display: none; background: none; border: none; color: var(--text); font-size: 13px; width: 100%; }
.ti-playing { display: none; align-items: flex-end; gap: 2px; height: 13px; justify-content: center; }
.ti-playing span { width: 2.5px; background: var(--accent); border-radius: 1px; animation: eqbar 900ms ease-in-out infinite; }
.ti-playing span:nth-child(1) { animation-delay: -0.6s; }
.ti-playing span:nth-child(2) { animation-delay: -0.2s; }
.ti-playing span:nth-child(3) { animation-delay: -0.9s; }
.track-item:hover .ti-index { display: none; }
.track-item:hover .ti-play { display: block; }
.track-item.playing .ti-index, .track-item.playing .ti-play { display: none; }
.track-item.playing .ti-playing { display: flex; }
.ti-art { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--card); }
.ti-meta { flex: 1; min-width: 0; }
.ti-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ti-artist { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ti-chan { color: var(--text-faint); }
.ti-plays { width: 90px; flex-shrink: 0; font-size: 12px; color: var(--text-faint); text-align: right; }
.ti-plays i { margin-right: 4px; }
.ti-dur { width: 48px; flex-shrink: 0; font-size: 12.5px; color: var(--text-dim); text-align: right; font-variant-numeric: tabular-nums; }
.ti-like { flex-shrink: 0; background: none; border: none; color: var(--text-faint); font-size: 14px; width: 30px; }
.ti-like:hover, .ti-like.liked { color: var(--danger); }
.ti-like.liked i { font-weight: 900; }

@media (max-width: 700px) {
  .ti-plays { display: none; }
}

/* Page headers (Artist / Category / Search) */
.page-header { display: flex; align-items: flex-end; gap: 22px; margin-bottom: 26px; flex-wrap: wrap; }
.page-header .hero-art {
  width: 168px; height: 168px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 16px 40px rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; font-size: 56px; font-weight: 700; color: #fff;
}
.page-header .eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: 6px; }
.page-header h1 { font-size: 32px; margin: 0 0 8px; }
.page-header .meta { color: var(--text-dim); font-size: 13px; }
.page-actions { display: flex; gap: 10px; margin: 18px 0 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 24px; font-weight: 700;
  font-size: 13.5px; border: none;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--card); }

/* Track detail page */
.track-hero { display: flex; gap: 26px; align-items: flex-end; margin-bottom: 24px; flex-wrap: wrap; }
.track-hero img { width: 168px; height: 168px; border-radius: var(--radius); object-fit: cover; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.track-desc { white-space: pre-line; color: var(--text-dim); font-size: 13.5px; line-height: 1.7; max-width: 700px; margin: 6px 0 24px; }

/* Empty / error states */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.empty-state i { font-size: 40px; margin-bottom: 14px; opacity: .5; display: block; }

/* ---------- Player bar ---------- */
.player-bar {
  grid-area: player; background: var(--bg-elevated); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr minmax(0,720px) 1fr; align-items: center; padding: 0 18px; gap: 14px;
}
.player-now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-art { width: 54px; height: 54px; border-radius: 6px; object-fit: cover; background: var(--card); flex-shrink: 0; }
.player-meta { min-width: 0; }
.player-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-like { background: none; border: none; color: var(--text-faint); font-size: 15px; flex-shrink: 0; }
.player-like.liked { color: var(--danger); }

.player-center { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.transport { display: flex; align-items: center; gap: 18px; }
.transport button { background: none; border: none; color: var(--text-dim); font-size: 16px; }
.transport button:hover { color: var(--text); }
.transport .tp-play {
  width: 34px; height: 34px; border-radius: 50%; background: var(--text); color: var(--bg);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.transport .tp-play:hover { transform: scale(1.05); }
.transport .on { color: var(--accent); }
.seek-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.seek-time { font-size: 11px; color: var(--text-faint); width: 38px; font-variant-numeric: tabular-nums; }
.seek-time.dur { text-align: left; }
.seek-time.cur { text-align: right; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: var(--line); flex: 1; outline: none; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
  opacity: 0; transition: opacity .1s;
}
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:active::-webkit-slider-thumb { opacity: 1; }
#seek { background: linear-gradient(to right, var(--accent) 0%, var(--accent) 0%, var(--line) 0%); }

.player-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.vol-row { display: flex; align-items: center; gap: 6px; width: 110px; }
.vol-row input { width: 90px; }
.queue-toggle.on { color: var(--accent); }

/* Mobile compact player + expanded now-playing sheet */
.now-playing-sheet {
  position: fixed; inset: 0; background: var(--bg); z-index: 50; display: flex; flex-direction: column;
  padding: 18px 22px 26px; transform: translateY(100%); transition: transform .28s ease; overflow-y: auto;
}
.now-playing-sheet.open { transform: translateY(0); }
.nps-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.nps-top button { background: none; border: none; color: var(--text); font-size: 20px; }
.nps-art { width: 100%; max-width: 320px; aspect-ratio: 1; margin: 0 auto 30px; border-radius: 14px; object-fit: cover; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.nps-title { font-size: 21px; font-weight: 700; text-align: center; }
.nps-artist { font-size: 14px; color: var(--text-dim); text-align: center; margin-top: 4px; margin-bottom: 24px; }
.nps-transport { display: flex; align-items: center; justify-content: center; gap: 30px; margin: 20px 0; }
.nps-transport button { background: none; border: none; color: var(--text); font-size: 22px; }
.nps-transport .tp-play { width: 62px; height: 62px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.nps-queue-label { margin: 30px 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }

/* Queue side panel (desktop) */
.queue-panel {
  position: fixed; right: 0; top: 0; bottom: var(--player-h); width: 340px; background: var(--bg-elevated);
  border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .22s ease; z-index: 20;
  display: flex; flex-direction: column; padding: 18px;
}
.queue-panel.open { transform: translateX(0); }
.queue-panel h3 { margin: 0 0 12px; font-size: 15px; }
.queue-panel .track-list { overflow-y: auto; flex: 1; }

/* Responsive */
@media (max-width: 980px) {
  :root { --sidebar-w: 220px; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; grid-template-areas: "main" "player"; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 244px; z-index: 40;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.5);
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: flex; }
  .topbar { padding: 0 14px; }
  .content { padding: 18px 14px 90px; }
  .player-bar { grid-template-columns: 1fr auto; padding: 0 10px; }
  .player-center { display: none; }
  .player-right .vol-row, .player-right .queue-toggle { display: none; }
  .player-right { gap: 4px; }
  .track-card { width: 132px; }
  .tc-art-wrap { width: 132px; height: 132px; }
  .queue-panel { width: 100%; }
  .page-header .hero-art { width: 120px; height: 120px; font-size: 40px; }
  .page-header h1 { font-size: 24px; }
}

.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35;
}
.sidebar-backdrop.show { display: block; }

.player-bar.mobile-compact { cursor: pointer; }
