:root {
  --bg-dark: #0f141c;
  --bg-card: #18202c;
  --bg-card-hover: #1f2a3a;
  --primary: #00e5ff;
  --primary-glow: rgba(0, 229, 255, 0.3);
  --accent: #ff2a70;
  --accent-glow: rgba(255, 42, 112, 0.3);
  --text-main: #f0f4f8;
  --text-muted: #94a3b8;
  --border-color: #263345;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Ticker */
header {
  background: rgba(15, 20, 28, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.ticker-wrap {
  background: linear-gradient(90deg, #1e1b4b, #311042);
  color: #e0e7ff;
  padding: 6px 0;
  overflow: hidden;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
}

.ticker-badge {
  background: var(--accent);
  color: white;
  padding: 2px 10px;
  font-weight: bold;
  font-size: 0.75rem;
  text-transform: uppercase;
  border-radius: 4px;
  margin-left: 15px;
  margin-right: 15px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.ticker-content {
  display: inline-block;
  white-space: nowrap;
  animation: ticker 90s linear infinite;
  will-change: transform;
}

.ticker-wrap:hover .ticker-content {
  animation-play-state: paused;
}

@keyframes ticker {
  0% { transform: translate3d(100%, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}


.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 4px 10px;
  border-radius: 6px;
  color: #000;
  font-weight: 900;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.65rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #000;
  box-shadow: 0 0 15px var(--primary-glow);
}

.btn-primary:hover {
  background: #33ebff;
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--primary-glow);
}

.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 15px var(--accent-glow);
}

.btn-accent:hover {
  background: #ff4783;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  flex: 1;
}

/* Radio Player Card */
.player-card {
  background: linear-gradient(135deg, #18202c, #111823);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.player-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.station-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.station-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 2px solid var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 10px var(--accent); }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.play-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: #000;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 0 20px var(--primary-glow);
}

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

.volume-slider {
  accent-color: var(--primary);
  cursor: pointer;
}

/* Grid layout */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
  border-color: #384b66;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #111722;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: #121824;
  color: var(--text-muted);
  font-weight: 600;
}

/* Status Badges */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-block;
}

.badge-approved { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-rejected { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Footer */
footer {
  background: #090d13;
  border-top: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar { flex-direction: column; gap: 1rem; }
  .player-card { flex-direction: column; text-align: center; }
  .station-info { flex-direction: column; }
}

/* Ecualizador Dinámico de Barras Verdes (Media Visualizer) */
.visualizer-container {
  background: #060b08;
  border: 1px solid rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.15) inset, 0 4px 14px rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.visualizer {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 30px;
}

.visualizer .bar {
  width: 5px;
  background: #22c55e;
  border-radius: 999px;
  min-height: 4px;
  transition: height 0.15s ease;
}

.visualizer.active .bar:nth-child(1) { animation: eqBar1 0.7s ease-in-out infinite alternate; }
.visualizer.active .bar:nth-child(2) { animation: eqBar2 0.5s ease-in-out infinite alternate; }
.visualizer.active .bar:nth-child(3) { animation: eqBar3 0.8s ease-in-out infinite alternate; }
.visualizer.active .bar:nth-child(4) { animation: eqBar4 0.6s ease-in-out infinite alternate; }
.visualizer.active .bar:nth-child(5) { animation: eqBar5 0.9s ease-in-out infinite alternate; }
.visualizer.active .bar:nth-child(6) { animation: eqBar6 0.55s ease-in-out infinite alternate; }
.visualizer.active .bar:nth-child(7) { animation: eqBar7 0.75s ease-in-out infinite alternate; }

@keyframes eqBar1 { 0% { height: 20%; } 100% { height: 75%; } }
@keyframes eqBar2 { 0% { height: 40%; } 100% { height: 98%; } }
@keyframes eqBar3 { 0% { height: 15%; } 100% { height: 50%; } }
@keyframes eqBar4 { 0% { height: 30%; } 100% { height: 90%; } }
@keyframes eqBar5 { 0% { height: 25%; } 100% { height: 60%; } }
@keyframes eqBar6 { 0% { height: 35%; } 100% { height: 95%; } }
@keyframes eqBar7 { 0% { height: 18%; } 100% { height: 45%; } }

.visualizer:not(.active) .bar {
  height: 15% !important;
  opacity: 0.35;
}

/* ==========================================================================
   PWA: respeto de áreas seguras (notch / indicador de inicio) en modo app
   instalada en iOS y Android.
   ========================================================================== */
@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  footer {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
}

