/* CSS Reset & Variables */
:root {
  --bg-dark: #0b0f19;
  --bg-card: #151c2c;
  --bg-card-hover: #1e293b;
  --bg-navbar: rgba(11, 15, 25, 0.85);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent: #a855f7;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);
  --live-color: #ef4444;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 110px; /* Space for sticky player */
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-navbar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-text h1 span {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-live {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--live-color);
  background: rgba(239, 68, 68, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* Search Box */
.search-box {
  flex: 1;
  max-width: 500px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 1rem;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 2.5rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.9rem;
}

.clear-btn:hover {
  color: var(--text-main);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.6rem 1rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-btn i {
  color: #ec4899;
}

.count-badge {
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 700;
}

/* Main Content */
.main-content {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
}

/* Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: '📻';
  position: absolute;
  right: 2rem;
  bottom: -0.5rem;
  font-size: 6rem;
  opacity: 0.15;
  pointer-events: none;
}

.hero-content h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.hero-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 600px;
}

/* Categories Scroll */
.categories-wrapper {
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.categories-wrapper::-webkit-scrollbar {
  display: none;
}

.categories-scroll {
  display: flex;
  gap: 0.6rem;
  padding-bottom: 0.5rem;
}

.chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.5rem 1.1rem;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Content Header */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.content-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.dropdown-filter {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  outline: none;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Stations Grid */
.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* Station Card */
.station-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  transition: var(--transition);
}

.station-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.station-card.playing {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.15), var(--bg-card));
}

.card-top {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.card-img-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: #1e293b;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-info {
  flex: 1;
  overflow: hidden;
}

.card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2rem;
}

.card-tags {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-country {
  font-size: 0.75rem;
  color: #a855f7;
  font-weight: 600;
  margin-top: 0.2rem;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.75rem;
}

.bitrate-badge {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-card-fav {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.btn-card-fav:hover, .btn-card-fav.active {
  color: #ec4899;
}

.btn-card-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.btn-card-play:hover {
  transform: scale(1.08);
  background: var(--primary-hover);
  box-shadow: 0 0 12px var(--primary-glow);
}

.station-card.playing .btn-card-play {
  background: #ec4899;
}

/* Skeleton Loaders */
.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  height: 125px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: pulse 1.5s infinite ease-in-out;
}

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

.skeleton-box {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

/* Sticky Player Bar */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.85rem 1.5rem;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s ease;
}

.player-bar.hidden {
  transform: translateY(100%);
}

.player-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.player-station {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.player-favicon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  overflow: hidden;
  background: #1e293b;
  position: relative;
  flex-shrink: 0;
}

.player-favicon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Audio Visualizer Bars overlay */
.visualizer {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding-bottom: 8px;
}

.visualizer span {
  width: 3px;
  background: #a855f7;
  border-radius: 3px;
  animation: bounce 1s infinite alternate ease-in-out;
}

.visualizer span:nth-child(1) { height: 12px; animation-delay: 0.1s; }
.visualizer span:nth-child(2) { height: 22px; animation-delay: 0.3s; }
.visualizer span:nth-child(3) { height: 16px; animation-delay: 0.2s; }
.visualizer span:nth-child(4) { height: 26px; animation-delay: 0.4s; }

@keyframes bounce {
  0% { height: 6px; }
  100% { height: 28px; }
}

.player-meta {
  overflow: hidden;
}

.station-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.station-title-row h4 {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-pill {
  font-size: 0.6rem;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
}

.live-pill i {
  font-size: 0.4rem;
  animation: blink 1s infinite;
}

@keyframes blink {
  50% { opacity: 0.2; }
}

.player-meta p {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Controls */
.player-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.btn-control {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-control:hover {
  color: var(--text-main);
}

.btn-control.active {
  color: #ec4899;
}

.btn-play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: white;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--primary-glow);
  transition: var(--transition);
}

.btn-play:hover {
  transform: scale(1.06);
}

/* Extra / Volume */
.player-extra {
  display: flex;
  align-items: center;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.volume-container input[type="range"] {
  width: 90px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
}

.empty-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-state h4 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 99px;
  font-weight: 600;
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 300;
  background: #1e293b;
  border: 1px solid var(--primary);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

/* Helper Utilities */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
  }
  .search-box {
    order: 3;
    width: 100%;
    max-width: 100%;
  }
  .hero-banner {
    padding: 1.25rem;
  }
  .hero-content h2 {
    font-size: 1.3rem;
  }
  .player-extra {
    display: none; /* Hide volume slider on mobile for space */
  }
  .stations-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }
  .station-card {
    padding: 0.85rem;
  }
  .card-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .card-img-wrapper {
    width: 44px;
    height: 44px;
  }
}
