/* Difusion Radio Preview v7
   Ajustes solicitados sobre v6:
   - oyentes al mismo tamano que las otras KPIs
   - tab activa con fondo azul
   - sin lineas superiores en anterior/siguiente
   - locutores con franja interior sutil y colores reales derivados de la foto
*/

/* 1) Navegacion: seleccionado con fondo azul, igual a la sensacion hover. */
.main-nav a.active,
.main-nav a.active:hover,
.main-nav a[aria-current="page"] {
  background: color-mix(in srgb, var(--brand-soft, #123f66) 28%, transparent) !important;
  border-color: rgba(60, 176, 255, .22) !important;
  box-shadow: inset 0 -2px 0 rgba(61, 189, 255, .85) !important;
  color: var(--brand-strong, #57c0ff) !important;
}
html[data-theme="dark"] .main-nav a.active,
html[data-theme="dark"] .main-nav a.active:hover,
html[data-theme="dark"] .main-nav a[aria-current="page"] {
  background: rgba(20, 68, 110, .72) !important;
}
html:not([data-theme="dark"]) .main-nav a.active,
html:not([data-theme="dark"]) .main-nav a.active:hover,
html:not([data-theme="dark"]) .main-nav a[aria-current="page"] {
  background: rgba(33, 136, 212, .14) !important;
  color: #1175c8 !important;
}

/* 2) Oyentes: exactamente en la escala visual de las otras dos KPIs. */
.broadcast-kpis article strong,
.broadcast-kpis article:nth-child(3) #listeners-count {
  font-size: 1.15rem !important;
  line-height: 1.15 !important;
  font-weight: 800 !important;
}
@media (min-width: 768px) {
  .broadcast-kpis article strong,
  .broadcast-kpis article:nth-child(3) #listeners-count {
    font-size: 1.25rem !important;
  }
}
.broadcast-kpis #audiencia-label {
  font-size: .78rem !important;
  line-height: 1.2 !important;
  max-width: none !important;
}

/* 3) Historial: quitar lineas superiores visibles en anterior/siguiente.
   El actual conserva solo una atmosfera sutil, no una barra marcada. */
.broadcast-sequence .sequence-item::before,
.broadcast-sequence .sequence-item.previous::before,
.broadcast-sequence .sequence-item:first-child::before,
.broadcast-sequence .sequence-item.next::before {
  display: none !important;
  content: none !important;
}
.broadcast-sequence .sequence-item.current::before {
  display: block !important;
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  height: auto !important;
  border-radius: inherit !important;
  background-image: linear-gradient(135deg,
    color-mix(in srgb, var(--seq-c1, #209bff) 20%, transparent),
    transparent 45%,
    color-mix(in srgb, var(--seq-c2, #7b55ff) 12%, transparent));
  opacity: 1 !important;
}
.broadcast-sequence .sequence-item.current {
  border-color: rgba(37, 167, 255, .26) !important;
}
.broadcast-sequence .sequence-item.previous,
.broadcast-sequence .sequence-item:first-child,
.broadcast-sequence .sequence-item.next {
  box-shadow: none !important;
}

/* 4) Locutores: la franja queda dentro de la tarjeta, discreta, y usa colores derivados de la foto. */
.host-card {
  position: relative;
  overflow: hidden;
}
.host-card::before,
.host-card:nth-child(n)::before {
  content: "" !important;
  position: absolute !important;
  left: 22px !important;
  right: 22px !important;
  top: 16px !important;
  height: 5px !important;
  border-radius: 999px !important;
  background-image: linear-gradient(90deg,
    var(--host-c1, #31b7ff),
    var(--host-c2, #8a58ff),
    var(--host-c3, #20c2a0)) !important;
  background-size: 220% 220% !important;
  animation: drPaletteFlow 9s ease-in-out infinite !important;
  filter: saturate(1.06) brightness(1.02) !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,.05), 0 3px 10px rgba(7, 45, 86, .10) !important;
  z-index: 1 !important;
}
.host-card > * {
  position: relative;
  z-index: 2;
}
.host-card.is-live-host::before {
  height: 6px !important;
  top: 15px !important;
}
/* Suprimir cualquier barra mas agresiva heredada. */
.host-card.is-live-host {
  box-shadow: 0 0 0 2px rgba(15, 195, 177, .14), 0 12px 26px rgba(7, 43, 83, .12) !important;
}

/* 5) Programacion semanal: sin barra superior visible; solo color de fondo discreto para actual. */
.schedule-event::before,
.schedule-event.is-current-program::before,
.schedule-event.is-live-program::before {
  display: none !important;
  content: none !important;
}
.schedule-event.is-current-program,
.schedule-event.is-live-program {
  background-image: linear-gradient(135deg,
    color-mix(in srgb, var(--event-c1, #1fa2ff) 12%, transparent),
    transparent 55%,
    color-mix(in srgb, var(--event-c2, #8b59ff) 7%, transparent)) !important;
}

/* 6) Tema claro: boton principal claro legible. */
html:not([data-theme="dark"]) .live-card .primary-button {
  background: linear-gradient(135deg, rgba(249,252,255,.98), rgba(219,237,247,.96)) !important;
  color: #0f3c65 !important;
  border: 1px solid rgba(255,255,255,.72) !important;
}
html:not([data-theme="dark"]) .live-card .primary-button i,
html:not([data-theme="dark"]) .live-card .primary-button span,
html:not([data-theme="dark"]) .live-card .primary-button {
  color: #0f3c65 !important;
}

@media (max-width: 768px) {
  .host-card::before,
  .host-card:nth-child(n)::before {
    left: 18px !important;
    right: 18px !important;
    top: 14px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .host-card::before { animation: none !important; }
}

/* Paso 1: quitar únicamente la línea inferior del menú activo */
.main-nav a.active,
.main-nav a.active:hover,
.main-nav a[aria-current="page"] {
  box-shadow: none !important;
}

/* PASO 2: recuperar dimensiones compactas de indicadores */

.broadcast-kpis article,
.broadcast-kpis article:nth-child(3) {
  min-height: 92px !important;
  padding: 13px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.broadcast-kpis article strong,
.broadcast-kpis article:nth-child(3) #listeners-count {
  font-size: 1rem !important;
  line-height: 1.2 !important;
  font-weight: 800 !important;
  margin: 0 !important;
}

.broadcast-kpis article small,
.broadcast-kpis #audiencia-label {
  font-size: .65rem !important;
  line-height: 1.3 !important;
  margin-top: 3px !important;
}

.broadcast-kpis article > div {
  min-width: 0;
}

/* PASO 2: restaurar la tarjeta AHORA */

.broadcast-sequence .sequence-item.current::before {
  display: none !important;
  content: none !important;
}

html[data-theme="dark"]
.broadcast-sequence .sequence-item.current {
  background: #12354d !important;
  color: #f5faff !important;
  border: 1px solid rgba(38, 171, 237, .32) !important;
  box-shadow: inset 4px 0 0 #27baff !important;
}

html:not([data-theme="dark"])
.broadcast-sequence .sequence-item.current {
  background: #dbeefa !important;
  color: #173550 !important;
  border: 1px solid #b6d6ed !important;
  box-shadow: inset 4px 0 0 #159eec !important;
}

.broadcast-sequence .sequence-item.current strong,
.broadcast-sequence .sequence-item.current small {
  color: inherit !important;
}


/* PASO 3: locutores - linea superior integrada, estilo imagen 2 */
.host-card {
  position: relative !important;
  overflow: hidden !important;
}

.host-card::before,
.host-card:nth-child(n)::before {
  content: "" !important;
  position: absolute !important;
  left: 18px !important;
  right: 18px !important;
  top: 12px !important;
  height: 6px !important;
  border-radius: 999px !important;

  background: linear-gradient(
    90deg,
    var(--host-c1, #3bc2ff),
    var(--host-c2, #8a63ff),
    var(--host-c3, #ff5fb2)
  ) !important;

  background-size: 220% 220% !important;
  animation: drPaletteFlow 8s ease-in-out infinite !important;

  box-shadow:
    0 0 0 1px rgba(255,255,255,.05),
    0 4px 14px rgba(16, 96, 155, .18) !important;

  opacity: .98 !important;
  z-index: 1 !important;
}

/* evitar que la franja quede “afuera” o demasiado invasiva */
.host-card > * {
  position: relative !important;
  z-index: 2 !important;
}

/* dejarla más sutil en móvil */
@media (max-width: 768px) {
  .host-card::before,
  .host-card:nth-child(n)::before {
    left: 16px !important;
    right: 16px !important;
    top: 10px !important;
    height: 5px !important;
  }
}

/* si hay live host, no agrandar la franja */
.host-card.is-live-host::before {
  top: 12px !important;
  height: 6px !important;
}


/* PASO 3A: franja integrada al borde superior */
#hosts-grid .host-card::before,
#hosts-grid .host-card:nth-child(n)::before,
#hosts-grid .host-card.is-live-host::before {
  content: "" !important;
  display: block !important;

  position: absolute !important;
  inset: 0 0 auto 0 !important;

  width: 100% !important;
  height: 5px !important;
  border-radius: 0 !important;

  background: linear-gradient(
    90deg,
    var(--host-c1, #249fff),
    var(--host-c2, #7b5cff),
    var(--host-c3, #16c9ad),
    var(--host-c1, #249fff)
  ) !important;

  background-size: 250% 100% !important;
  animation: drPaletteFlow 12s ease-in-out infinite !important;

  filter: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
  z-index: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
  #hosts-grid .host-card::before {
    animation: none !important;
  }
}

/* PASO 5: franjas vibrantes animadas en locutores */
.host-card {
  position: relative !important;
  overflow: hidden !important;
}

.host-card::before {
  content: "" !important;
  position: absolute !important;
  left: 18px !important;
  right: 18px !important;
  top: 8px !important;
  height: 6px !important;
  border-radius: 999px !important;
  z-index: 1 !important;

  background: linear-gradient(
    90deg,
    var(--host-c1, #32c5ff),
    var(--host-c2, #7a5cff),
    var(--host-c3, #ff4fb3),
    var(--host-c1, #32c5ff)
  ) !important;

  background-size: 220% 100% !important;
  animation: hostGradientFlow 7s linear infinite !important;

  box-shadow:
    0 0 10px color-mix(in srgb, var(--host-c2, #7a5cff) 35%, transparent),
    0 0 18px color-mix(in srgb, var(--host-c3, #ff4fb3) 18%, transparent) !important;
}

.host-card > * {
  position: relative;
  z-index: 2;
}

@keyframes hostGradientFlow {
  0%   { background-position:   0% 50%; }
  100% { background-position: 220% 50%; }
}

/* En tema oscuro, un poco más de presencia */
[data-theme="dark"] .host-card::before,
body.dark-theme .host-card::before,
html.dark .host-card::before {
  filter: saturate(1.12) brightness(1.08);
}

/* En tema claro, evitar que quede demasiado chillón */
[data-theme="light"] .host-card::before,
body.light-theme .host-card::before,
html.light .host-card::before {
  filter: saturate(1.03) brightness(1.02);
}


/* PASO 8: degradado continuo basado en colores de la foto */
#hosts-grid .host-card::before,
#hosts-grid .host-card:nth-child(n)::before,
#hosts-grid .host-card.is-live-host::before {
  position: absolute !important;
  inset: 0 auto auto 0 !important;
  width: 200% !important;
  height: 5px !important;
  border-radius: 0 !important;
  opacity: 1 !important;
  z-index: 1 !important;

  background: linear-gradient(
    90deg,
    var(--host-c1) 0%,
    var(--host-c2) 12.5%,
    var(--host-c3) 25%,
    var(--host-c1) 37.5%,
    var(--host-c1) 50%,
    var(--host-c2) 62.5%,
    var(--host-c3) 75%,
    var(--host-c1) 87.5%,
    var(--host-c1) 100%
  ) !important;

  background-size: 100% 100% !important;
  transform: translateX(0);
  animation:
    drHostFlow 12s linear infinite,
    drHostGlow 4s ease-in-out infinite !important;
}

@keyframes drHostFlow {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes drHostGlow {
  0%, 100% {
    filter: brightness(1) saturate(1.06)
      drop-shadow(0 0 2px rgba(75,180,255,.12));
  }
  50% {
    filter: brightness(1.12) saturate(1.14)
      drop-shadow(0 0 5px rgba(75,180,255,.24));
  }
}

@media (prefers-reduced-motion: reduce) {
  #hosts-grid .host-card::before,
  #hosts-grid .host-card:nth-child(n)::before,
  #hosts-grid .host-card.is-live-host::before {
    animation: none !important;
    transform: none !important;
  }
}

/* PASO 9: degradado horizontal perfectamente repetible */
#hosts-grid .host-card::before,
#hosts-grid .host-card:nth-child(n)::before,
#hosts-grid .host-card.is-live-host::before {
  /*
   * La franja tiene 200% del ancho de la tarjeta.
   * Repetimos el mismo degradado cada 50% de la franja.
   * Al desplazarse -50%, ambos fotogramas coinciden.
   */
  background-image: linear-gradient(
    to right,
    var(--host-c1) 0%,
    var(--host-c2) 30%,
    var(--host-c3) 65%,
    var(--host-c1) 100%
  ) !important;

  background-size: 50% 100% !important;
  background-repeat: repeat-x !important;
  background-position: 0 0 !important;

  animation:
    drHostFlow 12s linear infinite,
    drHostGlow 4s ease-in-out infinite !important;
}

/* Mantener accesibilidad */
@media (prefers-reduced-motion: reduce) {
  #hosts-grid .host-card::before,
  #hosts-grid .host-card:nth-child(n)::before,
  #hosts-grid .host-card.is-live-host::before {
    animation: none !important;
    transform: none !important;
  }
}


/* PASO 11 CORREGIDO: marco AHORA */

/* Solo la tarjeta actual */
.broadcast-sequence .sequence-item.current {
  position: relative !important;
  overflow: hidden !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

/* Eliminar la antigua franja vertical */
.broadcast-sequence .sequence-item.current::before {
  content: none !important;
  display: none !important;
}

/* Marco completo degradado */
.broadcast-sequence .sequence-item.current::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 3px !important;
  border-radius: inherit !important;
  pointer-events: none !important;
  z-index: 3 !important;

  background: linear-gradient(
    90deg,
    #28c9ff 0%,
    #7965ff 35%,
    #23dfc4 70%,
    #28c9ff 100%
  ) 0 0 / 50% 100% repeat-x !important;

  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;

  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;

  animation: drAhoraMarcoInfinito 14s linear infinite !important;
}

@keyframes drAhoraMarcoInfinito {
  from { background-position: 0 0; }
  to   { background-position: -100% 0; }
}

/* Respetar movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .broadcast-sequence .sequence-item.current::after {
    animation: none !important;
  }
}


/* PASO 12: marco circular animado de AHORA */

/* Propiedad animable para girar el degradado */
@property --dr-ahora-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.broadcast-sequence .sequence-item.current::after {
  background: conic-gradient(
    from var(--dr-ahora-angle),
    #28c9ff 0deg,
    #7965ff 90deg,
    #23dfc4 180deg,
    #28c9ff 270deg,
    #28c9ff 360deg
  ) !important;

  animation: drAhoraRotacion 10s linear infinite !important;
}

@keyframes drAhoraRotacion {
  from { --dr-ahora-angle: 0deg; }
  to   { --dr-ahora-angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  .broadcast-sequence .sequence-item.current::after {
    animation: none !important;
  }
}


/* LOCUTORES: descripcion por programa */
/* El selector ocupa el lugar del nombre actual del programa */
#hosts-grid .host-program-select {
  max-width: 100%;
  min-width: 0;
  font: inherit;
  font-weight: 700;
  color: var(--brand-strong, #35baff);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

#hosts-grid .host-program-select option {
  color: #17324c;
  background: #f4f8ff;
}

#hosts-grid .host-program-select:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 3px;
}


/* LOCUTORES: selector de programas v1 */
/* Solo aparece si el locutor tiene varios programas */
#hosts-grid .host-program-select {
  display: inline-block;
  max-width: 100%;
  min-width: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0 16px 0 0;
  cursor: pointer;
}

#hosts-grid .host-program-select option {
  background: #17324c;
  color: #ffffff;
}

#hosts-grid .host-program-select:focus-visible {
  outline: 2px solid #32baff;
  outline-offset: 2px;
  border-radius: 3px;
}


/* LOCUTORES: botones de programas v2 */

#hosts-grid .host-program-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}

/* Mismo estilo para todos los locutores */
#hosts-grid .host-program-btn {
  appearance: none;
  box-sizing: border-box;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 30px;
  max-width: 100%;
  padding: 6px 11px;

  border: 1px solid rgba(65, 184, 255, .48);
  border-radius: 9px;

  background: rgba(34, 132, 208, .15);
  color: #55c3ff;

  font-family: inherit;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;

  cursor: pointer;

  transition:
    background-color .2s ease,
    border-color .2s ease,
    color .2s ease;
}

/* Programa seleccionado */
#hosts-grid .host-program-btn[aria-pressed="true"] {
  background: rgba(36, 153, 235, .27);
  border-color: rgba(70, 194, 255, .85);
  color: #70d1ff;
}

/* Hover */
#hosts-grid .host-program-btn:hover:not(:disabled) {
  background: rgba(42, 164, 243, .34);
}

/* Sin programas: igual tamaño y estilo */
#hosts-grid .host-program-btn:disabled {
  opacity: .7;
  cursor: default;
}

/* Accesibilidad */
#hosts-grid .host-program-btn:focus-visible {
  outline: 2px solid #5ed5ff;
  outline-offset: 3px;
}

#hosts-grid .host-program-description {
  overflow-wrap: anywhere;
}

/* Tema claro */
html[data-theme="light"]
#hosts-grid .host-program-btn {
  color: #0864a7;
  background: rgba(34, 132, 208, .10);
  border-color: rgba(30, 120, 190, .32);
}

html[data-theme="light"]
#hosts-grid .host-program-btn[aria-pressed="true"] {
  color: #07548d;
  background: rgba(34, 132, 208, .20);
  border-color: rgba(30, 120, 190, .65);
}

@media (prefers-reduced-motion: reduce) {
  #hosts-grid .host-program-btn {
    transition: none;
  }
}


/* PASO 4: botones compactos de locutores */

#hosts-grid .host-program-buttons {
  gap: 5px;
  margin-bottom: 5px;
}

/* Botones pequeños y completamente redondeados */
#hosts-grid .host-program-btn {
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;

  font-size: .68rem;
  font-weight: 600;
  line-height: 1.2;

  color: #a8cce8;
  background: rgba(45, 111, 166, .10);
  border: 1px solid rgba(90, 169, 225, .28);
}

/* Programa seleccionado */
#hosts-grid .host-program-btn[aria-pressed="true"] {
  color: #ffffff;
  background: #147fc4;
  border-color: #42bfff;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(39, 174, 255, .15);
}

/* Programas no seleccionados */
#hosts-grid .host-program-btn[aria-pressed="false"] {
  color: #a8cce8;
  background: rgba(45, 111, 166, .10);
  border-color: rgba(90, 169, 225, .28);
}

#hosts-grid .host-program-btn:hover:not(:disabled) {
  background: #247cba;
  color: #ffffff;
  border-color: #55c7ff;
}

/* Botón sin programas */
#hosts-grid .host-program-btn:disabled {
  color: #a8b8cb;
  background: rgba(75, 109, 138, .12);
  border-color: rgba(115, 150, 180, .22);
  opacity: .8;
}

/* Adaptación al tema claro */
html[data-theme="light"] #hosts-grid
.host-program-btn[aria-pressed="true"] {
  color: #ffffff;
  background: #0875bc;
  border-color: #0875bc;
}

html[data-theme="light"] #hosts-grid
.host-program-btn[aria-pressed="false"] {
  color: #24638f;
  background: rgba(21, 116, 183, .07);
  border-color: rgba(21, 116, 183, .25);
}

html[data-theme="light"] #hosts-grid
.host-program-btn:disabled {
  color: #637d92;
  background: rgba(80, 120, 155, .07);
  border-color: rgba(80, 120, 155, .20);
}

/* Accesibilidad del teclado */
#hosts-grid .host-program-btn:focus-visible {
  outline: 2px solid #51caff;
  outline-offset: 2px;
}

/* PASO 5: eliminar resaltado táctil en locutores */
#hosts-grid .host-card,
#hosts-grid .host-program-btn {
  -webkit-tap-highlight-color: transparent !important;
}

/* Evitar selección accidental del texto del botón */
#hosts-grid .host-program-btn {
  -webkit-user-select: none;
  user-select: none;
}

/* Conservar el indicador de teclado */
#hosts-grid .host-program-btn:focus-visible {
  outline: 2px solid #51caff;
  outline-offset: 2px;
}

