/* ═══════════════════════════════════════════════════════════
   CAMAC Radio — Player Theme
   Extends CAMAC Design System for audio playback UI
   ═══════════════════════════════════════════════════════════ */

@import url("/static/camac-theme.css");

/* ── Overrides ── */
:root {
  --np-h: 64px;           /* now-playing bar height */
  --btn-size: 40px;       /* play/pause button */
}

/* ── Body layout ── */
html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

body > .topbar { flex-shrink: 0; }
body > .tab-bar { flex-shrink: 0; }

/* ── Station list ── */
.content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--np-h) + 20px);
}

.station-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 600px) {
  .station-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 860px) {
  .station-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Station card ── */
.station-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  border-left: 3px solid var(--tm);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: box-shadow .15s, border-left-color .15s;
}

.station-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

.station-card.playing {
  border-left-color: var(--td);
  background: var(--tl);
}

.station-card .play-indicator {
  width: var(--btn-size);
  height: var(--btn-size);
  border-radius: 50%;
  background: var(--td);
  color: #fff;
  border: none;
  font-size: 16px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .1s;
}

.station-card .play-indicator:hover {
  transform: scale(1.08);
}
.station-card .play-indicator:active {
  transform: scale(.95);
}

.station-card .play-indicator.playing {
  background: var(--warn);
}

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

.station-info .name {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-info .meta {
  font-size: 12px;
  color: var(--grey);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.station-info .meta .freq {
  font-weight: 600;
  color: var(--td);
}

.station-info .meta .genre {
  font-size: 11px;
  color: var(--grey);
}

.station-info .meta .badge-band {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  background: var(--td);
  color: #fff;
  padding: 1px 7px;
  border-radius: 8px;
  letter-spacing: .3px;
}

.station-info .meta .badge-band.am {
  background: var(--warn);
}

/* ── Favourites star ── */
.fav-star {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px;
  color: var(--grey);
  transition: transform .12s, color .12s;
  line-height: 1;
}

.fav-star:hover {
  transform: scale(1.2);
}

.fav-star.on {
  color: var(--warn);
}

/* ── Now-playing metadata with song info ── */
.np-meta.song {
  color: var(--td);
  font-weight: 600;
}

.np-meta.programme {
  color: var(--warn);
  font-weight: 500;
}

/* ── No results ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--grey);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── Now Playing bar ── */
.now-playing {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--np-h);
  background: #fff;
  border-top: 3px solid var(--td);
  box-shadow: 0 -4px 20px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
  z-index: 100;
  transition: transform .2s;
}

.now-playing.hidden {
  transform: translateY(100%);
}

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

.np-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-meta {
  font-size: 11px;
  color: var(--grey);
}

.np-controls {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.np-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--td);
  background: #fff;
  color: var(--td);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
}

.np-btn:hover {
  background: var(--td);
  color: #fff;
}

.np-btn-mute { border-color: var(--grey); color: var(--grey); }
.np-btn-mute:hover { background: var(--grey); color: #fff; }

.np-btn-mute.muted { border-color: var(--warn); color: var(--warn); }
.np-btn-mute.muted:hover { background: var(--warn); color: #fff; }

.np-volume-wrap {
  flex-shrink: 0;
  width: 100px;
}

@media (max-width: 480px) {
  .np-volume-wrap { display: none; }
}

.np-volume-wrap input[type="range"] {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--rule);
  border-radius: 2px;
  outline: none;
}

.np-volume-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--td);
  cursor: pointer;
}

.np-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--grey);
  flex-shrink: 0;
  white-space: nowrap;
}

.np-status.live { color: var(--success); }
.np-status.buffering { color: var(--warn); }
.np-status.error { color: var(--danger); }

/* ── Tab load spinner ── */
.tab-loading {
  text-align: center;
  padding: 40px;
  color: var(--grey);
  font-size: 14px;
}

/* ── Tooltip helper ── */
[title] { position: relative; }
