/* static/css/inicio.css — página de inicio (dashboard.html), en ambos temas */

.tarjeta-ui {
  border: 1px solid var(--tarjeta-borde);
  border-radius: 12px;
  background: var(--tarjeta);
  box-shadow: var(--sombra);
}

/* ---------- Banner + bienvenida ---------- */
.inicio-hero {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr);
  gap: 1.1rem;
  margin-bottom: 1.1rem;
}

/* Misma altura que el carrusel original: 420 px (220 px en celular) */
.inicio-banner {
  position: relative;
  height: 420px;
  overflow: hidden;
}

html[data-tema="oscuro"] .inicio-banner,
html[data-tema="oscuro"] .inicio-bienvenida {
  box-shadow: var(--sombra), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.swiper-carrusel { height: 100%; }
.swiper-carrusel .swiper-slide { position: relative; height: 100%; }

.banner-enlace { display: block; height: 100%; color: #fff; }

.swiper-carrusel .swiper-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Título del afiche: abajo a la izquierda, con la barrita de color */
.banner-titulo {
  position: absolute;
  left: 1.4rem;
  bottom: 1.3rem;
  max-width: 60%;
  padding-left: 12px;
  border-left: 4px solid var(--borde-detalle);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.swiper-carrusel .swiper-slide::after {
  content: "";
  position: absolute;
  inset: 55% 0 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
}

.banner-vacio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  height: 100%;
  background: linear-gradient(135deg, var(--acento-2), var(--acento));
  color: #fff;
}

.banner-vacio img { width: 90px !important; height: 90px !important; border-radius: 50%; background: #fff; }
.banner-vacio strong { display: block; font-family: 'Poppins', sans-serif; font-size: 1.6rem; }
.banner-vacio span { opacity: 0.85; }

.banner-flecha {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(10, 10, 25, 0.55);
  color: #fff;
  font-size: 1.1rem;
  transform: translateY(-50%);
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.banner-flecha:hover { background: var(--acento); box-shadow: var(--glow); }
.banner-anterior { left: 16px; }
.banner-siguiente { right: 16px; }
.banner-flecha.swiper-button-disabled { opacity: 0.35; }

.swiper-carrusel .swiper-pagination { bottom: 14px !important; }

.swiper-carrusel .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.55);
  opacity: 1;
  transition: width 0.3s ease, background 0.3s ease;
}

.swiper-carrusel .swiper-pagination-bullet-active {
  width: 28px;
  border-radius: 6px;
  background: var(--acento-2);
  box-shadow: none;
}

/* Panel de bienvenida con la foto del edificio a la derecha */
.inicio-bienvenida {
  position: relative;
  display: flex;
  align-items: center;
  height: 420px;
  overflow: hidden;
  padding: 1.6rem;
}

.bienvenida-foto {
  position: absolute;
  top: 0;
  right: 0;
  width: 58%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to left, #000 45%, transparent 100%);
          mask-image: linear-gradient(to left, #000 45%, transparent 100%);
}

html[data-tema="oscuro"] .inicio-bienvenida {
  background: var(--tarjeta);
}

html[data-tema="oscuro"] .bienvenida-foto { opacity: 0.85; }

.bienvenida-contenido { position: relative; z-index: 1; max-width: 62%; }

.inicio-bienvenida h2 {
  margin: 0 0 0.7rem;
  font-family: 'Poppins', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--texto);
}

.inicio-bienvenida h2 span { color: var(--acento); }
html[data-tema="oscuro"] .inicio-bienvenida h2 span { color: #fff; }

.inicio-bienvenida p {
  margin: 0 0 1.2rem;
  color: var(--texto-suave);
  font-size: 0.98rem;
  line-height: 1.55;
}

html[data-tema="oscuro"] .inicio-bienvenida p { color: #d4d4ec; }

.bienvenida-acciones { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 0.4rem; }

.bienvenida-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  color: var(--texto-suave);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.bienvenida-link:hover { color: var(--acento); }
html[data-tema="oscuro"] .bienvenida-link:hover { color: #9fd0ff; }

/* ---------- Estadísticas + programación ---------- */
.inicio-fila {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.1rem;
  margin-bottom: 1.6rem;
}

.inicio-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover { transform: translateY(-3px); }

/* Tema claro: tarjetas translúcidas (vidrio) sobre la foto de fondo, con texto legible */
html:not([data-tema="oscuro"]) .stat-card {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
}

html:not([data-tema="oscuro"]) .stat-card:hover { background: rgba(255, 255, 255, 0.2); }
html:not([data-tema="oscuro"]) .stat-sublabel { color: #4b5563; }

.stat-icono {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  font-size: 1.2rem;
}

.stat-programas .stat-icono { background: #1d6bff; box-shadow: none; }
.stat-en-vivo .stat-icono { background: #e11d48; box-shadow: none; }
.stat-proximos .stat-icono { background: #2563eb; box-shadow: none; }

.stat-numero { color: var(--texto); font: 800 1.4rem/1 'Poppins', sans-serif; }
.stat-label { margin-top: 2px; color: var(--texto); font-size: 0.86rem; font-weight: 600; }
.stat-sublabel { color: var(--texto-suave); font-size: 0.72rem; }

.inicio-programacion { padding: 0.7rem 1rem; }

.programacion-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 0.35rem;
}

.programacion-cabecera h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--texto);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.programacion-cabecera a { color: var(--acento); font-size: 0.85rem; font-weight: 600; text-decoration: none; }
html[data-tema="oscuro"] .programacion-cabecera a { color: #7cc4ff; }

.programacion-ahora {
  display: inline-block;
  margin-bottom: 2px;
  padding: 2px 9px;
  border-radius: 12px;
  background: #e11d48;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
}

.item-programacion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 6px;
  border-radius: 12px;
  color: var(--texto);
  text-decoration: none;
  transition: background 0.2s ease;
}

.item-programacion:hover { background: var(--acento-suave); color: var(--texto); }

.item-programacion img {
  flex-shrink: 0;
  width: 70px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
}

.min-width-0 { min-width: 0; }

.item-nombre {
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-horario { color: var(--texto-suave); font-size: 0.82rem; }

.badge-en-vivo-chica {
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: 6px;
  background: var(--acento);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  box-shadow: var(--glow);
}

.programacion-vacia { margin: 0; color: var(--texto-suave); }

/* ---------- Nuestros programas ---------- */
.programas-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.programas-cabecera h2 {
  margin: 0;
  padding-left: 14px;
  border-left: 5px solid var(--borde-detalle);
  color: var(--texto);
  font-family: 'Poppins', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
}


/* Dos filas independientes; las flechas de cada fila flotan a los costados */
.fila-programas { position: relative; margin-bottom: 1.1rem; }
.swiper-programas { padding: 6px 2px 10px !important; }
.swiper-programas .swiper-slide { height: auto; }

.fila-flecha {
  position: absolute;
  top: 38%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--tarjeta-borde);
  border-radius: 50%;
  background: var(--tarjeta);
  color: var(--texto);
  font-size: 1.1rem;
  box-shadow: var(--sombra);
  transform: translateY(-50%);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.fila-flecha:hover { background: var(--acento); color: #fff; box-shadow: var(--glow); }
.fila-anterior { left: -14px; }
.fila-siguiente { right: -14px; }
.fila-flecha.swiper-button-disabled { opacity: 0; pointer-events: none; }
.fila-flecha.swiper-button-lock { display: none; }

@media (max-width: 575.98px) {
  .fila-anterior { left: -6px; }
  .fila-siguiente { right: -6px; }
  .fila-flecha { width: 36px; height: 36px; }
}

.programa-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.programa-card:hover { transform: translateY(-5px); }

html[data-tema="oscuro"] .programa-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--sombra);
}

.programa-foto {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--tarjeta-2);
}

.programa-foto img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.programa-card:hover .programa-foto img { transform: scale(1.06); }

.programa-sin-foto {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--acento-2), var(--acento));
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  text-align: center;
}

.programa-pie {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.85rem 0.9rem;
}

.programa-play {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--acento-suave);
  color: var(--acento);
  font-size: 1.15rem;
}

html[data-tema="oscuro"] .programa-play { background: rgba(29, 107, 255, 0.2); color: #9fd0ff; }

.programa-info { flex: 1; min-width: 0; }

.programa-info h3 {
  margin: 0;
  overflow: hidden;
  color: var(--texto);
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.programa-info span { color: var(--texto-suave); font-size: 0.78rem; }

.programa-ver {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 12px;
  background: var(--acento);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--glow);
  transition: filter 0.2s ease;
}

.programa-ver:hover { color: #fff; filter: brightness(1.15); }

/* Insignia EN VIVO sobre la tarjeta (la muestra en-vivo.js) */
.programa-card .badge-en-vivo { top: 12px; left: 12px; }
html[data-tema="oscuro"] .badge-en-vivo { background: #e11d48; box-shadow: none; }

/* El modal de horarios reutiliza .item-programacion */
#modalHorarios .item-programacion img { width: 70px; height: 46px; }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .inicio-bienvenida h2 { font-size: 1.55rem; }
  .bienvenida-contenido { max-width: 70%; }
}

@media (max-width: 1200px) {
  .inicio-fila { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 991.98px) {
  .inicio-hero { grid-template-columns: minmax(0, 1fr); }
  .inicio-bienvenida { height: auto; min-height: 220px; }
  .bienvenida-foto { width: 50%; }
}

@media (max-width: 768px) {
  .inicio-banner { height: 220px; border-radius: 12px; }
}

@media (max-width: 575.98px) {
  .banner-titulo { max-width: 80%; font-size: 0.95rem; left: 1rem; bottom: 1.6rem; }
  .banner-flecha { width: 34px; height: 34px; }
  .inicio-bienvenida { padding: 1.2rem; }
  .bienvenida-foto { width: 100%; opacity: 0.18 !important; -webkit-mask-image: none; mask-image: none; }
  .bienvenida-contenido { max-width: 100%; }
  .inicio-bienvenida h2 { font-size: 1.4rem; }

  .inicio-stats { gap: 0.6rem; }
  .stat-card { flex-direction: column; justify-content: center; gap: 8px; padding: 0.85rem 0.4rem; text-align: center; }
  .stat-card > div { min-width: 0; }
  .stat-icono { width: 40px; height: 40px; font-size: 1.15rem; border-radius: 12px; }
  .stat-numero { font-size: 1.3rem; }
  .stat-label { font-size: 0.78rem; }
  .stat-sublabel { font-size: 0.66rem; line-height: 1.2; }

  .programas-cabecera h2 { font-size: 1.25rem; }
}

/* ---------- Tema oscuro (solo con data-tema="oscuro"; no cambia posiciones) ---------- */
html[data-tema="oscuro"] .tarjeta-ui {
  background: linear-gradient(160deg, rgba(29, 107, 255, 0.12), rgba(11, 22, 51, 0) 45%), #0b1633;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-tema="oscuro"] .inicio-banner,
html[data-tema="oscuro"] .inicio-bienvenida {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 18px 40px rgba(0, 0, 0, 0.45);
}

html[data-tema="oscuro"] .inicio-bienvenida {
  background: #0b1633;
}

html[data-tema="oscuro"] .inicio-programacion {
  background: #0b1633;
}

html[data-tema="oscuro"] .stat-card:hover,
html[data-tema="oscuro"] .programa-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

html[data-tema="oscuro"] .programa-pie { background: linear-gradient(180deg, rgba(29, 107, 255, 0.06), transparent); }

html[data-tema="oscuro"] .fila-flecha,
html[data-tema="oscuro"] .banner-flecha {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(11, 22, 51, 0.85);
  box-shadow: none;
}

html[data-tema="oscuro"] .fila-flecha:hover,
html[data-tema="oscuro"] .banner-flecha:hover { background: #1d6bff; color: #fff; }

html[data-tema="oscuro"] .badge-en-vivo-chica { background: #e11d48; box-shadow: none; }

html[data-tema="oscuro"] .btn-acento,
html[data-tema="oscuro"] .programa-ver {
  background: linear-gradient(135deg, #1d6bff, #2f80ff);
  box-shadow: none;
}
