/* ===================================================
   Funky FM — Radio Station Stylesheet
   A neon-soaked, FNF-themed radio experience
   =================================================== */

/* ---------- Autoplay Gate ---------- */
.radio-autoplay-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 12, 41, 0.97);
  backdrop-filter: blur(30px);
  cursor: pointer;
  transition: opacity .5s ease, visibility .5s ease;
}
.radio-autoplay-gate.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.radio-autoplay-content {
  text-align: center;
  animation: gatePulse 2.5s ease-in-out infinite;
}
.radio-autoplay-icon {
  font-size: 5rem;
  display: block;
  margin-bottom: 1rem;
}
.radio-autoplay-content h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 3rem;
  color: #fff;
  margin: 0;
}
.radio-autoplay-content h2 span {
  background: linear-gradient(135deg, #4ecdc4, #44a8f5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.radio-autoplay-content p {
  color: rgba(255, 255, 255, 0.55);
  margin-top: .75rem;
  font-size: 1.15rem;
  letter-spacing: .5px;
}
@keyframes gatePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.04); opacity: .9; }
}

/* ---------- Radio Page Layout ---------- */
.radio-main {
  padding: 0 !important;
}
.radio-page {
  min-height: calc(100vh - var(--nav-height));
  background: var(--bg-dark);
  padding-bottom: 60px;
}

/* ---------- Hero / Now Playing ---------- */
.radio-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  padding: 40px 20px 30px;
}

[data-theme="dark"] .radio-hero {
  background: linear-gradient(135deg, #0a0a1a, #1a1040, #0f0c29);
}

.radio-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(78, 205, 196, .15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(255, 77, 141, .12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 0%, rgba(123, 104, 238, .1) 0%, transparent 60%);
  animation: radioHeroPulse 8s ease-in-out infinite alternate;
}

@keyframes radioHeroPulse {
  0%   { opacity: .6; }
  100% { opacity: 1; }
}

.radio-hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}

/* ---------- Brand ---------- */
.radio-brand {
  text-align: center;
  margin-bottom: 32px;
}

.radio-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(57, 255, 126, .12);
  border: 1px solid rgba(57, 255, 126, .3);
  border-radius: 99px;
  padding: 4px 14px 4px 10px;
  margin-bottom: 10px;
}

.radio-live-text {
  font-family: 'Fredoka One', var(--font-heading);
  font-size: .75rem;
  letter-spacing: 2px;
  color: #39ff7e;
  text-transform: uppercase;
}

.radio-logo-pulse {
  width: 10px; height: 10px;
  background: #39ff7e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 12px #39ff7e, 0 0 24px rgba(57, 255, 126, .4);
  animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: .6; }
}

.radio-logo-text {
  font-family: 'Fredoka One', var(--font-heading);
  font-size: 3rem;
  letter-spacing: 4px;
  color: #fff;
  text-shadow: 0 0 30px rgba(78, 205, 196, .5), 0 0 60px rgba(78, 205, 196, .2);
  margin: 0;
  line-height: 1;
}

.radio-logo-text span {
  background: linear-gradient(135deg, #4ecdc4, #39ff7e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.radio-tagline {
  color: rgba(255, 255, 255, .6);
  font-size: .9rem;
  margin-top: 6px;
  letter-spacing: 1px;
}

/* ---------- Now Playing Card ---------- */
.radio-now-card {
  display: flex;
  align-items: center;
  gap: 28px;
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
}

/* Cover Art */
.radio-cover-wrap {
  position: relative;
  width: 160px; height: 160px;
  min-width: 160px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
}

.radio-cover-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.radio-cover-img.playing {
  animation: coverBob 2s ease-in-out infinite;
}

@keyframes coverBob {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}

.radio-cover-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, .3) 100%);
  pointer-events: none;
}

/* Vinyl Overlay */
.radio-vinyl-spin {
  display: none;
  position: absolute;
  top: 50%; left: 50%;
  width: 40px; height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .2);
  border-top-color: rgba(78, 205, 196, .8);
  animation: vinylSpin 2s linear infinite;
}

.radio-cover-wrap.playing .radio-vinyl-spin {
  display: block;
}

@keyframes vinylSpin {
  to { transform: rotate(360deg); }
}

/* Track Info */
.radio-track-info {
  flex: 1;
  min-width: 0;
}

.radio-np-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #4ecdc4;
  font-weight: 700;
  margin-bottom: 4px;
}

.radio-np-title {
  font-family: 'Fredoka One', var(--font-heading);
  font-size: 1.8rem;
  color: #fff;
  margin: 0 0 4px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radio-np-artist {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, .7);
  margin: 0 0 2px;
}

.radio-np-album {
  font-size: .85rem;
  color: rgba(255, 255, 255, .4);
  font-style: italic;
  margin: 0 0 4px;
}

.radio-np-credits {
  font-size: .78rem;
  color: rgba(255, 255, 255, .35);
  margin: 0 0 12px;
}

/* ---------- Rating Stars ---------- */
.radio-rating-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.radio-stars {
  display: flex;
  gap: 4px;
}

.radio-stars span {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, .2);
  cursor: pointer;
  transition: color .15s, transform .15s;
  user-select: none;
}

.radio-stars span:hover,
.radio-stars span.hovered {
  color: #ffe066;
  transform: scale(1.2);
}

.radio-stars span.active {
  color: #ffd700;
}

.radio-stars span.avg {
  color: rgba(255, 215, 0, .45);
}

.radio-rating-info {
  font-size: .78rem;
  color: rgba(255, 255, 255, .5);
}

/* ---------- Player Controls ---------- */
.radio-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, .25);
  border-radius: 16px;
  padding: 14px 20px;
}

.radio-ctrl-btn {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .1);
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.radio-ctrl-btn:hover {
  background: rgba(78, 205, 196, .2);
  border-color: rgba(78, 205, 196, .4);
  transform: scale(1.05);
}

.radio-play-btn {
  width: 56px; height: 56px;
  font-size: 1.4rem;
  background: linear-gradient(135deg, #4ecdc4, #39ff7e);
  border: none;
  color: #0f0c29;
  font-weight: 700;
}

.radio-play-btn:hover {
  background: linear-gradient(135deg, #39ff7e, #4ecdc4);
  box-shadow: 0 0 20px rgba(78, 205, 196, .4);
}

.radio-play-btn.playing {
  background: linear-gradient(135deg, #ff6b9d, #ff4d8d);
}

.radio-play-btn.playing:hover {
  background: linear-gradient(135deg, #ff4d8d, #ff6b9d);
  box-shadow: 0 0 20px rgba(255, 77, 141, .4);
}

/* Progress Bar — Live style (no seeking) */
.radio-live-progress-wrap {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.radio-live-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, .1);
  border-radius: 2px;
  overflow: hidden;
}

.radio-live-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4ecdc4, #39ff7e);
  border-radius: 2px;
  transition: width .3s linear;
  box-shadow: 0 0 8px rgba(78, 205, 196, .5);
}

.radio-live-times {
  display: flex;
  justify-content: space-between;
}

.radio-time {
  font-size: .72rem;
  color: rgba(255, 255, 255, .45);
  font-variant-numeric: tabular-nums;
}

.radio-progress,
.radio-volume {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .12);
  outline: none;
  cursor: pointer;
}

.radio-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #4ecdc4;
  box-shadow: 0 0 8px rgba(78, 205, 196, .5);
  cursor: pointer;
  transition: transform .15s;
}

.radio-volume::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Volume */
.radio-volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.radio-vol-icon {
  font-size: .9rem;
  cursor: pointer;
}

.radio-volume {
  width: 90px;
}

/* ---------- Tabs ---------- */
.radio-tabs {
  display: flex;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  border-bottom: 2px solid var(--border);
}

.radio-tab {
  background: none;
  border: none;
  padding: 14px 24px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.radio-tab:hover {
  color: var(--text-primary);
}

.radio-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.radio-tab-badge {
  background: var(--accent-cyan);
  color: #fff;
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
}

/* Tab Content */
.radio-tab-content {
  display: none;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px;
}

.radio-tab-content.active {
  display: block;
}

/* ---------- Queue ---------- */
.radio-queue {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.radio-queue-section {
  margin-bottom: 8px;
}

.radio-queue-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 12px 16px 6px;
}

.radio-queue-label.now-playing-label {
  color: #4ecdc4;
}

.radio-queue-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all .2s;
}

.radio-queue-item.history {
  opacity: .5;
}

.radio-queue-item.history:hover {
  opacity: .75;
  background: var(--bg-card-hover);
}

.radio-queue-item.now-playing {
  background: rgba(78, 205, 196, .1);
  border-color: rgba(78, 205, 196, .3);
  opacity: 1;
}

[data-theme="dark"] .radio-queue-item.now-playing {
  background: rgba(78, 205, 196, .12);
  border-color: rgba(78, 205, 196, .25);
}

.radio-queue-item.now-playing .radio-q-title {
  color: #4ecdc4;
  font-weight: 700;
}

.radio-queue-item.upcoming:hover {
  background: var(--bg-card-hover);
  border-color: var(--border);
}

.radio-q-playing-icon {
  display: flex;
  align-items: center;
  min-width: 28px;
  justify-content: center;
  color: var(--accent-cyan);
}

.radio-q-num {
  font-size: .82rem;
  color: var(--text-muted);
  min-width: 28px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.radio-q-cover {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.radio-q-info {
  flex: 1;
  min-width: 0;
}

.radio-q-title {
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .92rem;
}

.radio-q-artist {
  font-size: .8rem;
  color: var(--text-muted);
}

/* YouTube badge on queue items */
.radio-yt-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  color: #fff;
  background: #ff0000;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: .5px;
  line-height: 1.4;
}

/* ---------- Listener Badge ---------- */
.radio-listener-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(57, 255, 126, .08);
  border: 1px solid rgba(57, 255, 126, .2);
  border-radius: 99px;
  padding: 5px 14px;
  margin-top: 10px;
  font-size: .82rem;
  color: rgba(255, 255, 255, .7);
}
.radio-listener-badge span:first-child {
  font-size: 1rem;
}

/* ---------- Next Track Countdown ---------- */
.radio-next-countdown {
  font-size: .78rem;
  color: #4ecdc4;
  white-space: nowrap;
  animation: countdownPulse 2s ease-in-out infinite;
}
@keyframes countdownPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .6; }
}

/* ---------- Live Chat Panel ---------- */
.radio-live-panel {
  display: flex;
  flex-direction: column;
  height: 480px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.radio-chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.radio-chat-feed::-webkit-scrollbar {
  width: 6px;
}
.radio-chat-feed::-webkit-scrollbar-thumb {
  background: rgba(78, 205, 196, .3);
  border-radius: 3px;
}
.radio-chat-notice {
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
  padding: 40px 0;
}
.radio-chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 6px 0;
}
.radio-chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(78, 205, 196, .3);
}
.radio-chat-body {
  flex: 1;
  min-width: 0;
}
.radio-chat-name {
  font-weight: 700;
  font-size: .82rem;
  color: #4ecdc4;
  margin-right: 6px;
}
.radio-chat-time {
  font-size: .7rem;
  color: var(--text-muted);
}
.radio-chat-text {
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
  margin-top: 2px;
}
.radio-chat-input-wrap {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, .15);
}
.radio-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 20px;
  color: var(--text-primary);
  padding: 8px 16px;
  font-size: .88rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color .2s;
}
.radio-chat-input:focus {
  border-color: rgba(78, 205, 196, .5);
}
.radio-chat-send-btn {
  background: linear-gradient(135deg, #4ecdc4, #39ff7e);
  border: none;
  color: #0f0c29;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.radio-chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(78, 205, 196, .4);
}
.radio-chat-login {
  text-align: center;
  padding: 12px;
  font-size: .85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.radio-chat-login a {
  color: #4ecdc4;
  text-decoration: none;
  font-weight: 600;
}
.radio-chat-login a:hover {
  text-decoration: underline;
}

.radio-q-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .82rem;
  color: var(--text-muted);
}

.radio-q-rating .star-filled {
  color: #ffd700;
}

/* Playing animation bars */
.radio-eq-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.radio-eq-bars span {
  width: 3px;
  background: var(--accent-cyan);
  border-radius: 2px;
  animation: eqBar 0.8s ease-in-out infinite alternate;
}

.radio-eq-bars span:nth-child(1) { height: 8px; animation-delay: 0s; }
.radio-eq-bars span:nth-child(2) { height: 14px; animation-delay: .15s; }
.radio-eq-bars span:nth-child(3) { height: 6px; animation-delay: .3s; }
.radio-eq-bars span:nth-child(4) { height: 12px; animation-delay: .45s; }

.radio-eq-bars.paused span {
  animation-play-state: paused;
}

@keyframes eqBar {
  0%   { height: 4px; }
  100% { height: 16px; }
}

/* ---------- Top 50 ---------- */
.radio-top50-header {
  text-align: center;
  margin-bottom: 24px;
}

.radio-top50-header h2 {
  font-family: 'Fredoka One', var(--font-heading);
  font-size: 1.8rem;
  margin: 0 0 6px;
}

.radio-top50-header p {
  color: var(--text-muted);
  font-size: .9rem;
}

.radio-top50-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.radio-top50-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all .2s;
  cursor: pointer;
}

.radio-top50-item:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

/* Top 3 special styling */
.radio-top50-item[data-rank="1"] { border-color: #ffd700; background: rgba(255, 215, 0, .05); }
.radio-top50-item[data-rank="2"] { border-color: #c0c0c0; background: rgba(192, 192, 192, .04); }
.radio-top50-item[data-rank="3"] { border-color: #cd7f32; background: rgba(205, 127, 50, .04); }

.radio-rank {
  font-family: 'Fredoka One', var(--font-heading);
  font-size: 1.2rem;
  min-width: 36px;
  text-align: center;
  color: var(--text-muted);
}

.radio-top50-item[data-rank="1"] .radio-rank { color: #ffd700; font-size: 1.4rem; }
.radio-top50-item[data-rank="2"] .radio-rank { color: #c0c0c0; font-size: 1.3rem; }
.radio-top50-item[data-rank="3"] .radio-rank { color: #cd7f32; font-size: 1.3rem; }

.radio-top50-cover {
  width: 48px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.radio-top50-info {
  flex: 1;
  min-width: 0;
}

.radio-top50-title {
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radio-top50-artist {
  font-size: .82rem;
  color: var(--text-muted);
}

.radio-top50-stats {
  text-align: right;
  min-width: 75px;
}

.radio-top50-avg {
  font-family: 'Fredoka One', var(--font-heading);
  font-size: 1.1rem;
  color: #ffd700;
}

.radio-top50-votes {
  font-size: .72rem;
  color: var(--text-muted);
}

.radio-top50-stars {
  color: #ffd700;
  font-size: .85rem;
  letter-spacing: 1px;
}

/* ---------- Loading / Empty ---------- */
.radio-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: .95rem;
}

.radio-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.radio-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
  .radio-logo-text {
    font-size: 2rem;
  }

  .radio-now-card {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
    gap: 16px;
  }

  .radio-cover-wrap {
    width: 120px; height: 120px;
    min-width: 120px;
    margin: 0 auto;
  }

  .radio-np-title {
    font-size: 1.3rem;
    white-space: normal;
  }

  .radio-rating-section {
    justify-content: center;
  }

  .radio-controls {
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px;
    gap: 8px;
  }

  .radio-live-progress-wrap {
    order: 10;
    width: 100%;
    min-width: 0;
  }

  .radio-volume-wrap {
    order: 11;
  }

  .radio-tab {
    padding: 12px 16px;
    font-size: .85rem;
  }

  .radio-queue-item {
    padding: 8px 12px;
    gap: 10px;
  }

  .radio-q-cover {
    width: 38px; height: 38px;
  }

  .radio-q-rating {
    display: none;
  }
}

@media (max-width: 400px) {
  .radio-hero {
    padding: 24px 12px 20px;
  }

  .radio-logo-text {
    font-size: 1.6rem;
  }

  .radio-cover-wrap {
    width: 100px; height: 100px;
    min-width: 100px;
  }

  .radio-ctrl-btn {
    width: 38px; height: 38px;
    font-size: .95rem;
  }

  .radio-play-btn {
    width: 48px; height: 48px;
    font-size: 1.2rem;
  }
}
