:root {
  --bg-main: #080a0f;
  --bg-card: #111522;
  --bg-card-alt: #181f30;
  --accent-gold: #f5ba13;
  --accent-orange: #ff6f1a;
  --accent-red: #e81b1b;
  --accent-blue: #5583b2;
  --accent-cyan: #5583b2;
  --text-main: #f0f4fc;
  --text-muted: #8d9bb0;
  --border-color: rgba(85, 131, 178, 0.22);
  --radius-lg: 14px;
  --radius-md: 8px;
  --radius-sm: 4px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.station-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: #000;
  padding: 2px;
  border: 1px solid rgba(85, 131, 178, 0.35);
  box-shadow: 0 0 12px rgba(85, 131, 178, 0.25);
}

.brand-badge {
  font-size: 26px;
}

.brand-title h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
}

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

/* Cintillo Deslizante de Efemérides (Agente 5) */
.ephemeris-ticker-bar {
  background: #0a0d14;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  height: 38px;
  overflow: hidden;
  position: relative;
}

.ticker-label {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 0 14px;
  height: 100%;
  text-transform: uppercase;
  z-index: 5;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.ticker-marquee-wrapper {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  display: flex;
  align-items: center;
}

.ticker-marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 36px;
  animation: ticker-slide 130s linear infinite;
  white-space: nowrap;
}

.ticker-marquee-track:hover {
  animation-play-state: paused;
}

@keyframes ticker-slide {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--text-main);
}

.ticker-item-badge {
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 0.75rem;
  background: rgba(245, 186, 19, 0.12);
  border: 1px solid rgba(245, 186, 19, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
}

.ticker-item-breaking {
  color: var(--accent-red);
  font-weight: 700;
  background: rgba(232, 27, 27, 0.15);
  border: 1px solid rgba(232, 27, 27, 0.4);
}

.ticker-item-sep {
  color: var(--accent-orange);
  font-weight: 700;
  font-size: 0.9rem;
  margin-left: 20px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255, 51, 102, 0.15);
  border: 1px solid rgba(255, 51, 102, 0.4);
  color: var(--accent-red);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Tabs Navigation */
.tabs-nav-container {
  max-width: 1100px;
  margin: 1.5rem auto 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.tabs-nav {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

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

.tab-btn.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

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

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.station-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  margin-bottom: 1.5rem;
}

/* Player section */
.player-hero {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-bottom: 1.5rem;
}

.album-art-wrap {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #000;
  flex-shrink: 0;
}

.album-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.playlist-badge {
  display: inline-block;
  background: rgba(245, 166, 35, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 166, 35, 0.3);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.track-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.track-artist {
  font-size: 1.05rem;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

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

.player-controls-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--bg-card-alt);
  padding: 1rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.2rem;
}

.play-main-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #000;
  font-weight: 700;
  transition: transform 0.2s;
}

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

.volume-container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.volume-slider {
  flex: 1;
  accent-color: var(--accent-gold);
  cursor: pointer;
}

.listeners-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Schedule & Programs list */
.shows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  margin-top: 1.2rem;
}

.show-item {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  padding: 1.1rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.show-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
  gap: 8px;
}

.show-item h4 {
  color: var(--accent-gold);
  font-size: 1rem;
}

.host-tag {
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.live-badge-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 51, 102, 0.15);
  border: 1px solid rgba(255, 51, 102, 0.4);
  color: var(--accent-red);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.archive-badge-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.show-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Weekly Schedule Nav */
.weekly-schedule-box {
  margin-top: 1.8rem;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
}

.days-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.day-btn {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.day-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.day-btn.active {
  background: rgba(245, 166, 35, 0.15);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.schedule-day-panel {
  display: none;
}

.schedule-day-panel.active {
  display: block;
}

.schedule-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.schedule-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.schedule-time {
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
  min-width: 52px;
}

.schedule-title {
  font-size: 0.9rem;
  color: var(--text-main);
}

.schedule-host {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Chat Tab */
.chat-window {
  display: flex;
  flex-direction: column;
  height: 520px;
}

.chat-messages-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
}

.chat-message-item {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
}

.chat-message-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.chat-message-meta strong {
  color: var(--accent-cyan);
}

.chat-message-body {
  font-size: 0.9rem;
  line-height: 1.4;
}

.chat-input-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.input-field {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.btn-primary {
  background: var(--accent-gold);
  color: #000;
  border: none;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.9;
}

/* Stats Tab */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 1.5rem;
}

.stat-box {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  padding: 1.2rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-box h3 {
  font-size: 1.8rem;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.stat-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Visualizer Waves */
.visualizer-waves {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.visualizer-waves .wave-bar {
  width: 4px;
  height: 6px;
  background: var(--accent-gold);
  border-radius: 2px;
  transition: height 0.2s ease;
}

.visualizer-waves.active .wave-bar:nth-child(1) {
  animation: wave 1s infinite ease-in-out;
}
.visualizer-waves.active .wave-bar:nth-child(2) {
  animation: wave 1.2s infinite ease-in-out 0.1s;
}
.visualizer-waves.active .wave-bar:nth-child(3) {
  animation: wave 0.8s infinite ease-in-out 0.2s;
}
.visualizer-waves.active .wave-bar:nth-child(4) {
  animation: wave 1.1s infinite ease-in-out 0.3s;
}
.visualizer-waves.active .wave-bar:nth-child(5) {
  animation: wave 0.9s infinite ease-in-out 0.15s;
}

@keyframes wave {
  0%, 100% { height: 6px; }
  50% { height: 24px; }
}

/* Station Clock Header */
.station-clock {
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Stats Table */
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.stats-table th {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.stats-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border-color);
}

/* Footer */
.station-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

