/* Radio Page - Analog Radio UI */
.radio-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 20px 40px;
}

/* ── Radio Chassis ──────────────────────────────────────── */
.radio-chassis {
  position: relative;
  background-color: var(--bg-secondary);
  border: 2px solid var(--border-accent);
  border-radius: 10px;
  box-shadow: 0 0 20px var(--shadow-color), inset 0 1px 0 rgba(255,255,255,0.03);
  overflow: hidden;
  margin-bottom: 30px;
}

.radio-chassis::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.15) 0px,
    rgba(0,0,0,0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  opacity: 0.4;
  pointer-events: none;
  z-index: 10;
  border-radius: inherit;
}

/* ── Brand Strip ────────────────────────────────────────── */
.radio-brand {
  text-align: center;
  padding: 14px 20px;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--text-primary);
  text-shadow: 0 0 10px var(--shadow-color);
  border-bottom: 2px solid var(--border-accent);
  background-color: var(--bg-color);
}

/* ── Tuning Band ────────────────────────────────────────── */
.radio-tuning-band {
  position: relative;
  height: 64px;
  margin: 20px 20px 0;
  border: 2px solid var(--border-accent);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--bg-color) 0%, var(--bg-secondary) 100%);
  overflow: hidden;
  cursor: pointer;
}

.radio-tuning-scale {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
}

.radio-tuning-marker {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  cursor: pointer;
  z-index: 2;
  transition: opacity 0.2s ease;
}

.radio-tuning-marker:hover {
  opacity: 0.8;
}

.radio-tuning-marker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-bottom: 4px;
  box-shadow: 0 0 6px currentColor;
}

.radio-tuning-marker-freq {
  font-size: 9px;
  color: var(--text-secondary);
  font-family: GohuFont14NerdFont, monospace;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.radio-tuning-marker-name {
  font-size: 10px;
  color: var(--text-primary);
  font-family: GohuFont14NerdFont, monospace;
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tick marks along the dial */
.radio-tuning-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 8px;
  background-color: var(--border-color);
  opacity: 0.4;
}

.radio-tuning-tick.major {
  height: 14px;
  opacity: 0.6;
}

/* Needle indicator */
.radio-tuning-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--text-primary);
  box-shadow: 0 0 8px var(--text-primary), 0 0 16px var(--shadow-color);
  z-index: 5;
  transition: left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}

.radio-tuning-needle::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--text-primary);
  box-shadow: 0 0 6px var(--text-primary);
}

/* ── Display Panel ──────────────────────────────────────── */
.radio-display-panel {
  display: flex;
  gap: 20px;
  padding: 20px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin: 20px 20px 0;
  border-radius: 6px;
  background-color: var(--bg-color);
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.radio-display-panel::before {
  content: '';
  position: absolute;
  inset: -30px;
  background-image: var(--radio-album-bg, none);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(50px) saturate(1.4);
  opacity: var(--radio-album-opacity, 0.4);
  z-index: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.radio-chassis.is-playing .radio-display-panel {
  box-shadow: inset 0 0 24px var(--shadow-color);
  transition: box-shadow 0.4s ease;
}

/* Album Art */
.radio-album-art-wrap {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
  border: 2px solid var(--border-accent);
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.radio-album-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* Now Playing Info */
.radio-now-playing-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.radio-info-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.radio-info-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-secondary);
  opacity: 0.7;
  font-family: GohuFont14NerdFont, monospace;
  flex-shrink: 0;
  width: 60px;
}

.radio-info-value {
  font-size: 14px;
  color: var(--text-primary);
  font-family: GohuFont14NerdFont, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* EQ Bars (inside display panel) */
.radio-page-eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
  margin-top: 6px;
}

.radio-page-eq-bar {
  display: block;
  width: 4px;
  background-color: var(--text-primary);
  border-radius: 1px;
  height: 4px;
  opacity: 0.3;
}

.radio-page-eq.active .radio-page-eq-bar {
  opacity: 1;
  animation: eqBounce 0.6s ease-in-out infinite alternate;
}

.radio-page-eq.active .radio-page-eq-bar:nth-child(1) { animation-delay: 0s; }
.radio-page-eq.active .radio-page-eq-bar:nth-child(2) { animation-delay: 0.12s; }
.radio-page-eq.active .radio-page-eq-bar:nth-child(3) { animation-delay: 0.24s; }
.radio-page-eq.active .radio-page-eq-bar:nth-child(4) { animation-delay: 0.08s; }
.radio-page-eq.active .radio-page-eq-bar:nth-child(5) { animation-delay: 0.2s; }
.radio-page-eq.active .radio-page-eq-bar:nth-child(6) { animation-delay: 0.05s; }

/* ── Speaker Grille + Visualizer ────────────────────────── */
.radio-speaker-grille {
  margin: 20px 20px 0;
  border: 2px solid var(--border-accent);
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--bg-color);
}

.radio-speaker-label {
  display: block;
  text-align: center;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-secondary);
  opacity: 0.5;
  font-family: GohuFont14NerdFont, monospace;
  padding: 8px 0 0;
}

.radio-visualizer-canvas {
  display: block;
  width: 100%;
  height: 140px;
}

/* ── Stats for Nerds Panel ─────────────────────────────── */
.radio-stats-panel {
  margin: 20px 20px 0;
}

.radio-stats-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: GohuFont14NerdFont, monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-secondary);
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.radio-stats-toggle:hover {
  opacity: 0.8;
}

.radio-stats-chevron {
  font-size: 8px;
  transition: transform 0.3s ease;
}

.radio-stats-panel:not(.collapsed) .radio-stats-chevron {
  transform: rotate(180deg);
}

.radio-stats-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  border: 2px solid transparent;
  border-radius: 6px;
  background-color: var(--bg-color);
}

.radio-stats-panel:not(.collapsed) .radio-stats-content {
  max-height: 600px;
  padding: 16px;
  border-color: var(--border-accent);
}

.radio-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}

.radio-stats-divider {
  grid-column: 1 / -1;
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text-secondary);
  opacity: 0.4;
  font-family: GohuFont14NerdFont, monospace;
  text-transform: uppercase;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  margin-top: 4px;
}

.radio-stats-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radio-stats-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-secondary);
  opacity: 0.6;
  font-family: GohuFont14NerdFont, monospace;
  text-transform: uppercase;
}

.radio-stats-value {
  font-size: 12px;
  color: var(--text-primary);
  font-family: GohuFont14NerdFont, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Controls (Tune Button) ─────────────────────────────── */
.radio-controls {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.radio-page-tune-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 240px;
  height: 48px;
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  background: none;
  color: var(--text-primary);
  font-family: GohuFont14NerdFont, monospace;
  font-size: 15px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-page-tune-btn:hover {
  border-color: var(--text-primary);
  box-shadow: 0 0 8px var(--shadow-color);
  background-color: color-mix(in srgb, var(--text-primary) 4%, transparent);
}

.radio-page-tune-btn.tuned-in {
  border-color: var(--text-primary);
  box-shadow: 0 0 6px var(--shadow-color);
}

.radio-page-tune-prompt {
  font-weight: bold;
  color: var(--text-primary);
  flex-shrink: 0;
}

.radio-page-tune-icon {
  flex-shrink: 0;
}

.radio-page-tune-label {
  flex-shrink: 0;
}

.radio-page-tune-cursor::after {
  content: '\2588';
  font-size: 13px;
  animation: radioCursorBlink 1s step-end infinite;
  opacity: 0.6;
}

@keyframes radioCursorBlink {
  0%, 49% { opacity: 0.6; }
  50%, 100% { opacity: 0; }
}

/* ── Station Cards ──────────────────────────────────────── */
.radio-station-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.radio-station-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-station-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 0 8px var(--shadow-color);
  background-color: color-mix(in srgb, var(--text-primary) 4%, transparent);
}

.radio-station-card.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 8px var(--shadow-color), inset 0 0 24px var(--shadow-color);
  background-color: color-mix(in srgb, var(--text-primary) 8%, transparent);
}

.radio-station-card.active .radio-card-dot {
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.radio-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.radio-card-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.radio-card-name {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-primary);
}

.radio-card-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.radio-card-tracks {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.7;
}

.radio-card-playing {
  display: none;
  font-size: 11px;
  color: var(--text-primary);
  margin-top: 8px;
}

.radio-station-card.active .radio-card-playing {
  display: block;
}

.radio-card-onair {
  font-size: 11px;
  font-family: GohuFont14NerdFont, monospace;
  color: var(--text-secondary);
  opacity: 0.6;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Mobile Responsive ──────────────────────────────────── */
@media (max-width: 480px) {
  .radio-page {
    padding: 70px 10px 30px;
  }

  .radio-brand {
    font-size: 16px;
    letter-spacing: 4px;
    padding: 12px 15px;
  }

  .radio-tuning-band {
    margin: 15px 12px 0;
    height: 56px;
  }

  .radio-tuning-marker-name {
    display: none;
  }

  .radio-display-panel {
    flex-direction: column;
    align-items: center;
    margin: 15px 12px 0;
    padding: 15px;
  }

  .radio-album-art-wrap {
    width: 100%;
    max-width: 260px;
    height: 200px;
  }

  .radio-now-playing-info {
    width: 100%;
    align-items: center;
  }

  .radio-info-row {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
  }

  .radio-info-label {
    width: auto;
  }

  .radio-info-value {
    font-size: 13px;
  }

  .radio-page-eq {
    justify-content: center;
  }

  .radio-stats-panel {
    margin: 15px 12px 0;
  }

  .radio-stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .radio-stats-panel:not(.collapsed) .radio-stats-content {
    padding: 12px;
  }

  .radio-speaker-grille {
    margin: 15px 12px 0;
  }

  .radio-visualizer-canvas {
    height: 100px;
  }

  .radio-controls {
    padding: 15px 12px;
  }

  .radio-page-tune-btn {
    width: 100%;
  }

  .radio-station-cards {
    grid-template-columns: 1fr;
  }
}
