/* ============================================================
   dringl radio — website styles
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: linear-gradient(150deg, rgba(46, 106, 178, 1) 0%, rgba(134, 95, 162, 1) 100%);
  --surface: #141414;
  --surface-hover: #1e1e1e;
  --border: rgba(255,255,255,0.07);
  --text: #f2f2f2;
  --text-muted: rgba(242,242,242,0.5);
  --accent: #f2f2f2;
  --player-h: 80px;
  --header-h: 64px;
  --radius-card: 16px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ───────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-svg {
  height: 28px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.station-count {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── Main content ─────────────────────────────────────────── */

.main-content {
  padding: 32px 40px;
  padding-bottom: calc(var(--player-h) + 32px);
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Filters ──────────────────────────────────────────────── */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.filter-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: rgba(255,255,255,0.15);
}

.filter-btn.active {
  background: var(--text);
  color: var(--surface);
  border-color: none;
}

/* ── Station grid ─────────────────────────────────────────── */

.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ── Station card ─────────────────────────────────────────── */

.station-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1),
              border-color 0.18s,
              box-shadow 0.18s;
  position: relative;
  outline: none;
}

.station-card:hover,
.station-card:focus-visible {
  transform: scale(1.03);
  border-color: rgba(255,255,255,0.2);
}

.station-card.playing {
  border-color: rgba(255,255,255,0.45);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15),
              0 8px 32px rgba(0,0,0,0.6);
}

/* accent glow driven by --station-color */
.station-card.playing {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2),
              0 0 40px color-mix(in srgb, var(--station-color) 35%, transparent),
              0 8px 32px rgba(0,0,0,0.5);
}

.card-art-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: color-mix(in srgb, var(--station-color, #222) 30%, #111);
}

.card-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s;
}

.card-art.loading {
  opacity: 0;
}

.card-art-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  opacity: 0.6;
}

/* play overlay on hover */
.card-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 0.18s;
}

.station-card:hover .card-play-overlay,
.station-card:focus-visible .card-play-overlay {
  opacity: 1;
}

.station-card.playing .card-play-overlay {
  opacity: 1;
  background: rgba(0,0,0,0.3);
}

.card-play-overlay svg {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.8));
}

/* playing equalizer animation in overlay */
.card-eq {
  display: none;
  gap: 3px;
  align-items: flex-end;
  height: 28px;
}

.station-card.playing .card-eq {
  display: flex;
}

.station-card.playing .card-play-icon {
  display: none;
}

.card-eq span {
  display: block;
  width: 4px;
  border-radius: 2px;
  background: #fff;
  animation: eq-bounce 0.8s ease-in-out infinite alternate;
}

.card-eq span:nth-child(1) { height: 60%; animation-delay: 0s;    animation-duration: 0.7s; }
.card-eq span:nth-child(2) { height: 100%; animation-delay: 0.1s; animation-duration: 0.9s; }
.card-eq span:nth-child(3) { height: 40%; animation-delay: 0.2s;  animation-duration: 0.6s; }
.card-eq span:nth-child(4) { height: 80%; animation-delay: 0.05s; animation-duration: 1.0s; }

@keyframes eq-bounce {
  from { transform: scaleY(0.4); }
  to   { transform: scaleY(1); }
}

.card-body {
  padding: 14px 14px 16px;
}

.card-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-genre {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-tagline {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Player bar ───────────────────────────────────────────── */

.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--player-h);
  background: rgba(18,18,18,0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), opacity 0.3s;
}

.player-bar.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.player-art-wrap {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-hover);
}

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

.player-eq {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(0,0,0,0.45);
  padding: 14px 12px;
}

.player-eq.paused { opacity: 0; }

.player-eq span {
  display: block;
  width: 4px;
  border-radius: 2px;
  background: #fff;
  animation: eq-bounce 0.8s ease-in-out infinite alternate;
}

.player-eq span:nth-child(1) { height: 60%; animation-delay: 0s;    animation-duration: 0.7s; }
.player-eq span:nth-child(2) { height: 100%; animation-delay: 0.1s; animation-duration: 0.9s; }
.player-eq span:nth-child(3) { height: 40%; animation-delay: 0.2s;  animation-duration: 0.6s; }
.player-eq span:nth-child(4) { height: 80%; animation-delay: 0.05s; animation-duration: 1.0s; }

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

.player-station {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-track {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.play-pause-btn {
  background: var(--text);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.15s;
}

.play-pause-btn:hover { transform: scale(1.08); }
.play-pause-btn:active { transform: scale(0.96); }

.play-pause-btn svg {
  width: 18px;
  height: 18px;
  fill: var(--bg);
  stroke: none;
}

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  fill: currentColor;
  stroke: none;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 88px;
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  accent-color: var(--text);
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  border: none;
  cursor: pointer;
}

/* ── Utility ──────────────────────────────────────────────── */

.hidden { display: none !important; }

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
  .site-header { padding: 0 20px; }
  .main-content { padding: 20px 20px calc(var(--player-h) + 20px); }

  .station-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .volume-wrap { display: none; }

  .player-bar { padding: 0 16px; gap: 12px; }
}

@media (max-width: 480px) {
  .station-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .logo-svg { height: 22px; }
}
