/*!
 * Radio Player — estilos
 * Reproductor de radio HTML5 moderno, independiente, sin dependencias.
 * Se puede pegar tal cual dentro de cualquier sitio (o compilar/minificar).
 */

.rp {
  --rp-bg: #10182b;
  --rp-bg-2: #161f38;
  --rp-accent: #e2a63b;
  --rp-accent-2: #f4c469;
  --rp-live: #ef4444;
  --rp-text: #ffffff;
  --rp-text-dim: #a9b3c9;
  --rp-border: rgba(255, 255, 255, 0.1);
  --rp-radius: 18px;

  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 560px;
  padding: 14px 18px;
  border-radius: var(--rp-radius);
  background: linear-gradient(155deg, var(--rp-bg) 0%, var(--rp-bg-2) 100%);
  border: 1px solid var(--rp-border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  color: var(--rp-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  overflow: hidden;
}
.rp * { box-sizing: border-box; }
.rp[hidden] { display: none; }

/* ---------- Portada ---------- */
.rp-cover {
  position: relative;
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(155deg, #24345c, #182342);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rp-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rp-cover .rp-cover-fallback {
  width: 26px;
  height: 26px;
  color: var(--rp-accent);
  opacity: 0.85;
}
.rp-cover-fallback svg { width: 100%; height: 100%; }

/* Anillo animado alrededor de la portada mientras suena */
.rp-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 2px solid var(--rp-accent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.rp.is-playing .rp-cover::after { opacity: 0.9; }

/* ---------- Botón Play/Pause ---------- */
.rp-play {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, var(--rp-accent-2), var(--rp-accent));
  color: #161018;
  box-shadow: 0 6px 16px rgba(226, 166, 59, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rp-play:hover { transform: translateY(-1px) scale(1.03); }
.rp-play:active { transform: scale(0.96); }
.rp-play:focus-visible { outline: 2px solid var(--rp-accent-2); outline-offset: 3px; }
.rp-play svg { width: 20px; height: 20px; }
.rp-play .rp-icon-pause { display: none; }
.rp.is-playing .rp-play .rp-icon-play { display: none; }
.rp.is-playing .rp-play .rp-icon-pause { display: block; }

/* Spinner de carga/reconexión sobre el botón de play */
.rp-play .rp-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(22, 16, 24, 0.25);
  border-top-color: #161018;
  animation: rp-spin 0.7s linear infinite;
}
.rp.is-loading .rp-play .rp-icon-play,
.rp.is-loading .rp-play .rp-icon-pause { display: none; }
.rp.is-loading .rp-play .rp-spinner { display: block; }
@keyframes rp-spin { to { transform: rotate(360deg); } }

/* ---------- Información central ---------- */
.rp-info {
  flex: 1 1 auto;
  min-width: 0;
}
.rp-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.rp-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.16);
  color: #ff8686;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.rp-live-badge .rp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rp-live);
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: rp-pulse 1.6s ease-out infinite;
}
.rp[hidden] .rp-live-badge,
.rp:not(.is-live) .rp-live-badge { display: none; }
@keyframes rp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.rp-status-text {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--rp-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp.is-reconnecting .rp-status-text { color: #ffb454; }
.rp.is-offline .rp-status-text { color: #ff8686; }

.rp-program {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-station {
  font-size: 0.78rem;
  color: var(--rp-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Efecto "marquee" opcional para títulos largos */
.rp-program.is-marquee {
  display: inline-block;
  white-space: nowrap;
  animation: rp-marquee 9s linear infinite;
}
@keyframes rp-marquee {
  0%, 12% { transform: translateX(0); }
  88%, 100% { transform: translateX(calc(-1 * (100% - 100px))); }
}

/* ---------- Volumen ---------- */
.rp-volume {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.rp-mute {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--rp-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.rp-mute:hover { background: rgba(255, 255, 255, 0.14); }
.rp-mute:focus-visible { outline: 2px solid var(--rp-accent-2); outline-offset: 2px; }
.rp-mute svg { width: 16px; height: 16px; }
.rp-mute .rp-icon-vol-mid,
.rp-mute .rp-icon-vol-mute { display: none; }
.rp.is-muted .rp-mute .rp-icon-vol-high,
.rp.is-muted .rp-mute .rp-icon-vol-mid { display: none; }
.rp.is-muted .rp-mute .rp-icon-vol-mute { display: block; }
.rp.vol-mid:not(.is-muted) .rp-mute .rp-icon-vol-high { display: none; }
.rp.vol-mid:not(.is-muted) .rp-mute .rp-icon-vol-mid { display: block; }

.rp-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 78px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  outline: none;
  cursor: pointer;
}
.rp-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--rp-accent-2);
  border: 2px solid #161018;
  cursor: pointer;
}
.rp-volume-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--rp-accent-2);
  border: 2px solid #161018;
  cursor: pointer;
}
.rp-volume-slider::-moz-range-progress { background: var(--rp-accent); border-radius: 999px; }

/* ---------- Variante compacta (barra fija en el pie del sitio) ---------- */
.rp.rp-compact {
  max-width: none;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--rp-border);
  box-shadow: 0 -8px 22px rgba(0, 0, 0, 0.3);
  padding: 10px 16px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 560px) {
  .rp { gap: 12px; padding: 10px 12px; max-width: none; }
  .rp-cover { width: 46px; height: 46px; }
  .rp-play { width: 42px; height: 42px; }
  .rp-station { display: none; }
  .rp-status-text { display: none; }
  .rp-volume-slider { width: 56px; }
}
@media (max-width: 380px) {
  .rp-volume-slider { display: none; }
}
