:root {
  --bg: #050816;
  --bg-soft: #070b1f;
  --card: #0c1125;
  --accent: #5e82ff;
  --accent-soft: rgba(94,130,255,0.24);
  --danger: #f97373;
  --text: #e5ecff;
  --muted: #9ca3cf;
  --border: #1b2343;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0f172a 0, var(--bg) 45%, #020617 100%);
  color: var(--text);
}

/* ---------- TOPBAR ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 8, 22, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand {
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
}

.brand span {
  color: var(--accent);
}

/* Botones genéricos de icono / menús */

.icon-btn {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.flag-circle {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #020617;
  font-size: 1rem;
}

/* Dropdowns */

.dropdown {
  position: absolute;
  top: 100%;
  margin-top: 0.4rem;
  background: #020617;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.7);
  padding: 0.6rem 0.7rem;
  min-width: 220px;
  display: none;
  z-index: 60;
}

.dropdown.open {
  display: block;
}

.topbar-left {
  position: relative;
}

.dropdown-wrapper {
  position: relative;
}

.country-menu {
  max-height: 280px;
  overflow-y: auto;
}

.country-option {
  width: 100%;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 0.3rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.country-option .country-label {
  flex: 1;
  text-align: left;
}

.country-option.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

/* Dropdown géneros / regiones */

.gr-menu {
  max-width: 420px;
}

.dropdown-section + .dropdown-section {
  margin-top: 0.7rem;
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
}

.dropdown-section h3 {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.dropdown-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.filter-chip {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--muted);
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
}

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

/* Buscador desplegable */

.search-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem 0.7rem;
  display: none;
}

.search-bar.open {
  display: block;
}

.search-bar input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  font-size: 0.85rem;
}

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

@media (max-width: 768px) {
  .topbar-inner {
    flex-wrap: wrap;
    justify-content: center;
  }

  .topbar-left,
  .topbar-right {
    flex: 1 1 auto;
    justify-content: space-between;
  }

  .brand {
    order: -1;
    width: 100%;
  }
}

/* ---------- MAIN LAYOUT ---------- */

.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.5rem;
}

.page-title {
  font-size: 1.6rem;
  margin: 0 0 1rem;
}

/* ---------- GLOBAL PLAYER ---------- */

.global-player {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #020617 0, #020617 60%, #020617 100%);
  border: 1px solid var(--border);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.gp-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 220px;
  flex: 1;
}

.gp-logo-wrap {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: #020617;
  border: 1px solid rgba(15, 23, 42, 0.9);
  display: grid;
  place-items: center;
}

.gp-logo {
  max-width: 64px;
  max-height: 64px;
  object-fit: contain;
}

.gp-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.gp-status {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.gp-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.gp-btn {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
}

.gp-btn-play {
  background: radial-gradient(circle at top, #22c55e, #16a34a);
  border-color: rgba(74, 222, 128, 0.7);
  color: #f9fafb;
}

.gp-btn-play.is-playing {
  background: radial-gradient(circle at top, #16a34a, #15803d);
  box-shadow: 0 10px 20px rgba(22, 163, 74, 0.5);
}

.gp-btn-report {
  border-color: rgba(248, 113, 113, 0.9);
  color: #fecaca;
}

.gp-btn.is-favorite {
  background: radial-gradient(circle at top, #14532d, #064e3b);
  border-color: rgba(74, 222, 128, 0.8);
}

.gp-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.gp-volume {
  width: 120px;
}

@media (max-width: 768px) {
  .global-player {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------- TOOLBAR (solo filtro favoritas) ---------- */

.toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.2rem;
}

.chip {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--muted);
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  color: #fff;
  border-color: var(--accent-soft);
}

/* ---------- GRID EMISORAS ---------- */

.stations-section {
  margin-top: 0.5rem;
}

.section-subtitle {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.station-card {
  position: relative;
  background: radial-gradient(circle at top left, var(--accent-soft), transparent 55%), var(--card);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 0.85rem 0.85rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  aspect-ratio: 1/1;
  box-shadow: 0 14px 25px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.station-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.7);
  border-color: var(--accent-soft);
}

.station-card.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(94, 130, 255, 0.7), 0 18px 40px rgba(0, 0, 0, 0.75);
}

.fav-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(248, 250, 252, 0.2);
  background: rgba(15, 23, 42, 0.8);
  display: grid;
  place-items: center;
  color: #faccd7;
  font-size: 0.9rem;
  cursor: pointer;
}

.fav-badge.is-favorite {
  background: radial-gradient(circle at top, #14532d, #064e3b);
  border-color: rgba(74, 222, 128, 0.7);
  color: #bbf7d0;
}

.station-logo-wrap {
  flex: 1;
  width: 100%;
  display: grid;
  place-items: center;
}

.station-logo {
  width: 86%;
  height: 86%;
  border-radius: 14px;
  object-fit: contain;
  background: #020617;
  border: 1px solid rgba(15, 23, 42, 0.9);
}

.station-info {
  width: 100%;
  text-align: center;
}

.station-title {
  margin: 0;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- PLAY PAGE ---------- */

.play-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.5rem;
}

.back-btn {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
}

.back-btn:hover {
  text-decoration: underline;
}

/* Player individual */

.player-box {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #020617 0, #020617 60%, #020617 100%);
  border: 1px solid var(--border);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.7);
}

.player-main {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.player-logo-wrap {
  width: 120px;
  height: 120px;
  border-radius: 18px;
  background: #020617;
  border: 1px solid rgba(15, 23, 42, 0.9);
  display: grid;
  place-items: center;
}

.player-logo {
  max-width: 108px;
  max-height: 108px;
  object-fit: contain;
}

.player-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Botón reproducir individual más pequeño */

.big-btn {
  border: none;
  border-radius: 999px;
  background: radial-gradient(circle at top, #22c55e, #16a34a);
  color: #f9fafb;
  padding: 0.45rem 1.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  max-width: 220px;
  text-align: center;
}

.big-btn.is-playing {
  background: radial-gradient(circle at top, #16a34a, #15803d);
}

.player-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.btn-pill {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
}

.btn-pill.is-favorite {
  background: radial-gradient(circle at top, #14532d, #064e3b);
  border-color: rgba(74, 222, 128, 0.8);
}

.btn-pill.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-report {
  border-color: rgba(248, 113, 113, 0.9);
  color: #fecaca;
}

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

.volume-label {
  font-size: 0.8rem;
  color: var(--muted);
}

#volume {
  flex: 1;
}

.status-text {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Programación */

.schedule-box {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.schedule-box h2 {
  margin: 0 0 0.6rem;
}

#schedule-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#schedule-list li {
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.9);
  font-size: 0.9rem;
}

#schedule-list li:last-child {
  border-bottom: none;
}

/* ---------- PÁGINAS INTERNAS (ayuda / contacto) ---------- */

.page-container {
  max-width: 900px;
  margin: 2rem auto 2.5rem;
  padding: 0 1.25rem;
}

.form-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #111827;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid #1f2937;
}

.form-box input,
.form-box textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #1f2937;
  background: #0d1220;
  color: #fff;
}

.form-box input:focus,
.form-box textarea:focus {
  outline: none;
  border-color: #4f7fff;
}

.form-box button {
  background: #2563eb;
  padding: 0.8rem;
  border-radius: 12px;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

.form-box button:hover {
  background: #1e4fd8;
}

/* ---------- FOOTER ---------- */

.footer {
  padding: 0.75rem 1.25rem 1.2rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
  background: #020617;
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
  margin-left: 0.5rem;
}

/* ---------- RESPONSIVE EXTRA ---------- */

@media (max-width: 768px) {
  .player-main {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .player-buttons-row {
    justify-content: center;
  }

  .big-btn {
    align-self: center;
    max-width: 100%;
  }
}
