/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #0d0f0c;
}

/* ─── Design Tokens ─────────────────────────────────────────────── */
:root {
  --font: 'Inter', 'Segoe UI', sans-serif;

  /* Background layers */
  --bg-base:       #0d0f0c;
  --bg-elevated:   #161a14;
  --bg-hover:      #1e231c;
  --bg-active:     #252b22;
  --bg-card:       rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);

  /* Borders */
  --border:        rgba(255,255,255,0.07);
  --border-hover:  rgba(255,255,255,0.14);

  /* Text */
  --text-primary:   #f2f5f0;
  --text-secondary: rgba(242,245,240,0.55);
  --text-dim:       rgba(242,245,240,0.3);

  /* Accent — electric chartreuse: unexpected for a dark theme, very "neuro" */
  --accent:        #b3ff5c;
  --accent-dim:    rgba(179,255,92,0.18);
  --accent-glow:   rgba(179,255,92,0.35);

  /* Player */
  --player-h: 88px;
  --sidebar-w: 240px;

  /* Animations */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* ─── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  grid-area: sidebar;
  background: rgba(0,0,0,0.35);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s var(--ease-out), opacity 0.3s ease;
}

.sidebar.collapsed {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

.sidebar-header {
  padding: 20px 16px 12px;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0d0f0c;
  flex-shrink: 0;
}

.logo-icon svg { width: 18px; height: 18px; }

.logo-text {
  font-family: var(--font);
  font-weight: 800;
  font-size: 15px;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

/* Nav */
.sidebar-nav {
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.nav-item {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

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

/* Sidebar sections */
.sidebar-section {
  padding: 16px 8px 8px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-section::-webkit-scrollbar { width: 4px; }
.sidebar-section::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-label {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 8px 8px;
  padding: 0;
}

/* Artist filter chips */
.artist-filters {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-chip {
  all: unset;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 7px 10px;
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-chip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* Playlist list */
.playlist-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.playlist-item {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.playlist-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.playlist-item.active {
  color: var(--text-primary);
}

.playlist-icon {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.playlist-icon svg { width: 14px; height: 14px; }

.playlist-icon--new {
  border: 1.5px dashed var(--border-hover);
  background: transparent;
}

.playlist-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Main ──────────────────────────────────────────────────────── */
.main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ─── Top bar ───────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(13,15,12,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.topbar-left { display: flex; gap: 4px; }
.topbar-right { display: flex; gap: 4px; margin-left: auto; }

.topbar-search {
  flex: 1;
  max-width: 380px;
  margin: 0 auto;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 7px 14px;
  transition: border-color 0.2s, background 0.2s;
}

.search-box:focus-within {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.search-box svg {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.search-box input {
  all: unset;
  flex: 1;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
  width: 100%;
}

.search-box input::placeholder { color: var(--text-dim); }

.search-clear {
  all: unset;
  cursor: pointer;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  transition: color 0.15s;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.search-clear.visible {
  opacity: 1;
  pointer-events: auto;
}

.search-clear svg { width: 14px; height: 14px; }
.search-clear:hover { color: var(--text-primary); }

/* ─── Icon buttons ──────────────────────────────────────────────── */
.icon-btn {
  all: unset;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color 0.15s, background 0.15s, transform 0.15s var(--ease-spring);
}

.icon-btn svg { width: 18px; height: 18px; }

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  transform: scale(1.08);
}

.icon-btn:active { transform: scale(0.92); }

/* ─── Content area ──────────────────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  padding-bottom: 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── Hero ──────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 56px 32px 40px;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 20px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 100% at 60% 0%, rgba(179,255,92,0.12) 0%, transparent 70%),
              linear-gradient(180deg, rgba(179,255,92,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
}

.hero-title {
  font-family: var(--font);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin: 6px 0 4px;
  line-height: 1.05;
}

.hero-sub {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.hero-text { position: relative; z-index: 1; }

.hero-actions {
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.btn-play-all, .btn-shuffle-all {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 24px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
}

.btn-play-all {
  background: var(--accent);
  color: #0d0f0c;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-play-all svg { width: 14px; height: 14px; }

.btn-play-all:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 28px var(--accent-glow);
}

.btn-play-all:active { transform: scale(0.96); }

.btn-shuffle-all {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
}

.btn-shuffle-all svg { width: 16px; height: 16px; }

.btn-shuffle-all:hover {
  background: var(--bg-card-hover);
  transform: scale(1.04);
}

.btn-shuffle-all:active { transform: scale(0.96); }

/* ─── Section titles ────────────────────────────────────────────── */
.section-title {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

/* ─── Artist sections ───────────────────────────────────────────── */
.artist-section {
  padding: 28px 0 8px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.4s var(--ease-out) forwards;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.artist-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px 16px;
  gap: 12px;
}

.artist-section-header .section-title {
  font-size: 18px;
}

.artist-count {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-card);
  padding: 3px 8px;
  border-radius: 20px;
}

/* ─── Song list (table-style) ───────────────────────────────────── */
.song-list {
  width: 100%;
}

.song-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 6px 32px;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
  user-select: none;
}

.song-row:hover { background: var(--bg-hover); }
.song-row.active { background: var(--bg-active); }

.song-row.placeholder {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.song-row:hover .song-num { opacity: 0; }
.song-row:hover .song-row-play { opacity: 1; }
.song-row.active .song-num { opacity: 0; }
.song-row.active .song-row-play { opacity: 1; }
.song-row.active .song-row-play .mini-play { display: none; }
.song-row.active .song-row-play .mini-pause { display: block; }

.song-num-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.song-num {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-dim);
  transition: opacity 0.15s;
  line-height: 1;
}

.song-row-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  color: var(--text-primary);
}

.song-row-play svg { width: 14px; height: 14px; }
.song-row-play .mini-pause { display: none; }

.song-row-art {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: var(--bg-hover);
  overflow: hidden;
  flex-shrink: 0;
}

.song-row-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.song-row-placeholder-art {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

.song-row-placeholder-art svg { width: 16px; height: 16px; }

.song-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.song-text {
  min-width: 0;
}

.song-name {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-artist {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.song-row.active .song-name { color: var(--accent); }

.song-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.song-row:hover .song-row-actions { opacity: 1; }

.song-row-actions .icon-btn {
  width: 28px;
  height: 28px;
}

.song-row-actions .icon-btn svg { width: 15px; height: 15px; }

.song-liked .heart-icon path { fill: var(--accent); stroke: var(--accent); }

.song-duration {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

/* ─── Search results ────────────────────────────────────────────── */
.search-results {
  padding: 28px 32px;
}

.search-results .section-title { margin-bottom: 16px; }

.search-results .song-list .song-row {
  padding: 6px 0;
}

.hidden { display: none !important; }

/* ─── Player bar ────────────────────────────────────────────────── */
.player {
  grid-area: player;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  height: var(--player-h);
  position: relative;
  z-index: 20;
}

/* Player track info */
.player-track {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-art {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-hover);
  position: relative;
}

.player-art-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

.player-art-placeholder svg { width: 20px; height: 20px; }

#playerArtImg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s;
}

#playerArtImg.loaded { opacity: 1; }

.player-track-info { min-width: 0; }

.player-track-name {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.player-track-artist {
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0 0;
}

.heart-btn.liked svg path {
  fill: var(--accent);
  stroke: var(--accent);
}

/* Player center */
.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  color: var(--text-secondary) !important;
}

.ctrl-btn.active {
  color: var(--accent) !important;
  position: relative;
}

.ctrl-btn.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.play-btn {
  all: unset;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-base);
  transition: transform 0.2s var(--ease-spring), background 0.15s;
  flex-shrink: 0;
}

.play-btn:hover {
  transform: scale(1.08);
  background: #fff;
}

.play-btn:active { transform: scale(0.92); }
.play-btn svg { width: 14px; height: 14px; }

.play-btn .icon-play  { display: block; }
.play-btn .icon-pause { display: none; }
.play-btn.playing .icon-play  { display: none; }
.play-btn.playing .icon-pause { display: block; }

/* Seek bar */
.player-seek {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 480px;
}

.time-label {
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
}

#timeDuration { text-align: right; }

.seek-wrap {
  position: relative;
  flex: 1;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.seek-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-hover);
  overflow: visible;
  pointer-events: none;
}

.seek-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--text-secondary);
  border-radius: 2px;
  width: 0%;
  transition: background 0.2s;
  pointer-events: none;
}

.seek-thumb {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-primary);
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  transition: transform 0.15s var(--ease-spring);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.seek-wrap:hover .seek-thumb { transform: translate(-50%, -50%) scale(1); }
.seek-wrap:hover .seek-fill { background: var(--accent); }
.seek-wrap:hover .seek-track { background: var(--bg-active); }

.seek-slider {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  outline: none;
  cursor: pointer;
  margin: 0; padding: 0;
  z-index: 2;
}

.seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0;
  height: 0;
}

.seek-slider::-moz-range-thumb {
  width: 0; height: 0;
  background: transparent;
  border: none;
}

/* Player right */
.player-right {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

/* Volume icons */
.vol-slider-wrap {
  position: relative;
  width: 90px;
  height: 16px;
  display: flex;
  align-items: center;
}

.vol-track {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-hover);
  overflow: hidden;
  pointer-events: none;
}

.vol-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--text-secondary);
  border-radius: 2px;
  width: 100%;
  pointer-events: none;
  transition: width 0.04s linear;
}

.vol-slider-wrap:hover .vol-fill { background: var(--accent); }

.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 16px;
  background: transparent;
  outline: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
  margin: 0; padding: 0;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transition: transform 0.15s var(--ease-spring);
}

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

.vol-slider::-moz-range-thumb {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Volume icon switching */
#volMuteBtn .icon-vol-high  { display: block; }
#volMuteBtn .icon-vol-low   { display: none; }
#volMuteBtn .icon-vol-muted { display: none; }
#volMuteBtn.low .icon-vol-high  { display: none; }
#volMuteBtn.low .icon-vol-low   { display: block; }
#volMuteBtn.muted .icon-vol-high  { display: none; }
#volMuteBtn.muted .icon-vol-muted { display: block; }

/* ─── Queue panel ───────────────────────────────────────────────── */
.queue-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: var(--player-h);
  width: 300px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease-out);
}

.queue-panel.open {
  transform: translateX(0);
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.queue-header h3 {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.queue-section-label {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 16px 20px 8px;
  padding: 0;
}

.queue-now, .queue-next { overflow-y: auto; }
.queue-next { flex: 1; }

.queue-song {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px;
  cursor: pointer;
  transition: background 0.12s;
  border-radius: 0;
}

.queue-song:hover { background: var(--bg-hover); }
.queue-song.current { background: var(--bg-active); }

.queue-song-art {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: var(--bg-hover);
  flex-shrink: 0;
  overflow: hidden;
}

.queue-song-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue-song-text { min-width: 0; }

.queue-song-name {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-song-artist {
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-song.current .queue-song-name { color: var(--accent); }

/* ─── Modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

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

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s var(--ease-spring);
}

.modal--small { width: 340px; }

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h3 {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.modal-body input[type="text"] {
  all: unset;
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.modal-body input[type="text"]:focus {
  border-color: var(--border-hover);
}

.modal-body input[type="text"]::placeholder { color: var(--text-dim); }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-primary, .btn-secondary {
  all: unset;
  cursor: pointer;
  padding: 9px 20px;
  border-radius: 20px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.15s var(--ease-spring), opacity 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #0d0f0c;
}

.btn-primary:hover { opacity: 0.9; transform: scale(1.03); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--bg-hover); transform: scale(1.03); }

/* Modal song list (checkboxes) */
.modal-song-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  cursor: pointer;
  border-radius: 8px;
}

.modal-song-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.modal-song-check-art {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: var(--bg-hover);
  overflow: hidden;
  flex-shrink: 0;
}

.modal-song-check-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-song-check-name {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
}

.modal-song-check-artist {
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-secondary);
}

/* Playlist in modal */
.modal-playlist-item {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  width: 100%;
  border-radius: 8px;
  transition: background 0.12s;
  box-sizing: border-box;
}

.modal-playlist-item:hover { background: var(--bg-hover); }

.modal-playlist-item .playlist-icon { width: 36px; height: 36px; }
.modal-playlist-item span {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
}

/* ─── Context Menu ──────────────────────────────────────────────── */
.ctx-menu {
  position: fixed;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  padding: 6px;
  z-index: 200;
  min-width: 180px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  animation: ctxIn 0.15s var(--ease-spring);
}

@keyframes ctxIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.ctx-menu button {
  all: unset;
  cursor: pointer;
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
  transition: background 0.1s;
  box-sizing: border-box;
}

.ctx-menu button:hover { background: var(--bg-hover); }

.ctx-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ─── Toast ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--player-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: 24px;
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s var(--ease-spring);
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Accessibility ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
}

@media (max-width: 700px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "player";
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: var(--player-h);
    width: 260px;
    z-index: 40;
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.3s var(--ease-out), opacity 0.3s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    opacity: 1;
  }

  .sidebar-toggle { display: flex !important; }

  .player {
    grid-template-columns: 1fr auto;
  }

  .player-center { display: none; }
  .player-right { display: none; }

  .hero { padding: 32px 20px 24px; }
  .song-row { padding: 6px 20px; }
  .artist-section-header { padding: 0 20px 12px; }
}

@media (min-width: 701px) {
  .sidebar-toggle { display: none; }
}

/* ─── Playlist view section ─────────────────────────────────────── */
.playlist-view {
  padding-top: 0;
}

.playlist-hero {
  padding: 32px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  background: linear-gradient(180deg, rgba(179,255,92,0.08) 0%, transparent 100%);
  margin-bottom: 8px;
}

.playlist-hero-art {
  width: 140px;
  height: 140px;
  border-radius: 8px;
  background: var(--bg-hover);
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
}

.playlist-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-hero-info {}

.playlist-hero-type {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.playlist-hero-name {
  font-family: var(--font);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}

.playlist-hero-count {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-secondary);
}

.playlist-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
}

.playlist-delete-btn {
  all: unset;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.playlist-delete-btn:hover {
  color: #ff5c5c;
  border-color: #ff5c5c;
  background: rgba(255,92,92,0.08);
}

/* Song list header */
.song-list-header {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 12px;
  padding: 4px 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.song-list-header span {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Scrollbar for modal body */
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
