/* ============================================
   beatz — components
   ============================================ */

/* ---- Page headers ---- */
.page-title {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.page-subtitle {
  color: var(--grey);
  font-size: 14px;
  margin: 0 0 28px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 36px 0 16px;
}

.section-heading h2 {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 0;
}

.section-heading .see-all {
  font-size: 12px;
  font-weight: 700;
  color: var(--grey);
  background: none;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.section-heading .see-all:hover { color: var(--yellow); }

/* ---- Mood pills (Flow / Chill / Focus etc) ---- */
.mood-row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.mood-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: var(--text);
  flex-shrink: 0;
  width: 92px;
}

.mood-pill .mood-circle {
  width: 76px; height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.mood-pill .mood-circle svg { width: 28px; height: 28px; }

.mood-pill:hover .mood-circle {
  transform: translateY(-3px);
  border-color: var(--yellow);
}

.mood-pill.featured .mood-circle {
  background: linear-gradient(135deg, var(--yellow-pale), var(--yellow) 45%, var(--gold));
  border: none;
}
.mood-pill.featured .mood-circle svg { color: var(--bg); }

.mood-pill span.label { font-size: 12px; font-weight: 600; }

/* ---- Horizontal rail of cards ---- */
.rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.card {
  flex-shrink: 0;
  width: 168px;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card .art-wrap { position: relative; }

.card .play-overlay {
  position: absolute;
  bottom: 8px; right: 8px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  border: none;
}

.card:hover .play-overlay,
.card:focus-visible .play-overlay {
  opacity: 1;
  transform: translateY(0);
}

.card .play-overlay svg { width: 16px; height: 16px; margin-left: 2px; }

.card .card-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .card-sub {
  font-size: 12px;
  color: var(--grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* round variant for artist cards */
.card.artist .squircle-img { border-radius: 50%; }

/* ---- Grid (search results, full lists) ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 22px;
}

/* ---- Track list (album / playlist detail) ---- */
.tracklist { display: flex; flex-direction: column; }

.track-row {
  display: grid;
  grid-template-columns: 32px 48px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: none;
  color: var(--text);
  text-align: left;
  width: 100%;
  position: relative;
}

.track-row:hover { background: var(--surface); }

.track-row.playing { background: var(--surface-raised); }
.track-row.playing .track-title { color: var(--yellow); }

.track-row .index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--grey-dim);
  text-align: center;
}

.track-row.playing .index { color: var(--yellow); }

.track-row .track-art {
  width: 44px; height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-raised);
}

.track-row .track-meta { min-width: 0; }

.track-row .track-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-row .track-artist {
  font-size: 12px;
  color: var(--grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-row .track-duration {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--grey);
}

.track-row .track-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.track-row .track-like,
.track-row .track-add {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
  color: var(--grey-dim);
  flex-shrink: 0;
}
.track-row .track-like:hover { color: var(--orange); background: var(--surface-raised); }
.track-row .track-like.liked { color: var(--orange); }
.track-row .track-like svg { width: 16px; height: 16px; }

.track-row .track-add:hover { color: var(--yellow); background: var(--surface-raised); }
.track-row .track-add svg { width: 16px; height: 16px; }

/* ---- Add-to-playlist popover ---- */
.add-menu {
  position: fixed;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  min-width: 200px;
  box-shadow: var(--shadow-soft);
  z-index: 80;
}

.add-menu .add-menu-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-dim);
  padding: 6px 10px 8px;
}

.add-menu button.add-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}
.add-menu button.add-menu-item:hover { background: var(--surface); }
.add-menu button.add-menu-item img { width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0; }
.add-menu .add-menu-empty { padding: 10px; font-size: 12px; color: var(--grey); }

/* ---- Detail header (album/playlist/artist page) ---- */
.detail-header {
  display: flex;
  gap: 28px;
  align-items: flex-end;
  margin-bottom: 32px;
}

.detail-header .squircle-img { width: 200px; flex-shrink: 0; box-shadow: var(--shadow-soft); }

.detail-header .kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey);
  margin-bottom: 8px;
}

.detail-header h1 {
  font-family: var(--font-display);
  font-size: 44px;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  line-height: 1.02;
}

.detail-header .meta {
  font-size: 13px;
  color: var(--grey);
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.btn-play-all {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--bg);
  border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-yellow);
  transition: transform 0.12s ease;
}
.btn-play-all:hover { transform: scale(1.05); }
.btn-play-all svg { width: 22px; height: 22px; margin-left: 2px; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--line);
  color: var(--grey);
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--text); border-color: var(--grey); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---- Now playing controls ---- */
.np-track {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.np-track .squircle-img { width: 52px; flex-shrink: 0; }

.np-track .meta { min-width: 0; }

.np-track .title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-track .artist {
  font-size: 12px;
  color: var(--grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-track .like-btn {
  background: none; border: none; color: var(--grey-dim);
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.np-track .like-btn.liked { color: var(--orange); }
.np-track .like-btn svg { width: 16px; height: 16px; }

.np-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.np-controls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.np-controls button {
  background: none; border: none; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}

.np-controls .skip-btn { color: var(--grey); width: 18px; height: 18px; }
.np-controls .skip-btn:hover { color: var(--text); }
.np-controls .skip-btn svg { width: 100%; height: 100%; }

.np-controls .play-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--bg);
}
.np-controls .play-btn svg { width: 16px; height: 16px; }
.np-controls .play-btn.paused svg { margin-left: 2px; }

.np-controls .toggle-btn { color: var(--grey-dim); width: 16px; height: 16px; }
.np-controls .toggle-btn.on { color: var(--yellow); }
.np-controls .toggle-btn svg { width: 100%; height: 100%; }

.np-scrub {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 460px;
}

.np-scrub time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--grey-dim);
  width: 36px;
  flex-shrink: 0;
}
.np-scrub time:last-child { text-align: left; }

.np-scrub input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--line);
  cursor: pointer;
}

.np-scrub input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--yellow);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.np-scrub:hover input[type="range"]::-webkit-slider-thumb,
.np-scrub input[type="range"]:focus-visible::-webkit-slider-thumb {
  opacity: 1;
}

.np-extra {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.np-extra button {
  background: none; border: none; color: var(--grey);
  width: 18px; height: 18px;
}
.np-extra button:hover { color: var(--text); }
.np-extra button svg { width: 100%; height: 100%; }

.np-extra .volume-row {
  display: flex; align-items: center; gap: 8px;
  width: 110px;
}

.np-extra .volume-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--line);
  cursor: pointer;
}
.np-extra .volume-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--text);
}

/* ---- Empty states ---- */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--grey);
}
.empty-state h3 {
  font-family: var(--font-display);
  color: var(--text);
  font-size: 20px;
  margin: 0 0 8px;
}
.empty-state p { font-size: 13px; margin: 0; }

/* ---- Search input results sections ---- */
.search-results-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-dim);
  margin: 28px 0 14px;
}
.search-results-header:first-child { margin-top: 0; }

/* ---- Toast (new playlist confirmation etc) ---- */
.toast {
  position: fixed;
  bottom: calc(var(--nowplaying-h) + 24px);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--yellow);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- New playlist modal ---- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.modal-backdrop.show { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  width: 360px;
  max-width: 90vw;
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 18px;
}

.modal input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 18px;
  outline: none;
}
.modal input[type="text"]:focus { border-color: var(--yellow); }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.btn {
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  border: none;
}
.btn-primary { background: var(--yellow); color: var(--bg); }
.btn-primary:hover { background: var(--yellow-pale); }
.btn-secondary { background: none; color: var(--grey); border: 1px solid var(--line); }
.btn-secondary:hover { color: var(--text); border-color: var(--grey); }

@media (max-width: 860px) {
  .detail-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .detail-header .squircle-img { width: 140px; }
  .detail-header h1 { font-size: 30px; }
  .np-extra .volume-row { display: none; }
  .np-track .meta .artist { display: none; }
  .track-row { grid-template-columns: 24px 40px 1fr auto; }
  .track-row .track-duration { display: none; }
  .track-row .track-add { display: none; }
  .toast { bottom: calc(var(--nowplaying-h) + 64px + 16px); }
}
