/**
 * Radio Detail Page Styles.
 * Player, metadata, schedule, contacts, and related content.
 * Breadcrumb in components/breadcrumb.css; base .main-content in layout.css.
 */

@import "../components/radio-card.css";
@import "../components/podcast-card.css";

/* Main Content Layout Override: transparent bg for detail page */
.main-content {
  padding: 0 var(--space-md);
  background-color: transparent;
}

/* Radio Player Section */
.radio-player {
  background: var(--color-bg-elevated);
  border-radius: 16px;
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .radio-player {
  background: #0f172a;
  border-color: #1f2937;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Breadcrumb inside player */
.radio-player .breadcrumb {
  margin-bottom: var(--space-sm);
  margin-top: var(--space-sm);
}

/* First flex div: Image, middle content, play button */
.radio-player__main {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
  margin-bottom: var(--space-md);
}

/* First div: Radio logo */
.radio-player__logo-container {
  flex-shrink: 0;
  position: relative;
}

.radio-player__logo {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.radio-player__playing-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    180deg,
    rgba(2, 6, 23, 0.06) 0%,
    rgba(2, 6, 23, 0.2) 45%,
    rgba(2, 6, 23, 0.78) 100%
  );
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
  z-index: 1;
}

.radio-player__logo-container.is-playing .radio-player__playing-overlay {
  opacity: 1;
  visibility: visible;
}

.radio-player__playing-bars {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  height: 50%;
  width: 100%;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.35));
}

.radio-player__playing-bar {
  flex: 0 0 auto;
  width: 10px;
  height: 100%;
  border-radius: 999px;
  transform-origin: center bottom;
  transform: scaleY(var(--bar-low, 0.3));
  animation: radio-player-rainbow-bars var(--bar-duration, 0.95s) ease-in-out infinite;
  animation-delay: var(--bar-delay, 0s);
  box-shadow: 0 0 12px var(--bar-color);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.45) 0%,
    var(--bar-color) 40%,
    var(--bar-color) 100%
  );
}

.radio-player__playing-bar--1 {
  --bar-color: #06b6d4;
  --bar-low: 0.22;
  --bar-high: 0.76;
  --bar-duration: 0.9s;
}

.radio-player__playing-bar--2 {
  --bar-color: #22c55e;
  --bar-low: 0.3;
  --bar-high: 0.88;
  --bar-delay: 0.08s;
  --bar-duration: 0.98s;
}

.radio-player__playing-bar--3 {
  --bar-color: #facc15;
  --bar-low: 0.16;
  --bar-high: 0.64;
  --bar-delay: 0.14s;
  --bar-duration: 0.85s;
}

.radio-player__playing-bar--4 {
  --bar-color: #fb923c;
  --bar-low: 0.28;
  --bar-high: 0.96;
  --bar-delay: 0.02s;
  --bar-duration: 1.02s;
}

.radio-player__playing-bar--5 {
  --bar-color: #f97316;
  --bar-low: 0.18;
  --bar-high: 0.78;
  --bar-delay: 0.11s;
  --bar-duration: 0.92s;
}

.radio-player__playing-bar--6 {
  --bar-color: #ef4444;
  --bar-low: 0.34;
  --bar-high: 1;
  --bar-delay: 0.05s;
  --bar-duration: 0.86s;
}

.radio-player__playing-bar--7 {
  --bar-color: #f43f5e;
  --bar-low: 0.2;
  --bar-high: 0.72;
  --bar-delay: 0.18s;
  --bar-duration: 0.94s;
}

.radio-player__playing-bar--8 {
  --bar-color: #22c55e;
  --bar-low: 0.38;
  --bar-high: 0.92;
  --bar-delay: 0.09s;
  --bar-duration: 1s;
}

.radio-player__playing-bar--9 {
  --bar-color: #fde047;
  --bar-low: 0.26;
  --bar-high: 0.84;
  --bar-delay: 0.15s;
  --bar-duration: 0.88s;
}

@keyframes radio-player-rainbow-bars {
  0%,
  100% {
    transform: scaleY(var(--bar-low, 0.3));
  }
  50% {
    transform: scaleY(var(--bar-high, 0.9));
  }
}

/* Mobile: Adjust player layout to match image */
@media (max-width: 1024px) {
  .radio-player {
    padding: var(--space-md);
    background: #fff;
    border-radius: 0;
    margin-bottom: var(--space-md);
  }
  
  .radio-player__main {
    gap: var(--space-md);
    align-items: flex-start;
  }
  
  .radio-player__logo {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
  }

  .radio-player__playing-overlay {
    padding: 10px;
    border-radius: var(--radius-sm);
  }

  .radio-player__playing-bars {
    gap: 4px;
    height: 62%;
  }

  .radio-player__playing-bar {
    width: 6px;
  }
  
  .radio-player__content {
    flex: 1;
    min-width: 0;
    height: 120px;
  }
  
  .radio-player__frequency {
    font-size: 0.875rem;
  }
  
  .radio-player__volume-row {
    display: none; /* Hide volume on mobile */
  }
  
  .radio-player__play-container {
    align-self: flex-start;
  }
  
  .radio-player__play-button {
    width: 64px;
    height: 64px;
    background: var(--color-play-button);
  }
  
  .radio-player__play-button svg {
    width: 32px;
    height: 32px;
  }
  
  /* Songs section mobile styling */
  .radio-player__metadata {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid #e0e0e0;
  }
  
  .previous-songs {
    max-height: 200px;
  }
  
  .history-song {
    padding: var(--space-xs) 0;
  }
  
  .history-song img {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 768px) {
  .radio-player__playing-overlay {
    padding: 8px;
  }

  .radio-player__playing-bars {
    gap: 3px;
    height: 58%;
  }

  .radio-player__playing-bar {
    width: 5px;
  }
}

/* Middle content: name, frequency, volume, genres */
.radio-player__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  height: 200px;
}

/* Play button + like/dislike column */
.radio-player__play-container {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  align-self: flex-start;
  gap: var(--space-md);
}

.radio-player__http-stream-note {
  font-size: 0.875rem;
}

.radio-player__http-stream-note a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

@supports (content-visibility: auto) {
  .related-section,
  .radio-info {
    content-visibility: auto;
    contain-intrinsic-size: 1px 1000px;
  }
}

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

.radio-player__genre-tag {
  padding: 6px 14px;
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--color-text);
  white-space: nowrap;
  font-weight: 500;
  display: inline-block;
}

[data-theme="dark"] .radio-player__genre-tag {
  background: #1f2937;
  border-color: #334155;
  color: #e2e8f0;
}

.radio-player__rating-combo {
  display: flex;
  align-items: stretch;
  justify-content: center;
  border: 1px solid #bfc2c7;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
}

[data-theme="dark"] .radio-player__rating-combo {
  border-color: #475569;
  background: #111827;
}

.radio-player__rating-segment {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-xs);
  color: #4b5563;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.radio-player__rating-segment.is-active,
.radio-player__rating-segment--active {
  background: #f0f2f5;
  color: #1f2937;
}

.radio-player__rating-segment--active .radio-player__rating-icon--like {
  filter: brightness(0) saturate(100%) invert(35%) sepia(99%) saturate(7485%) hue-rotate(343deg) brightness(95%) contrast(92%);
}

.radio-player__rating-segment--active .radio-player__rating-icon--dislike {
  filter: brightness(0) saturate(100%) invert(35%) sepia(99%) saturate(7485%) hue-rotate(343deg) brightness(95%) contrast(92%);
}

[data-theme="dark"] .radio-player__rating-segment.is-active,
[data-theme="dark"] .radio-player__rating-segment--active {
  background: #1f2937;
  color: #f8fafc;
}

.radio-player__rating-segment--right {
  border-left: 1px solid #bfc2c7;
}

.radio-player__rating-segment:hover {
  background: #f5f6f7;
}

[data-theme="dark"] .radio-player__rating-segment {
  color: #e5e7eb;
}

[data-theme="dark"] .radio-player__rating-segment--right {
  border-left-color: #475569;
}

[data-theme="dark"] .radio-player__rating-segment:hover {
  background: #1f2937;
}

.radio-player__rating-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.radio-player__rating-icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  transform: scale(0.75);
  transform-origin: center;
}

.radio-player__rating-button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  cursor: pointer;
  padding: 6px 12px;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.radio-player__rating-button:hover {
  background: #eeeeee;
  border-color: #d0d0d0;
}

.radio-player__rating-button svg {
  width: 20px;
  height: 20px;
  fill: #4b5563;
  transition: fill var(--transition-fast), opacity var(--transition-fast);
}

.radio-player__rating-button svg.md-inactive {
  opacity: 0.5;
}

.radio-player__rating-button:hover svg {
  fill: #333;
  opacity: 1;
}

.radio-player__rating-button svg:not(.md-inactive) {
  fill: #333;
  opacity: 1;
}

.radio-player__rating-count {
  font-size: var(--font-size-xs);
  color: #475569;
  font-weight: 500;
  line-height: 1;
}

/* Name and frequency */
.radio-player__name-wrapper {
  min-width: 0;
}

.radio-player__name {
  font-size: var(--h1-size);
  font-weight: bold;
  margin: 0 0 4px 0;
  color: #000;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .radio-player__name {
    font-size: var(--h1-size-mobile);
  }
}

.radio-player__frequency {
  font-size: 1rem;
  color: #475569;
  margin: 0;
  font-weight: normal;
}

/* Favorite button (always at end) */
.radio-player__favorite-overlay {
  position: absolute;
  top: -22px;
  right: -22px;
  background: #ffffff;
  border: 2px solid #f87171;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  color: #64748b;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
  .radio-player__playing-overlay {
    transition: none;
  }

  .radio-player__playing-bar {
    animation: none;
    transform: scaleY(0.6);
  }
}

.radio-player__favorite-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  pointer-events: none;
}

[data-theme="dark"] .radio-player__favorite-overlay {
  background: #0f172a;
  border-color: #f87171;
  color: #cbd5e1;
}

.radio-player__favorite-icon,
.radio-player__favorite-img {
  display: none;
}

.radio-player__favorite-svg {
  width: 26px;
  height: 26px;
  pointer-events: none;
}

.radio-player__favorite-path--outline {
  fill: currentColor;
}

.radio-player__favorite-path--filled {
  display: none;
  fill: var(--color-error, #f44336);
}

.radio-player__favorite-overlay:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.radio-player__favorite-overlay.is-favorite,
.radio-player__favorite-overlay.active,
.radio-player__favorite-overlay.favorited,
.radio-player__favorite-overlay[aria-pressed="true"],
.radio-player__favorite-overlay[data-favorited="true"] {
  background: #ffffff;
}

.radio-player__favorite-overlay[aria-pressed="true"] .radio-player__favorite-path--outline,
.radio-player__favorite-overlay[data-favorited="true"] .radio-player__favorite-path--outline {
  display: none;
}

.radio-player__favorite-overlay[aria-pressed="true"] .radio-player__favorite-path--filled,
.radio-player__favorite-overlay[data-favorited="true"] .radio-player__favorite-path--filled {
  display: inline;
}

[data-theme="dark"] .radio-player__favorite-overlay.is-favorite,
[data-theme="dark"] .radio-player__favorite-overlay.active,
[data-theme="dark"] .radio-player__favorite-overlay.favorited,
[data-theme="dark"] .radio-player__favorite-overlay[aria-pressed="true"],
[data-theme="dark"] .radio-player__favorite-overlay[data-favorited="true"] {
  background: #0f172a;
}

.radio-player__name {
  color: #0f172a;
}

[data-theme="dark"] .radio-player__name {
  color: #e5e7eb;
}

[data-theme="dark"] .history-song .song-name {
  color: #e5e7eb;
}

[data-theme="dark"] .history-song .artist-name {
  color: #cbd5e1;
}

/* Volume Row: Volume slider only */
.radio-player__volume-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.radio-player__volume {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  width: 100%;
}

.radio-player__volume-icon {
  width: 20px;
  height: 20px;
  fill: #000;
  cursor: pointer;
  flex-shrink: 0;
}

[data-theme="dark"] .radio-player__volume-icon {
  fill: #fff;
}

.radio-player__volume-slider {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  --vol: 100%;
  --vol-fill: #111827; /* filled part color (light) */
  --vol-bg: #cbd5e1;   /* unfilled part color (light) */
  background: linear-gradient(
    to right,
    var(--vol-fill) 0%,
    var(--vol-fill) var(--vol),
    var(--vol-bg) var(--vol),
    var(--vol-bg) 100%
  );
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.radio-player__volume-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: transparent; /* gradient is on the input itself */
}

.radio-player__volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #111827;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  margin-top: -6px; /* center thumb vertically on 6px track */
}

.radio-player__volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #111827;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.radio-player__volume-slider::-moz-range-track {
  background: var(--vol-bg);
  height: 6px;
  border-radius: 999px;
}

.radio-player__volume-slider::-moz-range-progress {
  background: var(--vol-fill);
  height: 6px;
  border-radius: 999px;
}

[data-theme="dark"] .radio-player__volume-slider {
  --vol-fill: #f8fafc; /* filled part color (dark) */
  --vol-bg: #1f2937;   /* unfilled part color (dark) */
}

[data-theme="dark"] .radio-player__volume-slider::-webkit-slider-thumb {
  background: #f8fafc;
  border: 2px solid #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .radio-player__volume-slider::-moz-range-thumb {
  background: #f8fafc;
  border: 2px solid #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .radio-player__volume-slider::-moz-range-track {
  background: var(--vol-bg);
}

[data-theme="dark"] .radio-player__volume-slider::-moz-range-progress {
  background: var(--vol-fill);
}

.radio-player__play-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: var(--color-play-button);
  color: white;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.radio-player__play-button--connecting {
  cursor: progress;
}

.radio-player__play-button--connecting svg {
  opacity: 0;
}

.radio-player__play-button--connecting::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(24px, 40%, 44px);
  height: clamp(24px, 40%, 44px);
  border-radius: 50%;
  box-sizing: border-box;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  transform: translate(-50%, -50%) rotate(0deg);
  animation: radio-player-spin 0.9s linear infinite;
  pointer-events: none;
  opacity: 1;
  background: none;
  transition: none;
}

@keyframes radio-player-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.radio-player__play-button:hover {
  transform: scale(1.04);
  background: var(--color-play-button-hover);
}

.radio-player__play-button--playing {
  background: var(--color-play-button-playing);
}

.radio-player__play-button--playing:hover {
  background: var(--color-play-button-playing-hover);
}

.radio-player__play-button svg {
  width: 40px;
  height: 40px;
  fill: currentColor;
}

/* Desktop: Make play button BIGGER */
@media (min-width: 1025px) {
  .radio-player__play-button {
    width: 100px;
    height: 100px;
  }
  
  .radio-player__play-button svg {
    width: 50px;
    height: 50px;
  }
}

/* Currently Playing & Recent Songs */
.radio-player__metadata {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid #e0e0e0;
  width: 100%;
}

/* Metadata hiding uses max-height transition (set in critical CSS) so
   the reveal is animated and doesn't count toward CLS.
   Override native [hidden] display to allow the transition to work. */
.radio-player__metadata[hidden],
#metadata_container[hidden] {
  display: block !important;
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Metadata section - Currently Playing & Recent Songs */
/* These styles work with the metadata.js Song objects */
#song_history {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.latest-song {
  margin-bottom: 6px;
}

/* Current song (LIVE) styling */
.latest-song .history-song {
  background: transparent;
  border: none;
  padding: 4px 0;
  position: relative;
  padding-left: 0;
}

.latest-song .history-song .time-stamp.live-song {
  color: #f44336;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes liveBars {
  0% {
    background-size: 3px 35%, 3px 70%, 3px 45%, 3px 60%;
  }
  25% {
    background-size: 3px 65%, 3px 35%, 3px 70%, 3px 45%;
  }
  50% {
    background-size: 3px 45%, 3px 60%, 3px 35%, 3px 70%;
  }
  75% {
    background-size: 3px 70%, 3px 45%, 3px 60%, 3px 35%;
  }
  100% {
    background-size: 3px 35%, 3px 70%, 3px 45%, 3px 60%;
  }
}

.latest-song .history-song .time-stamp.live-song::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.latest-song .history-song .time-stamp.live-song::after {
  content: '';
  width: 22px;
  height: 14px;
  display: inline-block;
  background:
    linear-gradient(currentColor 0 0) 0 100% / 3px 35% no-repeat,
    linear-gradient(currentColor 0 0) 7px 100% / 3px 70% no-repeat,
    linear-gradient(currentColor 0 0) 14px 100% / 3px 45% no-repeat,
    linear-gradient(currentColor 0 0) 21px 100% / 3px 60% no-repeat;
  animation: liveBars 0.9s ease-in-out infinite;
}

.previous-songs {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 200px;
  overflow-y: auto;
  padding-right: var(--space-md);
  position: relative;
  margin-right: var(--space-xs);
}

.previous-songs::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #e0e0e0;
}

.previous-songs::-webkit-scrollbar {
  width: 6px;
}

.previous-songs::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 3px;
}

.previous-songs::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.previous-songs::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.history-song {
  display: grid;
  grid-template-columns: 50px 1fr auto auto;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 4px 0;
  border-radius: 0;
  background: transparent;
  transition: background-color var(--transition-fast);
  text-decoration: none;
  color: inherit;
  position: relative;
  padding-right: 0;
}

.history-song:hover {
  background: transparent;
  transform: none;
}

.history-song > a {
  display: contents;
  text-decoration: none;
  color: inherit;
}

.history-song > a .song-name::after {
  content: '';
  position: absolute;
  inset: 0;
}

.history-song img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  grid-column: 1;
  grid-row: 1 / 3;
  display: block;
}

.history-song .song-name {
  grid-column: 2;
  grid-row: 1;
  font-weight: 600;
  color: #000;
  min-width: 0;
  font-size: 0.875rem;
  display: block;
  align-self: end;
}

.history-song .song-name p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  line-height: 1.2;
}

.history-song .artist-name {
  grid-column: 2;
  grid-row: 2;
  color: #666;
  font-size: 0.8125rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  display: block;
}

.history-song .time-stamp {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: center;
  color: #999;
  font-size: 0.75rem;
  white-space: nowrap;
  font-weight: 400;
  text-align: right;
  padding-right: 0;
}

.history-song .live-badge {
  grid-column: 4;
  grid-row: 1 / 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #f44336;
}

.history-song .live-badge .live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f44336;
  display: inline-block;
}

.history-song .live-badge .live-anim {
  display: none;
}

[data-theme="dark"] .history-song .live-badge {
  color: #f87171;
}

[data-theme="dark"] .history-song .live-badge .live-dot {
  background: #f87171;
}

[data-theme="dark"] .history-song .live-badge .live-anim {
  display: none;
}

.radio-player__recent-song {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--color-surface-variant);
}

.radio-player__song-title {
  font-weight: 500;
  color: var(--color-text);
}

.radio-player__song-artist {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.radio-player__song-time {
  margin-left: auto;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

/* App Download Section in Sidebar */
.sidebar__app-download {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.sidebar__app-download__title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin: 0 0 var(--space-md) 0;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.sidebar__app-download__buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.sidebar__app-download__button {
  display: block;
  width: 100%;
}

.sidebar__app-download__button img {
  width: 100%;
  height: auto;
  max-height: 40px;
  object-fit: contain;
}

/* Related Section */
.related-section {
  margin-bottom: var(--space-xl);
}

.related-section__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin: 0 0 var(--space-lg) 0;
}

.related-section__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-md);
  width: 100%;
  padding: 5px;
}

/* Responsive: Related sections grid */
@media (max-width: 768px) {
  .related-section__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
  }

  /* Mobile spacing: remove gap between player and related radios,
     and hide the related-radios heading. */
  .radio-player {
    margin-bottom: 0;
  }

  .related-section__title {
    display: none;
  }
}

/* Radio Info Section */
.radio-info {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: 0;
}

[data-theme="dark"] .radio-info {
  background: var(--color-surface);
}

.radio-info__header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.radio-info__name {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0;
  color: var(--color-text);
  flex: 0 1 auto;
}

.radio-info__rating {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
  margin-left: auto;
}

.radio-info__stars {
  display: flex;
  gap: 2px;
  align-items: center;
}

.radio-info__star {
  width: 20px;
  height: 20px;
  display: block;
}

.radio-info__slogan {
  color: var(--color-text);
  margin: 0 0 var(--space-md) 0;
  font-size: 0.9375rem;
}

.radio-info__description {
  color: var(--color-text);
  margin: 0 0 var(--space-md) 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.radio-info__description p {
  margin: 0 0 var(--space-sm) 0;
}

.radio-info__description ul,
.radio-info__description ol {
  margin: 0 0 var(--space-sm) 1.25rem;
  padding: 0;
}

.radio-info__description li {
  margin: 0 0 4px 0;
}

.radio-info__description > :last-child {
  margin-bottom: 0;
}

.radio-info__tags {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.radio-info__tag {
  padding: 6px 14px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 0.875rem;
  color: #666;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.radio-info__tag:hover {
  background: #eeeeee;
  border-color: #ccc;
  transform: scale(1.03);
}

.radio-info__social {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.radio-info__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  transition: border-color var(--transition-fast);
}

.radio-info__social-link:hover {
  border-color: #ccc;
  transform: scale(1.04);
}

.radio-info__social-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.social-button {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-button:not(.no-padding) {
  padding: 4px;
  width: 40px;
  height: 40px;
}

.social-button > * {
  width: 40px;
  height: 40px;
}

.social-button.no-padding > * {
  width: 48px;
  height: 48px;
}

.radio-info__social-link {
  text-decoration: none;
  color: white;
}

/* City Frequencies */
.radio-info__frequencies {
  margin-bottom: var(--space-lg);
}

.radio-info__frequencies-title {
  font-size: 1.125rem;
  font-weight: bold;
  margin: 0 0 var(--space-md) 0;
  color: var(--color-text);
}

.radio-info__frequencies-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.radio-info__frequency-item {
  display: flex;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.9375rem;
}

.radio-info__frequency-item:last-child {
  border-bottom: none;
}

.radio-info__frequency-city {
  color: var(--color-text);
}

.radio-info__frequency-value {
  margin-left: 6px;
  color: var(--color-text-secondary);
}

/* Programming Schedule */
.radio-info__schedule-title {
  font-size: 1.125rem;
  font-weight: bold;
  margin: 0 0 var(--space-md) 0;
  color: var(--color-text);
}

.radio-info__schedule-tabs {
  display: flex;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 4px;
  margin-bottom: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.radio-info__schedule-tab {
  flex: 1;
  flex-shrink: 0;
  min-width: 56px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--color-text);
  font-size: 0.875rem;
  transition: background-color var(--transition-fast), color var(--transition-fast);
  position: relative;
  text-align: center;
}

.radio-info__schedule-tab:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 60%;
  background: #e0e0e0;
}

.radio-info__schedule-tab:hover {
  background: #f5f5f5;
  transform: scale(1.03);
}

.radio-info__schedule-tab--active {
  background: #e0e0e0;
  color: var(--color-text);
  font-weight: 500;
}

.radio-info__schedule-content {
  position: relative;
}

.radio-info__schedule-day {
  display: none;
}

.radio-info__schedule-day--active {
  display: block;
}

.radio-info__schedule-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.radio-info__schedule-header {
  background: #f0f0f0;
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: bold;
  color: var(--color-text);
  font-size: 0.9375rem;
  border-bottom: 1px solid #e0e0e0;
}

.radio-info__schedule-header:not(:last-child) {
  border-right: 1px solid #e0e0e0;
}

.radio-info__schedule-item {
  border-bottom: 1px solid #e0e0e0;
}

.radio-info__schedule-item:last-child {
  border-bottom: none;
}

.radio-info__schedule-time {
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text);
  font-size: 0.9375rem;
  vertical-align: top;
  width: 140px;
  border-right: 1px solid #e0e0e0;
}

.radio-info__schedule-name {
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text);
  font-size: 0.9375rem;
  vertical-align: top;
}

.radio-info__schedule-empty {
  color: var(--color-text-secondary);
  font-style: italic;
  padding: var(--space-lg) 0;
  text-align: center;
}

/* Schedule: Dark Theme */
[data-theme="dark"] .radio-info__schedule-tabs {
  background: #1f2937;
  border-color: #334155;
}

[data-theme="dark"] .radio-info__schedule-tab:not(:last-child)::after {
  background: #334155;
}

[data-theme="dark"] .radio-info__schedule-tab:hover {
  background: #334155;
}

[data-theme="dark"] .radio-info__schedule-tab--active {
  background: #334155;
}

[data-theme="dark"] .radio-info__schedule-table {
  background: #1f2937;
  border-color: #334155;
}

[data-theme="dark"] .radio-info__schedule-header {
  background: #111827;
  border-color: #334155;
}

[data-theme="dark"] .radio-info__schedule-header:not(:last-child) {
  border-right-color: #334155;
}

[data-theme="dark"] .radio-info__schedule-item {
  border-color: #334155;
}

[data-theme="dark"] .radio-info__schedule-time {
  border-color: #334155;
}

/* Top Songs Section */
.radio-songs {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.radio-songs__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.radio-songs__title {
  font-size: 1.5rem;
  margin: 0;
  color: var(--color-text);
}

.radio-songs__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.radio-songs__tab {
  padding: var(--space-xs) var(--space-md);
  background: var(--color-surface-variant);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.radio-songs__tab:hover {
  background: var(--color-border);
  color: var(--color-text);
  transform: scale(1.03);
}

.radio-songs__tab--active {
  background: var(--color-primary);
  color: white;
}

.radio-songs__content {
  position: relative;
}

.radio-songs__list {
  display: none;
}

.radio-songs__list--active {
  display: block;
}

.radio-songs__ranking {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: song-rank;
}

.radio-songs__item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  counter-increment: song-rank;
}

.radio-songs__rank {
  min-width: 30px;
  font-weight: bold;
  color: var(--color-text-secondary);
  font-size: 1.25rem;
}

.radio-songs__artwork {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.radio-songs__details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.radio-songs__title-text {
  font-weight: 500;
  color: var(--color-text);
}

.radio-songs__artist {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

/* Contacts Section */
.radio-contacts {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  padding-top: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.radio-contacts__title {
  font-size: 1.5rem;
  margin: 0 0 var(--space-sm) 0;
  color: var(--color-text);
}

.radio-contacts__subtitle {
  font-size: 1.1rem;
  margin: var(--space-md) 0 var(--space-sm) 0;
  color: var(--color-text);
}

.radio-contacts__list {
  margin: 0;
  padding: 0;
}

.radio-contacts__item {
  display: flex;
  gap: var(--space-sm);
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
}

.radio-contacts__item:last-child {
  border-bottom: none;
}

.radio-contacts__label {
  min-width: 100px;
  font-weight: 500;
  color: var(--color-text);
  margin: 0;
}

.radio-contacts__value {
  color: var(--color-text-secondary);
  margin: 0;
}

.radio-contacts__value a {
  color: var(--color-primary);
  text-decoration: none;
}

.radio-contacts__value a:hover {
  text-decoration: underline;
}

.radio-contacts__social {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
}

.radio-contacts__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  color: white;
  transition: border-color var(--transition-fast);
}

.radio-contacts__social-link:hover {
  border-color: #ccc;
  transform: scale(1.04);
}

.radio-contacts__social-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.radio-contacts__update-wrapper {
  margin: var(--space-sm) 0;
}

.radio-contacts__update {
  display: inline-block;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.875rem;
}

.radio-contacts__update:hover {
  text-decoration: underline;
}

.radio-contacts__share {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.radio-contacts__share-btn {
  border: none;
  color: #fff;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  cursor: pointer;
  font-weight: 500;
}

.radio-contacts__share-btn:hover {
  opacity: 0.9;
}

.radio-contacts__share-btn--facebook {
  background-color: #4267b2;
}

.radio-contacts__share-btn--twitter {
  background-color: #1da1f2;
}

/* Mobile: Player layout matching image */
@media (max-width: 1024px) {
  .radio-player {
    padding: var(--space-md);
    background: #fff;
  }

  .radio-player__main {
    gap: var(--space-md);
    align-items: flex-start;
  }

  .radio-player__logo {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
  }

  .radio-player__content {
    flex: 1;
    min-width: 0;
    height: 120px;
  }

  .radio-player__frequency {
    font-size: 0.875rem;
  }

  .radio-player__volume-row {
    display: none;
  }

  .radio-player__play-container {
    align-self: flex-start;
  }

  .radio-player__play-button {
    width: 64px;
    height: 64px;
    background: var(--color-play-button);
  }

  .radio-player__play-button svg {
    width: 32px;
    height: 32px;
    margin-left: 3px;
  }
}

@keyframes mobile-player-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 768px) {
  .radio-player {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 5px;
  }

  [data-theme="dark"] .radio-player {
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .radio-player__main {
    background: #2979FF;
    border-radius: 16px;
    padding: var(--space-md);
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: 0;
  }

  .radio-player__content {
    display: flex;
    flex: 1;
    min-width: 0;
    height: auto;
    justify-content: center;
  }

  .radio-player__name-wrapper {
    overflow: hidden;
    width: 100%;
  }

  .radio-player__name {
    color: #fff;
    font-size: var(--font-size-lg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .radio-player__name.marquee-active {
    display: inline-block;
    overflow: visible;
    text-overflow: unset;
    padding-right: 3em;
    animation: mobile-player-marquee 14s linear infinite;
  }

  .radio-player__name.marquee-active::after {
    content: attr(data-text);
    margin-left: 3em;
  }

  [data-theme="dark"] .radio-player__name {
    color: #fff;
  }

  .radio-player__frequency {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .radio-player__frequency.marquee-active {
    display: inline-block;
    overflow: visible;
    text-overflow: unset;
    padding-right: 3em;
    animation: mobile-player-marquee 14s linear infinite;
  }

  .radio-player__frequency.marquee-active::after {
    content: attr(data-text);
    margin-left: 3em;
  }

  .radio-player__volume-row {
    display: none;
  }

  .radio-player__genres {
    display: none;
  }

  .radio-player__logo {
    width: 100px;
    height: 100px;
    border-radius: 12px;
  }

  .radio-player__playing-overlay {
    border-radius: 12px;
  }

  .radio-player__favorite-overlay {
    width: 48px;
    height: 48px;
    top: -18px;
    right: -18px;
  }

  .radio-player__play-container {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: center;
    gap: 0;
  }

  .radio-player__rating-combo {
    display: none;
  }

  .radio-player__play-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fff;
    color: var(--color-play-button);
    border: 3px solid var(--color-play-button);
    box-shadow: 0 0 18px 4px rgba(76, 175, 80, 0.45);
  }

  .radio-player__play-button:hover {
    background: #fff;
    transform: scale(1.06);
  }

  .radio-player__play-button--playing {
    background: #fff;
    color: var(--color-play-button-playing);
    border-color: var(--color-play-button-playing);
    box-shadow: 0 0 18px 4px rgba(229, 57, 53, 0.45);
  }

  .radio-player__play-button--playing:hover {
    background: #fff;
  }

  .radio-player__play-button svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
    margin-left: 0;
  }

  .radio-player__play-button--connecting::after {
    border-color: rgba(76, 175, 80, 0.35);
    border-top-color: var(--color-play-button);
  }

  .radio-info__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .radio-songs__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .sidebar__app-download {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
  }
}
