@import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap);
/* =====================================================
   DESIGN TOKENS — CSS Custom Properties
   ===================================================== */
:root {
  /* Dark theme (default) */
  --bg-primary: #0a0a0a;
  --bg-secondary: #121212;
  --surface: #1a1a1a;
  --surface-elevated: #242424;
  --surface-hover: #2e2e2e;
  --accent: #1DB954;
  --accent-hover: #1ed760;
  --accent-dim: rgba(29, 185, 84, 0.15);
  --accent-dim-hover: rgba(29, 185, 84, 0.25);
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #535353;
  --border: #282828;
  --border-subtle: #1e1e1e;
  --error: #e74c3c;
  --error-dim: rgba(231, 76, 60, 0.15);
  --success: #27ae60;
  --success-dim: rgba(39, 174, 96, 0.15);
  --warning: #f39c12;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.4);
  --shadow: 0 2px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 16px;
  --font-size-lg: 20px;
  --font-size-xl: 24px;
  --font-size-2xl: 32px;

  /* Layout */
  --sidebar-width: 240px;
  --player-height: 70px;
  --bottom-nav-height: 60px;
  --header-height: 56px;

  /* iOS safe area (notch, home indicator) */
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
}

/* Light theme override */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f7f7f7;
  --surface: #efefef;
  --surface-elevated: #e8e8e8;
  --surface-hover: #e0e0e0;
  --accent: #1aa34a;
  --accent-hover: #1DB954;
  --accent-dim: rgba(26, 163, 74, 0.12);
  --accent-dim-hover: rgba(26, 163, 74, 0.2);
  --text-primary: #121212;
  --text-secondary: #555555;
  --text-muted: #999999;
  --border: #e0e0e0;
  --border-subtle: #f0f0f0;
  --error-dim: rgba(231, 76, 60, 0.1);
  --success-dim: rgba(39, 174, 96, 0.1);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow: 0 2px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

/* Follow system light preference when no explicit theme is set */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f7;
    --surface: #efefef;
    --surface-elevated: #e8e8e8;
    --surface-hover: #e0e0e0;
    --accent: #1aa34a;
    --accent-hover: #1DB954;
    --accent-dim: rgba(26, 163, 74, 0.12);
    --accent-dim-hover: rgba(26, 163, 74, 0.2);
    --text-primary: #121212;
    --text-secondary: #555555;
    --text-muted: #999999;
    --border: #e0e0e0;
    --border-subtle: #f0f0f0;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
    --shadow: 0 2px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  }
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Prevent overscroll bounce on iOS when not needed */
  overscroll-behavior-y: none;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-family: var(--font-family);
  background-color: #0a0a0a;
  background-color: var(--bg-primary);
  color: #ffffff;
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
  /* Safe area padding so content isn't under notch/home indicator */
  padding-left: env(safe-area-inset-left, 0px);
  padding-left: var(--safe-area-inset-left);
  padding-right: env(safe-area-inset-right, 0px);
  padding-right: var(--safe-area-inset-right);
}

a {
  color: #1DB954;
  color: var(--accent);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a:hover {
  color: #1ed760;
  color: var(--accent-hover);
  text-decoration: underline;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-family: var(--font-family);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

input, select, textarea {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-family: var(--font-family);
  font-size: 16px; /* Prevent iOS zoom on focus */
}

/* =====================================================
   SELECTION & SCROLLBAR
   ===================================================== */
::selection {
  background-color: #1DB954;
  background-color: var(--accent);
  color: #ffffff;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #282828;
  background: var(--border);
  border-radius: 9999px;
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: #535353;
  background: var(--text-muted);
}

/* =====================================================
   FOCUS
   ===================================================== */
*:focus-visible {
  outline: 2px solid #1DB954;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
  border-radius: var(--radius-sm);
}

*:focus:not(:focus-visible) {
  outline: none;
}

/* =====================================================
   UTILITIES
   ===================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.no-transition {
  transition: none !important;
}

/* =====================================================
   KEYFRAME ANIMATIONS
   ===================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

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

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes skeletonShimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

@keyframes equalizerBar {
  0%, 100% { transform: scaleY(0.3); }
  50%       { transform: scaleY(1); }
}

/* Animation utilities */
.animate-fade-in  { animation: fadeIn 0.2s ease forwards; }
.animate-spin     { animation: spin 0.8s linear infinite; }
.animate-pulse    { animation: pulse 1.5s ease-in-out infinite; }

/* =====================================================
   REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =====================================================
   RADIO APP — Modern UI Stylesheet
   Theme: Dark/Light adaptive, Green accent
   ===================================================== */

/* =====================================================
   1. APP SHELL LAYOUT
   ===================================================== */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* =====================================================
   2. NOW PLAYING BAR (Persistent bottom player)
   ===================================================== */
.now-playing-bar {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-area-inset-bottom));
  left: 0;
  right: 0;
  height: var(--player-height);
  padding-top: 0;
  padding-bottom: 0;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: none;
  display: flex;
  align-items: center;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  gap: var(--space-4);
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
}

/* Desktop / tablet: wrapper is transparent so controls stay in one flex row */
.player-bar-actions {
  display: contents;
}

/* Station info (left side) */
.player-station-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1 1;
  min-width: 0;
}

.player-artwork {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.player-artwork.is-idle {
  border-style: dashed;
  border-color: var(--border-subtle);
  background-color: var(--bg-primary);
}

.player-artwork-icon {
  font-size: 20px;
}

/* Idle state: no station selected — placeholder artwork */
.player-artwork-idle {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface);
  color: var(--text-muted);
}

.player-artwork-idle-icon {
  font-size: 18px;
  opacity: 0.6;
}

/* Playing state — avatar + eq overlay stacked */
.player-artwork-playing {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.player-artwork-eq-overlay {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Equalizer visualizer in artwork when playing */
.player-artwork.is-playing {
  background-color: var(--accent-dim);
  border-color: var(--accent);
}

.equalizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
}

.equalizer-bar {
  width: 3px;
  background-color: var(--accent);
  border-radius: 2px;
  transform-origin: bottom;
}

.equalizer-bar:nth-child(1) { animation: equalizerBar 0.8s ease-in-out infinite; animation-delay: 0.0s; }
.equalizer-bar:nth-child(2) { animation: equalizerBar 0.8s ease-in-out infinite; animation-delay: 0.15s; }
.equalizer-bar:nth-child(3) { animation: equalizerBar 0.8s ease-in-out infinite; animation-delay: 0.3s; }
.equalizer-bar:nth-child(4) { animation: equalizerBar 0.8s ease-in-out infinite; animation-delay: 0.1s; }
.equalizer-bar:nth-child(5) { animation: equalizerBar 0.8s ease-in-out infinite; animation-delay: 0.25s; }

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

.player-station-header-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: space-between;
}

.player-station-name {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.player-station-meta {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: 2px;
  flex-wrap: wrap;
}

/* Idle state: no station selected — clear, readable prompt */
.player-idle-state {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.player-idle-text {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-secondary);
}

.player-idle-hint {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.player-pill {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background-color: var(--surface);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

@keyframes liveFlash {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.5);
  }
  50% {
    opacity: 0.85;
    box-shadow: 0 0 8px 2px rgba(231, 76, 60, 0.6);
  }
}

.player-pill-live {
  background-color: var(--error-dim);
  color: var(--error);
  border-color: var(--error);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  animation: liveFlash 1.5s ease-in-out infinite;
}

.player-pill-muted {
  opacity: 0.8;
}

.player-pill-buffering {
  background: color-mix(in srgb, #3b82f6 15%, transparent);
  color: #3b82f6;
  border-color: color-mix(in srgb, #3b82f6 40%, transparent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.player-buffering-dots {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.player-buffering-dots span {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #3b82f6;
  animation: bufferBounce 1s ease-in-out infinite;
}
.player-buffering-dots span:nth-child(2) { animation-delay: 0.15s; }
.player-buffering-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bufferBounce {
  0%, 80%, 100% { transform: scaleY(1); opacity: 0.5; }
  40%           { transform: scaleY(1.6); opacity: 1; }
}

.player-favorite-btn {
  font-size: 18px;
}

.player-favorite-btn.is-active {
  color: var(--accent);
}

/* Player controls (center) */
.player-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.player-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
  font-size: 16px;
}

.player-btn:hover {
  color: var(--text-primary);
  background-color: var(--surface-hover);
}

.player-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.player-btn-play {
  width: 42px;
  height: 42px;
  background-color: var(--accent);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 18px;
}

.player-btn-play:hover:not(:disabled) {
  background-color: var(--accent-hover);
  color: #fff;
  transform: scale(1.04);
}

/* Volume control (right side) */
.player-volume {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.volume-icon {
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  -webkit-user-select: none;
          user-select: none;
}

/* =====================================================
   IDENTIFY SONG BUTTON + RESULT CARD
   ===================================================== */
.identify-btn {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.identify-btn:hover:not(:disabled) {
  color: var(--accent);
}

.identify-btn.is-loading {
  color: var(--accent);
  cursor: wait;
}

@keyframes identifySpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.identify-spin {
  animation: identifySpin 1s linear infinite;
}

/* =====================================================
   IDENTIFY PANEL — right drawer (desktop) / bottom sheet (mobile)
   ===================================================== */

/* Backdrop dims everything behind the panel */
.ip-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeIn 0.18s ease forwards;
}

/* Panel base — mobile: bottom sheet sliding up */
.identify-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88vh;
  z-index: 401;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: slideUpPanel 0.28s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

@keyframes slideUpPanel {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Desktop: right-side drawer sliding in from the right */
@media (min-width: 768px) {
  .identify-panel {
    left: auto;
    top: 0;
    bottom: 0;
    right: 0;
    width: 380px;
    max-height: 100vh;
    border-top: none;
    border-left: 1px solid var(--border);
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.25);
    animation: slideInDrawer 0.28s cubic-bezier(0.32, 0.72, 0, 1) forwards;
  }
  @keyframes slideInDrawer {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
  }
}

/* Header row */
.ip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 1;
}

.ip-header-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-primary);
}

.ip-shazam-icon {
  color: #0466ff;
  flex-shrink: 0;
}

.ip-close {
  background: none;
  border: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.ip-close:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

/* "Listening to" context line */
.ip-context {
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 6px;
  align-items: center;
}
.ip-context-label { flex-shrink: 0; }
.ip-context-station {
  font-weight: 600;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Loading state ---- */
.ip-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 56px var(--space-6);
  text-align: center;
}
.ip-loading-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(4, 102, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0466ff;
  animation: identifySpin 1.4s linear infinite;
}
.ip-loading-text {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.ip-loading-sub {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin: 0;
}

/* ---- Not found state ---- */
.ip-notfound {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: 56px var(--space-6);
  text-align: center;
  color: var(--text-muted);
}
.ip-notfound-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.ip-notfound-sub {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin: 0;
  max-width: 260px;
  line-height: 1.5;
}

/* ---- Found result ---- */
.ip-result { padding-bottom: var(--space-6); }

/* Hero / album art */
.ip-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 320px;
  overflow: hidden;
  background: var(--surface);
}
.ip-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--ip-bg);
  background-size: cover;
  background-position: center;
  filter: blur(24px) brightness(0.55);
  transform: scale(1.12);
}
.ip-coverart {
  position: relative;
  display: block;
  margin: 0 auto;
  width: 70%;
  max-width: 220px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  top: 50%;
  transform: translateY(-50%);
}

/* Track title + artist */
.ip-track {
  padding: var(--space-5) var(--space-5) var(--space-3);
}
.ip-track-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin: 0 0 var(--space-2);
}
.ip-track-artist {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-base);
  color: var(--text-secondary);
}
.ip-artist-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.ip-artist-name { font-weight: 600; }
.ip-verified {
  display: flex;
  align-items: center;
  color: var(--accent);
  flex-shrink: 0;
}

/* Metadata grid */
.ip-meta-grid {
  margin: 0 var(--space-5) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.ip-meta-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  font-size: var(--font-size-sm);
}
.ip-meta-row:last-child { border-bottom: none; }
.ip-meta-label {
  color: var(--text-muted);
  font-weight: 500;
  min-width: 68px;
  flex-shrink: 0;
}
.ip-meta-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* Artist social links section */
.ip-artist-links {
  margin: 0 var(--space-5) var(--space-4);
  padding: var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.ip-artist-links-title {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 var(--space-3);
}

/* Skeleton shimmer pills while loading */
.ip-links-skeleton {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.ip-skeleton-pill {
  display: inline-block;
  height: 30px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-hover) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.ip-skeleton-pill:nth-child(1) { width: 90px; }
.ip-skeleton-pill:nth-child(2) { width: 78px; }
.ip-skeleton-pill:nth-child(3) { width: 68px; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Populated links row */
.ip-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.ip-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  background: color-mix(in srgb, var(--social-color) 14%, transparent);
  color: var(--social-color);
  border: 1px solid color-mix(in srgb, var(--social-color) 35%, transparent);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}
.ip-social-btn:hover {
  background: color-mix(in srgb, var(--social-color) 24%, transparent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--social-color) 25%, transparent);
  transform: translateY(-1px);
  text-decoration: none;
}

/* X/Twitter is black — use text-primary so it's readable in both themes */
.ip-social-btn[title="X"] {
  --social-color: var(--text-primary);
}

.ip-links-empty {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin: 0;
}

/* Action buttons */
.ip-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0 var(--space-5);
}
.ip-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: 13px var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.1s ease;
  letter-spacing: 0.01em;
}
.ip-action-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  text-decoration: none;
}
.ip-btn-shazam {
  background: #0466ff;
  color: #fff;
}
.ip-btn-apple {
  background: #fc3c44;
  color: #fff;
}

.ip-btn-retry {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-family: inherit;
}
.ip-btn-retry:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.ip-btn-lyrics {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent);
  cursor: pointer;
  font-family: inherit;
}
.ip-btn-lyrics:hover {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

/* =====================================================
   LYRICS PANEL
   ===================================================== */

/* Lyrics panel — fixed height with only the lyrics area scrolling */
.lyrics-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden; /* panel itself must NOT scroll — only .lp-lyrics-wrap scrolls */
}
.lyrics-panel .ip-header-title { color: var(--text-primary); }
.lyrics-panel .ip-header-title svg { color: var(--accent); }

.lp-song-title {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
}
.lp-song-artist {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* Loading ring reuse — just use accent color for mic */
.lp-loading-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: identifySpin 1.4s linear infinite;
}

/* Lyrics scroll area — flex: 1 + min-height: 0 is the key combo for scrollable flex children */
.lp-lyrics-wrap {
  flex: 1 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-5) var(--space-5) var(--space-6);
}

/* Lyrics text */
.lp-lyrics-text {
  font-size: var(--font-size-sm);
  line-height: 1.9;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.lp-lyric-line {
  margin: 0;
  padding: 0;
  line-height: 1.9;
}

.lp-lyric-gap {
  height: 1.2em; /* blank line between verses */
}

/* Attribution footer */
.lp-attribution {
  margin-top: var(--space-5);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: center;
}
.lp-attribution a {
  color: var(--accent);
  text-decoration: none;
}
.lp-attribution a:hover { text-decoration: underline; }

/* Retry button in not-found state */
.ip-notfound .ip-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: 10px 22px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.ip-notfound .ip-retry-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.volume-icon-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.volume-icon-btn:hover {
  color: var(--text-primary);
  background-color: var(--surface-hover);
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--border);
  outline: none;
  cursor: pointer;
}

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

.volume-slider::-webkit-slider-thumb:hover {
  background: var(--accent);
  transform: scale(1.2);
}

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

.player-duration {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.player-hints {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: var(--space-4);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: right;
}

.player-hints span {
  white-space: nowrap;
}

/* Sidebar toggle button (drawer handle) */
.sidebar-toggle-btn {
  position: fixed;
  top: calc(var(--safe-area-inset-top) + var(--space-2));
  left: calc(12px + var(--safe-area-inset-left));
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-secondary);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  z-index: 210;
  box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sidebar-toggle-btn:hover {
  background-color: var(--surface-hover);
  color: var(--text-primary);
}

/* =====================================================
   3. APP SIDEBAR (Desktop)
   ===================================================== */
.app-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: calc(var(--player-height) + var(--safe-area-inset-bottom));
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--space-4) 0 var(--space-2);
  z-index: 100;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.45);
  z-index: 90;
  display: none;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-5) var(--space-3);
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: radial-gradient(circle at 0 0, #34d399, #059669);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-logo-sub {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.sidebar-section-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-5) var(--space-2);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--space-3);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  min-height: 44px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-secondary);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.sidebar-nav-item:hover {
  color: var(--text-primary);
  background-color: var(--surface-hover);
}

.sidebar-nav-item.active {
  color: var(--text-primary);
  background-color: var(--surface);
  font-weight: 600;
}

.sidebar-nav-item.active .sidebar-nav-icon {
  color: var(--accent);
}

.sidebar-nav-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.sidebar-nav-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-nav-hint {
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.2;
}

.sidebar-nav-item.disabled,
.bottom-nav-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sidebar-nav-item.disabled:hover {
  color: var(--text-secondary);
  background-color: transparent;
}

.sidebar-theme-toggle {
  margin-top: auto;
}

/* =====================================================
   TABLET TOP HEADER
   ===================================================== */
.app-header {
  display: none; /* shown via media query on tablet */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 var(--space-5);
  gap: var(--space-4);
  z-index: 200;
  box-shadow: var(--shadow-sm);
}

.app-header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.app-header-logo-icon {
  width: 32px !important;
  height: 32px !important;
  font-size: 13px !important;
}

.app-header-logo-text {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  white-space: nowrap;
}

.app-header-logo-sub {
  color: var(--text-muted);
  font-weight: 400;
}

.app-header-nav {
  flex: 1 1;
  display: flex;
  align-items: center;
  padding-left: var(--space-6);
  gap: var(--space-1);
}

.app-header-nav-item {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
  white-space: nowrap;
}

.app-header-nav-item:hover {
  color: var(--text-primary);
  background-color: var(--surface-hover);
}

.app-header-nav-item.active {
  color: var(--text-primary);
  background-color: var(--surface);
  font-weight: 600;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.app-header-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.app-header-action-btn:hover {
  color: var(--text-primary);
  background-color: var(--surface-hover);
}

.sidebar-footer {
  padding: var(--space-4) var(--space-3) var(--space-2);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  min-height: 44px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: color var(--transition-fast);
}

.sidebar-footer-link:hover {
  color: var(--text-secondary);
}

/* Theme toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  min-height: 44px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-secondary);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
  border: none;
  background: none;
  width: calc(100% - var(--space-6));
  margin: 0 var(--space-3);
  text-align: left;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.theme-toggle:hover {
  color: var(--text-primary);
  background-color: var(--surface-hover);
}

.theme-toggle-icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

/* =====================================================
   4. BOTTOM NAVIGATION (Mobile only)
   ===================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + var(--safe-area-inset-bottom));
  padding-bottom: var(--safe-area-inset-bottom);
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 200;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
  padding-top: 0;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: var(--space-2) var(--space-4);
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  transition: color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.bottom-nav-item.active {
  color: var(--accent);
}

.bottom-nav-item:hover {
  color: var(--text-secondary);
}

.bottom-nav-item.active:hover {
  color: var(--accent-hover);
}

.bottom-nav-icon {
  font-size: 20px;
  line-height: 1;
}

/* =====================================================
   5. MAIN CONTENT AREA
   ===================================================== */
.main-content {
  flex: 1 1;
  padding-top: calc(var(--safe-area-inset-top) + var(--space-6));
  padding-bottom: calc(var(--bottom-nav-height) + var(--player-height) + var(--safe-area-inset-bottom) + var(--space-6));
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
}

/* =====================================================
   6. PAGE HEADERS
   ===================================================== */
.page-header {
  margin-bottom: var(--space-6);
  animation: fadeIn 0.2s ease forwards;
}

.page-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
}

/* =====================================================
   7. SEARCH BAR
   ===================================================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.search-input-wrapper {
  position: relative;
  flex: 1 1;
}

.search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
  line-height: 1;
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) 36px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  outline: none;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent);
  background-color: var(--surface-elevated);
}

.search-clear-btn {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--text-muted);
  color: var(--bg-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  transition: background-color var(--transition-fast);
  line-height: 1;
}

.search-clear-btn:hover {
  background-color: var(--text-secondary);
}

.toggle-view-btn {
  padding: var(--space-2) var(--space-4);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}

.toggle-view-btn:hover {
  color: var(--text-primary);
  background-color: var(--surface-elevated);
  border-color: var(--text-muted);
}

/* =====================================================
   8. COUNTRY CARDS
   ===================================================== */
.countries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  grid-gap: var(--space-3);
  gap: var(--space-3);
  animation: fadeIn 0.2s ease forwards;
}

.country-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-user-select: none;
          user-select: none;
}

.country-card:hover {
  background-color: var(--surface-elevated);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.country-card:active {
  transform: translateY(0);
}

.country-flag {
  font-size: 36px;
  line-height: 1;
}

.country-name {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.country-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

.country-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  background-color: var(--accent-dim);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

/* =====================================================
   9. STATION LIST & CARDS
   ===================================================== */
.stations-page {
  animation: fadeIn 0.2s ease forwards;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  margin-bottom: var(--space-4);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.back-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.stations-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 500;
  margin-left: var(--space-3);
  vertical-align: middle;
}

.stations-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.station-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
  -webkit-user-select: none;
          user-select: none;
  position: relative;
}

.station-card:hover {
  background-color: var(--surface-elevated);
  border-color: var(--surface-hover);
}

.station-card.is-playing {
  border-color: var(--accent);
  background-color: var(--accent-dim);
}

/* StationAvatar component */
.station-avatar {
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.station-avatar--initials {
  border: none;
}

.station-avatar--playing {
  border-color: var(--accent);
}

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

.station-card-name {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-card.is-playing .station-card-name {
  color: var(--accent);
}

.station-card-tags {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.station-card-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.station-favorite-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: var(--radius-full);
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

@media (hover: none) {
  .station-favorite-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 16px;
  }
}

.station-favorite-btn:hover {
  background-color: var(--surface-hover);
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}

.station-favorite-btn.is-active {
  background-color: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.station-popularity-badge {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  white-space: nowrap;
}

.station-play-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: opacity var(--transition-fast), transform var(--transition-fast), background-color var(--transition-fast);
}

.station-card:hover .station-play-btn {
  opacity: 1;
}

.station-play-btn:hover {
  background-color: var(--accent-hover);
  transform: scale(1.05);
}

/* Always show and full 44px tap target on touch */
@media (hover: none) {
  .station-play-btn {
    opacity: 1;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 16px;
  }
}

/* Playing indicator (mini equalizer) */
.station-playing-indicator {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  padding: 0 2px;
}

.station-playing-indicator span {
  width: 3px;
  background-color: var(--accent);
  border-radius: 2px;
  transform-origin: bottom;
}

.station-playing-indicator span:nth-child(1) { animation: equalizerBar 0.7s ease-in-out infinite; animation-delay: 0.0s; height: 100%; }
.station-playing-indicator span:nth-child(2) { animation: equalizerBar 0.7s ease-in-out infinite; animation-delay: 0.2s; height: 100%; }
.station-playing-indicator span:nth-child(3) { animation: equalizerBar 0.7s ease-in-out infinite; animation-delay: 0.1s; height: 100%; }

/* =====================================================
   10. LOADING STATES & SKELETONS
   ===================================================== */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-8);
  gap: var(--space-4);
  color: var(--text-secondary);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-text {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
}

.loading-hint {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: center;
}

/* Skeleton cards */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  grid-gap: var(--space-3);
  gap: var(--space-3);
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-elevated) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.skeleton-row {
  height: 68px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-elevated) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

/* Empty / No results state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-12) var(--space-8);
  gap: var(--space-3);
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state-desc {
  font-size: var(--font-size-base);
  color: var(--text-muted);
  max-width: 300px;
}

/* Sync status banner */
.sync-status-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  color: var(--accent);
  margin-bottom: var(--space-4);
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background-color: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.refresh-btn:hover {
  background-color: var(--accent-hover);
}

.refresh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =====================================================
   11. MODALS
   ===================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 500;
  padding: var(--space-4);
  animation: fadeIn 0.15s ease forwards;
}

@media (min-width: 480px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal-content {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: fadeInScale 0.15s ease forwards;
  box-shadow: var(--shadow-lg);
  padding-bottom: var(--safe-area-inset-bottom);
}

@media (min-width: 480px) {
  .modal-content {
    border-radius: var(--radius-xl);
    max-height: 80vh;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background-color: var(--surface);
  z-index: 1;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--text-primary);
}

.modal-icon {
  font-size: 20px;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--surface-hover);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
  background-color: var(--border);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-6);
}

/* Success modal header */
.success-modal .modal-header {
  border-bottom-color: var(--success);
}

.success-modal .modal-title {
  color: var(--success);
}

/* Error modal header */
.error-modal .modal-header {
  border-bottom-color: var(--error);
}

.error-modal .modal-title {
  color: var(--error);
}

/* Info modal header */
.info-modal .modal-title {
  color: var(--accent);
}

/* =====================================================
   STREAM ERROR MODAL (sem)
   ===================================================== */
.sem-overlay { z-index: 600; }

.sem-modal {
  max-width: 480px;
}

.sem-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.sem-icon-wrap {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  background: color-mix(in srgb, var(--sem-accent, var(--accent)) 14%, transparent);
  color: var(--accent);
  color: var(--sem-accent, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
}

.sem-header-text {
  flex: 1 1;
  min-width: 0;
  padding-top: 2px;
}

.sem-station-name {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin: 0 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sem-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
}

.sem-close {
  flex-shrink: 0;
  margin-top: 2px;
}

.sem-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.sem-message {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

/* Action buttons */
.sem-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.sem-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 11px 20px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.sem-btn:hover { opacity: 0.88; transform: translateY(-1px); }

.sem-btn-primary {
  background: var(--accent);
  color: #fff;
}

.sem-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.sem-btn-ghost:hover { background: var(--surface-hover); }

/* Similar stations */
.sem-similar {
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}

.sem-similar-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0 0 var(--space-3);
}

.sem-similar-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sem-station-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px var(--space-3);
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--transition-fast);
  font-family: inherit;
}
.sem-station-card:hover { background: var(--surface-hover); }

.sem-station-info {
  flex: 1 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sem-station-name-sm {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sem-station-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sem-play-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.sem-station-card:hover .sem-play-icon { opacity: 1; color: var(--accent); }

/* Dynamic content (About/Privacy from CMS) */
.dynamic-content {
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  line-height: 1.7;
}

.dynamic-content h1,
.dynamic-content h2,
.dynamic-content h3 {
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: var(--space-3);
  margin-top: var(--space-6);
}

.dynamic-content h1:first-child,
.dynamic-content h2:first-child,
.dynamic-content h3:first-child {
  margin-top: 0;
}

.dynamic-content p {
  margin-bottom: var(--space-4);
}

.dynamic-content ul,
.dynamic-content ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.dynamic-content li {
  margin-bottom: var(--space-2);
}

.dynamic-content a {
  color: var(--accent);
}

/* =====================================================
   11b. STATIC MODAL CONTENT (About / Privacy)
   ===================================================== */
.static-content {
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  line-height: 1.7;
}

.about-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-4) 0 var(--space-6);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
}

.about-logo-mark {
  width: 52px;
  height: 52px;
  background: radial-gradient(circle at 30% 30%, #34d399, #059669);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  margin-bottom: var(--space-3);
}

.about-tagline {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.about-section {
  margin-bottom: var(--space-6);
}

.about-section h3 {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

.about-section p {
  margin-bottom: var(--space-3);
}

.about-section p:last-child {
  margin-bottom: 0;
}

.about-section a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.policy-effective {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-5);
  font-style: italic;
}

.policy-list {
  padding-left: var(--space-5);
  margin: var(--space-2) 0 var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.policy-list li {
  line-height: 1.6;
}

.about-footer-note {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: center;
}

.about-footer-note p {
  margin: 0;
}

.inline-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-link-btn:hover {
  opacity: 0.8;
}

.modal-icon svg {
  display: block;
  color: var(--text-secondary);
}

/* =====================================================
   12. CONTACT FORM
   ===================================================== */
.contact-intro {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
  line-height: 1.6;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-group label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  outline: none;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
  -webkit-appearance: none;
}

.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 viewBox=%270 0 12 12%27%3E%3Cpath fill=%27%23999%27 d=%27M6 8L1 3h10z%27/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  background-color: var(--surface);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  padding-top: var(--space-2);
}

.btn-cancel {
  padding: var(--space-3) var(--space-5);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.btn-cancel:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.btn-send {
  padding: var(--space-3) var(--space-6);
  background-color: var(--accent);
  border: none;
  border-radius: var(--radius-full);
  color: #fff;
  font-size: var(--font-size-base);
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.btn-send:hover {
  background-color: var(--accent-hover);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.direct-contact {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: center;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

/* =====================================================
   13. FOOTER (inside main-content on desktop)
   ===================================================== */
.app-footer {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.footer-link {
  padding: var(--space-1) var(--space-3);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-secondary);
}

.footer-sep {
  color: var(--border);
  font-size: var(--font-size-xs);
}

.footer-copyright {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.footer-tagline {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  opacity: 0.7;
}

/* =====================================================
   14. RESPONSIVE — SHARED TABLET + DESKTOP (>= 768px)
   ===================================================== */
@media (min-width: 768px) {
  /* Hide mobile bottom nav on tablet and desktop */
  .bottom-nav {
    display: none;
  }

  /* Larger country grid */
  .countries-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-4);
  }

  /* Volume slider wider */
  .volume-slider {
    width: 120px;
  }

  /* Modals full-rounded */
  .modal-content {
    border-radius: var(--radius-xl);
  }
}

/* =====================================================
   14b. TABLET HEADER LAYOUT (768px – 1024px)
   ===================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Show top header, hide sidebar */
  .app-header {
    display: flex;
  }

  .app-sidebar {
    display: none !important;
  }

  /* Player sits at very bottom, full width */
  .now-playing-bar {
    left: 0;
    bottom: 0;
    height: calc(var(--player-height) + var(--safe-area-inset-bottom));
    padding-bottom: var(--safe-area-inset-bottom);
  }

  /* Main content below header, above player */
  .main-content {
    margin-left: 0;
    padding-top: calc(var(--header-height) + var(--safe-area-inset-top) + var(--space-6));
    padding-bottom: calc(var(--player-height) + var(--safe-area-inset-bottom) + var(--space-6));
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

/* =====================================================
   14c. DESKTOP COLLAPSED SIDEBAR (>= 1025px)
   ===================================================== */
@media (min-width: 1025px) {
  /* Hide top header */
  .app-header {
    display: none;
  }

  /* Show collapsible sidebar — icons-only by default */
  .app-sidebar {
    display: flex;
    width: 64px;
    overflow: hidden;
    transition: width 0.22s ease;
    z-index: 150;
    top: 0;
    bottom: calc(var(--player-height) + var(--safe-area-inset-bottom));
  }

  /* Expand on hover */
  .app-sidebar:hover {
    width: var(--sidebar-width);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
  }

  /* Hide logo text when collapsed */
  .sidebar-logo-text-group {
    max-width: 160px;
    overflow: hidden;
    white-space: nowrap;
    opacity: 1;
    transition: max-width 0.22s ease, opacity 0.15s ease;
  }

  .app-sidebar:not(:hover) .sidebar-logo-text-group {
    max-width: 0;
    opacity: 0;
  }

  /* Hide section label when collapsed */
  .app-sidebar:not(:hover) .sidebar-section-label {
    opacity: 0;
    max-height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
  }

  .sidebar-section-label {
    transition: opacity 0.15s ease, max-height 0.22s ease;
    max-height: 40px;
  }

  /* Nav labels */
  .sidebar-nav-label {
    max-width: 160px;
    overflow: hidden;
    white-space: nowrap;
    opacity: 1;
    transition: max-width 0.22s ease, opacity 0.15s ease;
  }

  .app-sidebar:not(:hover) .sidebar-nav-label {
    max-width: 0;
    opacity: 0;
  }

  /* Center icons when collapsed */
  .app-sidebar:not(:hover) .sidebar-nav-item,
  .app-sidebar:not(:hover) .sidebar-theme-toggle,
  .app-sidebar:not(:hover) .sidebar-footer-link {
    justify-content: center;
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }

  /* Player at bottom, offset by collapsed sidebar width */
  .now-playing-bar {
    left: 64px;
    bottom: 0;
    height: calc(var(--player-height) + var(--safe-area-inset-bottom));
    padding-bottom: var(--safe-area-inset-bottom);
  }

  /* Main content offset by collapsed sidebar width */
  .main-content {
    margin-left: 64px;
    padding-top: calc(var(--safe-area-inset-top) + var(--space-8));
    padding-bottom: calc(var(--player-height) + var(--safe-area-inset-bottom) + var(--space-8));
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

@media (max-width: 767px) {
  /* Taller bar: station row + controls row; keeps scroll padding in sync */
  :root {
    --player-height: 120px;
  }

  /* Now playing bar full width on mobile, sits above bottom-nav */
  .now-playing-bar {
    left: 0;
    right: 0;
    padding-left: var(--space-3);
    padding-right: var(--space-3);
    flex-wrap: wrap;
    row-gap: var(--space-2);
    height: auto;
    min-height: 0;
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
  }

  .player-station-info {
    flex: 1 1 100%;
  }

  .player-bar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
  }

  /* iOS / Android: 44px min touch targets for primary controls */
  .player-btn,
  .player-btn-play {
    min-width: 44px;
    min-height: 44px;
  }
  .player-btn-play {
    width: 44px;
    height: 44px;
  }

  .volume-icon-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    box-sizing: border-box;
  }

  /* Compact volume — keep mute + slider on small screens */
  .now-playing-bar .volume-slider {
    width: 72px;
  }

  /* Show duration next to play btn on mobile */
  .player-duration {
    display: block;
  }

  /* Drawer behaviour for sidebar on mobile only */
  .app-sidebar {
    display: flex;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform var(--transition-fast);
    top: 0;
    bottom: 0;
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
  }

  .sidebar-toggle-btn {
    display: flex;
  }

  /* Compact country grid on mobile */
  .countries-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-2);
  }

  /* Compact station card on mobile */
  .station-card {
    padding: var(--space-3);
  }

  .station-avatar {
    width: 38px !important;
    height: 38px !important;
  }
}

/* Very small screens - keep 44px touch targets */
@media (max-width: 360px) {
  .countries-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .now-playing-bar {
    gap: var(--space-2);
  }

  .now-playing-bar .volume-slider {
    width: 56px;
  }

  .player-controls {
    gap: var(--space-1);
  }

  .player-btn {
    width: 44px;
    height: 44px;
    font-size: 14px;
  }

  .player-btn-play {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}

/* Large desktops */
@media (min-width: 1280px) {
  .main-content {
    padding-left: var(--space-12);
    padding-right: var(--space-12);
  }

  .countries-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* =====================================================
   HOME PAGE
   ===================================================== */

.home-page {
  padding-bottom: var(--space-12);
}

/* Hero */
.home-hero {
  padding: var(--space-8) 0 var(--space-6);
}

.home-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  text-transform: capitalize;
}

.home-subtitle {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* Search with dropdown */
.home-search-wrapper {
  position: relative;
  margin-bottom: var(--space-5);
}

.home-search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background-color: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 0 var(--space-4);
  height: 52px;
  transition: border-color var(--transition-fast);
}

.home-search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.home-search-bar .search-icon {
  font-size: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.home-search-bar .search-input {
  flex: 1 1;
  background: none;
  border: none;
  outline: none;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  height: 100%;
}

.home-search-bar .search-input::placeholder {
  color: var(--text-muted);
}

/* Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  box-shadow: var(--shadow-lg, 0 8px 32px rgba(0,0,0,0.3));
  z-index: 300;
  max-height: 360px;
  overflow-y: auto;
}

.search-dropdown-loading,
.search-dropdown-empty {
  padding: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: center;
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  border-bottom: 1px solid var(--border);
}

.search-dropdown-item:last-child {
  border-bottom: none;
}

.search-dropdown-item:hover,
.search-dropdown-item:focus {
  background-color: var(--surface-hover);
  outline: none;
}

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

.search-dropdown-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-dropdown-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.search-dropdown-play {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.search-dropdown-item:hover .search-dropdown-play {
  opacity: 1;
}

/* Genre Chips */
.genre-chips-wrapper {
  margin-bottom: var(--space-6);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.genre-chips-wrapper::-webkit-scrollbar {
  display: none;
}

.genre-chips {
  display: flex;
  gap: var(--space-2);
  width: -webkit-max-content;
  width: max-content;
  padding-bottom: 2px;
}

.genre-chip {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background-color: var(--surface);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.genre-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.genre-chip.active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Home sections */
.home-section {
  margin-bottom: var(--space-8);
}

.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.home-section-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.home-section-link {
  font-size: var(--font-size-sm);
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  padding: 0;
  transition: opacity var(--transition-fast);
}

.home-section-link:hover {
  opacity: 0.8;
}

.home-empty-text {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  padding: var(--space-4) 0;
}

.home-inline-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  font-weight: 500;
  text-decoration: underline;
}

/* Responsive station grid (replaces old scroll row) */
.station-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-3);
  overflow-x: clip;   /* prevents horizontal overflow without creating a scroll container */
  overflow-y: visible; /* allows the hover translateY to breathe */
  padding-top: 4px;   /* room for the upward lift on hover */
  margin-top: -4px;   /* compensate so layout doesn't shift */
}

.station-grid .station-mini-card,
.station-grid .station-mini-skeleton {
  flex: 1 1;
  min-width: 0;
  max-width: 130px;
}


/* Station mini-card — compact, no standalone play button */
.station-mini-card {
  background-color: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px var(--space-2) 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
  text-align: center;
  position: relative;
  -webkit-user-select: none;
          user-select: none;
}

.station-mini-card:hover {
  border-color: var(--accent);
  background-color: var(--surface-hover);
  transform: translateY(-2px);
}

.station-mini-card.is-playing {
  border-color: var(--accent);
  background-color: var(--accent-dim);
}

/* Avatar wrapper — holds the overlay */
.station-mini-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

/* Play/pause overlay on hover */
.station-mini-overlay {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.station-mini-card:hover .station-mini-overlay {
  opacity: 1;
}

/* On touch — always show overlay for the currently playing card */
@media (hover: none) {
  .station-mini-card.is-playing .station-mini-overlay {
    opacity: 1;
  }
}

.station-mini-skeleton {
  background-color: var(--surface);
  border-color: var(--surface);
  height: 100px;
  animation: shimmer 1.4s ease-in-out infinite;
}

.station-mini-name {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-primary);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.station-mini-card.is-playing .station-mini-name {
  color: var(--accent);
}

.station-mini-meta {
  font-size: 10px;
  color: var(--text-muted);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.station-mini-favorite {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  border: none;
  background-color: rgba(0, 0, 0, 0.35);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Larger tap target on touch devices */
@media (hover: none) {
  .station-mini-favorite {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
}

.station-mini-favorite:hover {
  background-color: var(--accent-dim);
  color: var(--accent);
  transform: scale(1.05);
}

.station-mini-favorite.is-active {
  background-color: var(--accent-dim);
  color: var(--accent);
}


/* Country mini-grid (home page) */
.country-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  grid-gap: var(--space-2);
  gap: var(--space-2);
}

.country-mini-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
  min-width: 0;
}

.country-mini-card:hover {
  border-color: var(--accent);
  background-color: var(--surface-hover);
}

.country-mini-flag {
  font-size: 20px;
  flex-shrink: 0;
}

.country-mini-name {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1;
}

.country-mini-count {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Responsive tweaks for home page */
@media (max-width: 600px) {
  .home-title {
    font-size: var(--font-size-xl);
  }

  .station-grid .station-mini-card,
  .station-grid .station-mini-skeleton {
    max-width: 110px;
  }

  .country-mini-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}

/* Admin Panel Styles */
.admin-panel {
  display: flex;
  min-height: 100vh;
  background: #f5f5f5;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.admin-sidebar {
  width: 250px;
  background: #2c3e50;
  color: white;
  padding: 20px 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.admin-logo {
  padding: 0 20px 30px;
  border-bottom: 1px solid #34495e;
  margin-bottom: 20px;
}

.admin-logo a {
  color: white;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
}

.admin-nav {
  padding: 0 20px;
}

.admin-nav button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: transparent;
  border: none;
  color: #bdc3c7;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 14px;
}

.admin-nav button:hover {
  background: #34495e;
  color: white;
}

.admin-nav button.active {
  background: #3498db;
  color: white;
}

.admin-content {
  flex: 1 1;
  margin-left: 250px;
  padding: 20px;
}

.admin-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.admin-header-bar h1 {
  margin: 0;
  color: #2c3e50;
  font-size: 2rem;
}

.back-to-app {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid #3498db;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.back-to-app:hover {
  background: #3498db;
  color: white;
}

/* Dashboard Styles */
.admin-dashboard h2 {
  color: #2c3e50;
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 20px;
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-align: center;
}

.stat-card h3 {
  margin: 0 0 10px 0;
  color: #7f8c8d;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-number {
  margin: 0;
  font-size: 2rem;
  font-weight: bold;
  color: #2c3e50;
}

.dashboard-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.dashboard-section h3 {
  color: #2c3e50;
  margin-bottom: 15px;
}

.recent-activity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 20px;
  gap: 20px;
}

.recent-countries h4,
.recent-stations h4 {
  color: #34495e;
  margin-bottom: 10px;
}

.recent-activity ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-activity li {
  padding: 8px 0;
  border-bottom: 1px solid #ecf0f1;
  color: #7f8c8d;
}

.top-performers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 20px;
  gap: 20px;
}

.top-countries h4,
.top-stations h4 {
  color: #34495e;
  margin-bottom: 10px;
}

.top-performers ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.top-performers li {
  padding: 8px 0;
  border-bottom: 1px solid #ecf0f1;
  color: #7f8c8d;
}

/* Admin Tables */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.admin-header h2 {
  margin: 0;
  color: #2c3e50;
}

.admin-controls {
  display: flex;
  gap: 10px;
}

.admin-panel .search-input,
.filter-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.admin-panel .search-input {
  width: 200px;
}

.filter-select {
  width: 150px;
}

.admin-table {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: #f8f9fa;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 2px solid #e0e0e0;
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
  color: #555;
}

.admin-table tr:hover {
  background: #f8f9fa;
}

.status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.status.active {
  background: #d4edda;
  color: #155724;
}

.status.inactive {
  background: #f8d7da;
  color: #721c24;
}

.toggle-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.toggle-btn.activate {
  background: #28a745;
  color: white;
}

.toggle-btn.deactivate {
  background: #dc3545;
  color: white;
}

.toggle-btn:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
}

.alert button:hover {
  opacity: 1;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #7f8c8d;
  font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 200px;
  }
  
  .admin-content {
    margin-left: 200px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  
  .recent-activity,
  .top-performers {
    grid-template-columns: 1fr;
  }
  
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .admin-controls {
    width: 100%;
    flex-direction: column;
  }
  
  .admin-panel .search-input,
  .filter-select {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .admin-sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }
  
  .admin-content {
    margin-left: 0;
  }
  
  .admin-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
  }
  
  .admin-nav button {
    white-space: nowrap;
    margin-bottom: 0;
  }
}

/* =====================================================
   GLOBAL UTILITY CLASSES
   ===================================================== */

/* Layout */
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.items-end       { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-wrap       { flex-wrap: wrap; }
.flex-1          { flex: 1 1; }
.flex-shrink-0   { flex-shrink: 0; }
.grid            { display: grid; }
.block           { display: block; }
.inline-flex     { display: inline-flex; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.w-full   { width: 100%; }
.h-full   { height: 100%; }
.min-h-screen { min-height: 100vh; }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* Spacing */
.p-2  { padding: var(--space-2); }
.p-3  { padding: var(--space-3); }
.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }

.m-0  { margin: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* Typography */
.text-xs   { font-size: var(--font-size-xs); }
.text-sm   { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-md   { font-size: var(--font-size-md); }
.text-lg   { font-size: var(--font-size-lg); }
.text-xl   { font-size: var(--font-size-xl); }
.text-2xl  { font-size: var(--font-size-2xl); }

.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uppercase   { text-transform: uppercase; }

/* Colors */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent); }
.text-error     { color: var(--error); }
.text-success   { color: var(--success); }

.bg-primary   { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-surface   { background-color: var(--surface); }

/* Border radius */
.rounded-sm  { border-radius: var(--radius-sm); }
.rounded     { border-radius: var(--radius-md); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-xl  { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Borders */
.border        { border: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }
.border-top    { border-top: 1px solid var(--border); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow    { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Responsive visibility */
@media (max-width: 767px) {
  .hidden-mobile { display: none !important; }
}

@media (min-width: 768px) {
  .hidden-desktop { display: none !important; }
  .block-desktop  { display: block !important; }
  .flex-desktop   { display: flex !important; }
}


/*# sourceMappingURL=main.864a8514.css.map*/