/* ==========================================================================
   EPG VISOR PRO V2.0 — STYLESHEET
   Aceleración por GPU, Zero Layout Shift, Deco Timeline Grid y Dark Mode
   ========================================================================== */

:root {
  --bg-main: #0b0d13;
  --bg-surface: #131620;
  --bg-card: #181b26;
  --bg-card-hover: #212534;
  --bg-input: #1a1d28;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;

  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dimmed: #6b7280;

  --accent-primary: #3b82f6;
  --accent-secondary: #6366f1;
  --accent-hover: #2563eb;
  
  --live-green: #10b981;
  --live-red: #ef4444;
  --star-gold: #f59e0b;

  --header-height: 64px;
  --subheader-height: 0px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ocultar banners globalmente cuando esté desactivado en ajustes */
body.hide-banners .card-banner-wrapper,
body.hide-banners .guide-prog-banner,
body.hide-banners .hero-banner-side,
body.hide-banners .modal-banner-container {
  display: none !important;
}

/* ==========================================================================
   HEADER PRINCIPAL
   ========================================================================== */
#mainHeader {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  gap: 16px;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

body.header-hidden #mainHeader {
  transform: translateY(-100%);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.brand-logo-text {
  font-size: 1.7rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  user-select: none;
}

.brand-logo-dot {
  color: #00e676;
  font-weight: 900;
  font-size: 1.9rem;
  line-height: 0.8;
  margin-left: 2px;
}

/* Buscador */
.search-box {
  flex: 1;
  max-width: 440px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: 0 40px 0 44px;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.btn-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.btn-search-toggle,
.btn-close-mobile-search {
  display: none !important;
}

/* Tabs de navegación */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.desktop-only {
  display: flex !important;
}

.mobile-bottom-nav {
  display: none !important;
}

.view-tabs {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.btn-icon {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  padding: 0 10px;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

#btnBack {
  width: auto;
  gap: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0 14px;
  background: #1f2432;
  border-color: rgba(255, 255, 255, 0.15);
}

.sub-header {
  display: none !important;
}

.filter-group {
  display: flex;
  gap: 8px;
}

.filter-chip {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px 14px;
  border-radius: 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-chip:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-chip.active {
  background: #232736;
  color: #fff;
  border-color: var(--accent-primary);
}

.meta-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 600;
}

.meta-separator {
  color: var(--border-subtle);
}

.clock-display {
  font-family: var(--font-mono);
  color: #fff;
  font-weight: 700;
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL Y VISTAS
   ========================================================================== */
#appContainer {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  transition: top 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

body.header-hidden #appContainer {
  top: 0;
}

.view-section {
  display: block;
  max-width: 1600px;
  margin: 0 auto;
  animation: viewFadeIn 0.22s ease-out;
}

@keyframes viewFadeIn {
  from {
    opacity: 0.85;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-section.hidden,
.hidden {
  display: none !important;
}

/* ==========================================================================
   BADGES Y ESTILOS "AL AIRE" (VERDE) VS "EN VIVO" (ROJO)
   ========================================================================== */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Verde para programas que están emitiéndose en este momento */
.badge-al-aire,
.live-pill:not(.badge-en-vivo) {
  background-color: var(--live-green);
  color: #ffffff;
}

/* Rojo exclusivo para transmisiones en directo ([En vivo]) */
.badge-en-vivo {
  background-color: var(--live-red) !important;
  color: #ffffff !important;
}

@keyframes pulseRed {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.9; }
  100% { transform: scale(1); opacity: 1; }
}

.tag-pill {
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #2a2f3f;
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.2);
  text-transform: uppercase;
}

/* ==========================================================================
   1. VISTA INICIO — HERO BANNER REDISEÑADO (PLANO, NÍTIDO, CENTRADO Y PROGRESO)
   ========================================================================== */
.hero-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px 24px 16px 24px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: border-color 0.2s ease;
}

.hero-main-layout {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 28px;
  width: 100%;
}

.hero-info-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.hero-top-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-channel-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  transition: background 0.18s ease;
}

.hero-ch-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.hero-ch-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.hero-content {
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hero-content.is-fading {
  opacity: 0.1;
  transform: translateY(4px);
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  transition: color 0.18s ease;
}

.hero-content:hover .hero-title {
  color: var(--accent-cyan);
}

.hero-episode {
  font-size: 0.95rem;
  color: #93c5fd;
  margin-bottom: 8px;
  font-weight: 600;
}

.hero-desc {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 800px;
}

.hero-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.15s ease;
}

.hero-action-btn:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
}

.hero-banner-side {
  width: 440px;
  max-width: 48%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hero-banner-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: #090c10;
  display: block;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.hero-banner-img.is-fading {
  opacity: 0.15;
  transform: scale(0.98);
}

/* Controles Centrados */
.hero-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding-top: 2px;
}

.hero-controls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.hero-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.hero-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.hero-btn:active {
  transform: translateY(0) scale(0.95);
}

/* Barra de progreso de rotación */
.hero-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.hero-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #00e676);
  transition: width 0.1s linear;
}

@media (max-width: 900px) {
  .hero-main-layout {
    flex-direction: column-reverse;
    gap: 16px;
  }
  .hero-banner-side {
    width: 100%;
    max-width: 100%;
  }
  .hero-title {
    font-size: 1.45rem;
  }
}

/* ==========================================================================
   1. VISTA INICIO — TARJETAS CON LÍMITE
   ========================================================================== */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.section-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  content-visibility: auto;
  contain-intrinsic-size: 320px 240px;
  display: flex;
  flex-direction: column;
}

.card-item:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
}

.card-banner-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1f2432;
  overflow: hidden;
}

.card-banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-banner.loaded {
  opacity: 1;
}

.card-badge-container {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.card-time-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.card-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-header-ch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ch-logo-tiny {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.ch-title-bar {
  flex: 1;
  min-width: 0;
}

.ch-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #d1d5db;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.btn-fav {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--star-gold);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.card-prog-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
}

.card-prog-sub {
  font-size: 0.92rem;
  color: #60a5fa;
  margin-bottom: 10px;
}

.card-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: auto;
}

.card-progress-fill {
  height: 100%;
  background: var(--live-green);
  border-radius: 2px;
}

/* Botón Cargar Más Canales */
.load-more-box {
  display: flex;
  justify-content: center;
  margin: 32px 0;
}

.btn-load-more {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.btn-load-more:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

/* ==========================================================================
   2. VISTA LISTA COMPACTA
   Logo, actual con hora verde y título blanco negrita, siguiente atenuado
   ========================================================================== */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-row {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  content-visibility: auto;
  contain-intrinsic-size: 100% 74px;
}

.list-row:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.18);
}

.list-ch-col {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 220px;
  min-width: 220px;
}

.list-ch-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 2px;
}

.list-ch-name-group {
  min-width: 0;
}

.list-ch-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.list-ch-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.list-programs-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Programa Actual: Hora en verde, Título en blanco negrita, prioridad de espacio */
.list-prog-now {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.list-time-now {
  font-family: var(--font-mono);
  color: var(--live-green);
  font-weight: 800;
  font-size: 1.1rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.list-title-now {
  font-size: 1.12rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}

/* Siguiente Programa: Hora y título atenuados */
.list-prog-next {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.list-time-next {
  font-family: var(--font-mono);
  color: var(--text-dimmed);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.list-title-next {
  font-size: 0.96rem;
  color: var(--text-dimmed);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}

/* Indicador de Capítulo (Punto azul siempre visible, texto solo si cabe) */
.list-chapter-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  flex: 0 1 auto;
  min-width: 14px;
  overflow: hidden;
}

.chapter-dot {
  color: #38bdf8; /* Punto azul brillante */
  font-weight: 900;
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}

.chapter-name {
  font-size: 0.92rem;
  color: #93c5fd;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 10;
  min-width: 0;
}

.list-chapter-badge.dot-only .chapter-name {
  display: none !important;
}

.list-chapter-badge.muted .chapter-dot {
  color: #64748b;
}

.list-chapter-badge.muted .chapter-name {
  color: var(--text-dimmed);
}

/* Indicador EN VIVO Compacto / Adaptativo */
.live-indicator-compact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--live-red);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

.live-indicator-compact .live-red-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ffffff;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes pulseRedDot {
  0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.15); opacity: 0.9; box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* En el popup de Próximos Programas (vista compacta), usar siempre el punto rojo */
.quick-item .live-indicator-compact {
  background: transparent !important;
  padding: 0 !important;
  gap: 0 !important;
  border-radius: 0 !important;
}

.quick-item .live-indicator-compact .live-label-text {
  display: none !important;
}

.quick-item .live-indicator-compact .live-red-dot {
  width: 8px !important;
  height: 8px !important;
  background-color: #ef4444 !important;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.8) !important;
  animation: pulseRedDot 1.8s infinite ease-in-out !important;
}

.quick-item .chapter-dot {
  margin-left: 2px;
}

/* ==========================================================================
   CARTAS DE CANALES EN EMISIÓN (Pestaña Inicio)
   ========================================================================== */
.card-item-emision {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease, box-shadow 0.22s ease;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.card-item-emision:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(59, 130, 246, 0.2);
}

.emision-banner-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111420;
  overflow: hidden;
}

.emision-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
  display: block;
}

.card-item-emision:hover .emision-banner-img {
  transform: scale(1.04);
}

.emision-banner-img.fallback-img {
  object-fit: contain !important;
  padding: 24px;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.9), #0f172a);
}

.emision-banner-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(17, 20, 32, 0.95) 0%, rgba(17, 20, 32, 0.25) 45%, transparent 70%);
  pointer-events: none;
}

.emision-ch-logo-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  aspect-ratio: 1 / 1;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

.emision-ch-logo {
  width: 100%;
  height: 100%;
  max-width: 30px;
  max-height: 30px;
  object-fit: contain;
}

.emision-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 3;
}

.emision-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.3s ease;
}

.emision-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.emision-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.emision-label {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.label-ahora {
  color: #38bdf8;
}

.label-despues {
  color: #94a3b8;
}

.emision-title {
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.title-now {
  font-weight: 700;
  color: #f8fafc;
}

.title-next {
  font-weight: 500;
  color: #94a3b8;
  font-size: 0.88rem;
}

/* ==========================================================================
   4. VISTA CANALES (Selector lateral + Banner a la derecha + solo hora de inicio)
   ========================================================================== */
.guide-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  height: calc(100vh - 170px);
}

.guide-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-search {
  width: 100%;
  height: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.guide-channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.guide-ch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.guide-ch-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.guide-ch-item.active {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.guide-ch-item img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.guide-ch-item span {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-main {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.guide-header-sticky-wrap {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  z-index: 10;
}

.guide-channel-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.guide-ch-header-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.guide-ch-arrow-btn {
  display: none !important;
}

.guide-ch-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.guide-ch-info h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.date-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
  overflow-x: auto;
}

.date-tab-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.date-tab-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.guide-timeline {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Tarjeta en Vista Canales: Banner a la DERECHA, solo hora de inicio */
.guide-prog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  transition: background 0.15s;
}

.guide-prog-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.18);
}

.guide-prog-card.is-live {
  border-left: 4px solid var(--live-green);
  background: #162320;
}

.guide-prog-card.is-broadcast-live {
  border-left: 4px solid var(--live-red);
  background: #241619;
}

.guide-prog-content {
  flex: 1;
  min-width: 0;
}

.guide-prog-time-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

/* Solo hora de inicio */
.guide-prog-start-time {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--live-green);
}

.guide-prog-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}

.guide-prog-episode {
  font-size: 0.95rem;
  font-weight: 600;
  color: #60a5fa;
  margin-bottom: 6px;
}

.guide-prog-chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  margin-bottom: 6px;
}

.guide-chip-year,
.guide-chip-cat {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 7px;
  border-radius: 4px;
}

.guide-chip-rating {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
}

.guide-prog-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Banner a la derecha */
.guide-prog-banner {
  width: 170px;
  min-width: 170px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  background: #1f2432;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   POPUP RÁPIDO VISTA LISTA
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  animation: modalOverlayFade 0.18s ease-out;
}

@keyframes modalOverlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalContentPop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.quick-popup-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  animation: modalContentPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.quick-popup-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quick-ch-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.quick-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.quick-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.quick-prog-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* REQUERIMIENTO ESTRICTO: Solo Hora y Título */
.quick-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.quick-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.quick-item.now-playing {
  border-left: 3px solid var(--live-green);
  background: rgba(16, 185, 129, 0.1);
}

.quick-time {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  color: var(--live-green);
  min-width: 55px;
}

.quick-item-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}

.quick-popup-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  width: 100%;
  background: #232838;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: #2c3246;
}

/* ==========================================================================
   MODAL DETALLE DEL PROGRAMA
   ========================================================================= */
.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  animation: modalContentPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-banner-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  overflow: hidden;
}

.modal-banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-banner-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.3) 40%, transparent 65%),
              linear-gradient(to bottom, rgba(15, 23, 42, 0.75) 0%, transparent 45%);
  pointer-events: none;
  z-index: 1;
}

.btn-close-banner {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.btn-close-banner:hover {
  background: rgba(239, 68, 68, 0.85);
  transform: scale(1.08);
}

/* Modal Banner Overlays */
.modal-banner-bottom-left {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-banner-ch-badge {
  width: 44px;
  height: 44px;
  aspect-ratio: 1 / 1;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
  flex-shrink: 0;
}

.modal-banner-ch-logo {
  width: 100%;
  height: 100%;
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
}

.modal-banner-time-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 0 12px;
  color: #f1f5f9;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.modal-banner-bottom-right {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.modal-banner-remaining-badge {
  background: rgba(59, 130, 246, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 6px 12px;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.45);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .modal-banner-bottom-left {
    bottom: 10px;
    left: 10px;
    gap: 6px;
  }
  .modal-banner-ch-badge {
    width: 36px;
    height: 36px;
  }
  .modal-banner-ch-logo {
    max-width: 28px;
    max-height: 28px;
  }
  .modal-banner-time-badge {
    height: 36px;
    padding: 0 8px;
    font-size: 0.78rem;
    gap: 5px;
  }
  .modal-banner-bottom-right {
    bottom: 10px;
    right: 10px;
    gap: 4px;
  }
  .modal-banner-remaining-badge {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
}

/* Modal Body (Texto Debajo del Banner) */
.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 1. Título */
.modal-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin: 0;
}

/* 2. Capítulo */
.modal-episode {
  font-size: 1.05rem;
  font-weight: 700;
  color: #38bdf8;
  margin: -4px 0 0 0;
}

/* 3. Descripción */
.modal-desc-box {
  margin: 0;
}

.modal-desc {
  font-size: 1.02rem;
  color: #e2e8f0;
  line-height: 1.6;
  margin: 0;
  white-space: pre-line;
}

/* 4. Categorías */
.modal-categories-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.categories-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  transition: all 0.15s ease;
}

.category-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
}

.category-chip.tag-chip {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}

.category-chip.tag-chip:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: rgba(245, 158, 11, 0.65);
}

/* 5. Reparto y Créditos */
.modal-credits-section {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 6. Otra Información (Año, País, etc.) */
.modal-extra-info-section {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.extra-info-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.extra-info-items .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.extra-info-items .meta-label {
  color: #64748b;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.extra-info-items strong {
  color: #e2e8f0;
  font-weight: 600;
}

.meta-badge-rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 5px;
  letter-spacing: 0.03em;
}

.credit-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (min-width: 600px) {
  .credit-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: baseline;
    gap: 12px;
  }
}

.credit-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.credit-val {
  font-size: 0.95rem;
  color: #e5e7eb;
  line-height: 1.45;
}

.actors-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.actor-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.actor-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ==========================================================================
   MODAL AJUSTES
   ========================================================================= */
.settings-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  width: 100%;
  max-width: 500px;
  padding: 24px;
  animation: modalContentPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  display: block;
}

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

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #374151;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.setting-item-vertical {
  padding: 16px 0;
}

.input-url {
  width: 100%;
  height: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0 10px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin: 8px 0 12px 0;
}

.url-actions {
  display: flex;
  gap: 10px;
}

.btn-primary {
  background: var(--accent-primary);
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.settings-footer-info {
  margin-top: 18px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dimmed);
}

/* ==========================================================================
   SPINNER / LOADER
   ========================================================================= */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 13, 19, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.loader-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ==========================================================================
   TIRADOR DE HOJA INFERIOR (BOTTOM SHEET HANDLE)
   ========================================================================== */
.sheet-handle {
  display: none;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  margin: 12px auto 4px auto;
  flex-shrink: 0;
}

/* ==========================================================================
   VISTA BÚSQUEDA Y RESULTADOS (CANALES, AL AIRE, PRÓXIMOS Y FINALIZADOS)
   ========================================================================== */
.search-results-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 10px 0 60px 0;
  max-width: 1400px;
  margin: 0 auto;
}

.search-results-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.search-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-section-title.past-header {
  color: var(--text-muted);
}

.search-count-pill {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.search-count-pill.live {
  background: rgba(16, 185, 129, 0.2);
  color: var(--live-green);
}

.search-count-pill.upcoming {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.search-count-pill.past {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-dimmed);
}

.live-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--live-green);
  box-shadow: 0 0 10px var(--live-green);
  display: inline-block;
  animation: liveDotPulse 1.8s infinite;
}

@keyframes liveDotPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* 1. Grid de canales encontrados */
.search-channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}

.search-ch-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  text-align: center;
}

.search-ch-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.search-ch-logo-wrap {
  width: 58px;
  height: 58px;
  background: #ffffff;
  border-radius: 8px;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.search-ch-logo-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.search-ch-card-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.search-ch-card-id {
  font-size: 0.74rem;
  color: var(--text-dimmed);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* 2. Lista de tarjetas de programas */
.search-prog-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-prog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  position: relative;
  overflow: hidden;
}

.search-prog-card:hover {
  transform: translateY(-1px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.22);
}

.search-prog-card.is-live {
  border-left: 4px solid var(--live-green);
  background: rgba(16, 185, 129, 0.05);
}

.search-prog-card.is-broadcast-live {
  border-left: 4px solid var(--live-red);
  background: rgba(239, 68, 68, 0.06);
}

.search-prog-card.is-upcoming {
  border-left: 4px solid #3b82f6;
  background: var(--bg-card);
}

.search-prog-card.is-past {
  opacity: 0.52;
  background: rgba(255, 255, 255, 0.015);
  border-left: 4px solid rgba(255, 255, 255, 0.15);
}

.search-prog-card.is-past:hover {
  opacity: 0.85;
}

.search-prog-ch-logo {
  width: 48px;
  height: 48px;
  background: #ffffff;
  border-radius: 8px;
  padding: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.search-prog-ch-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.search-prog-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.search-prog-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-status-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.search-status-badge.live {
  background: var(--live-green);
  color: #ffffff;
}

.search-status-badge.en-vivo {
  background: var(--live-red);
  color: #ffffff;
}

.search-status-badge.upcoming {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.search-status-badge.past {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-dimmed);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-prog-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.search-prog-episode {
  font-size: 0.88rem;
  font-weight: 600;
  color: #60a5fa;
}

.search-prog-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.search-prog-meta-text {
  line-height: 1.4;
}

.search-prog-progress-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 5px;
  max-width: 260px;
}

.search-prog-progress-bar {
  height: 100%;
  background: var(--live-green);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.search-prog-banner {
  width: 96px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #1f2432;
  flex-shrink: 0;
}

.search-prog-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  color: var(--text-muted);
  text-align: center;
}

.search-empty-icon {
  color: var(--text-dimmed);
  opacity: 0.6;
}

.search-empty-text {
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE DESIGN — EXPERIENCIA MÓVIL TIPO APP (< 768px)
   ========================================================================== */
@media (max-width: 900px) {
  .guide-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .guide-sidebar {
    max-height: 240px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
    --subheader-height: 0px;
  }

  /* 1. Cabecera Móvil Compacta */
  #mainHeader {
    height: var(--header-height);
    padding: 0 12px;
    gap: 8px;
  }

  .brand-logo-text {
    font-size: 1.45rem;
  }

  .brand-logo-dot {
    font-size: 1.65rem;
  }

  /* Botón Lupa en Móvil: aspecto limpio de App */
  .btn-search-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    padding: 0;
  }

  .btn-search-toggle:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.15);
  }

  /* Barra de Búsqueda Móvil: oculta por defecto, se despliega al presionar la lupa */
  .search-box {
    display: none;
  }

  .search-box.mobile-open {
    display: flex !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0 10px;
    background: #0f121a;
    z-index: 150;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.85);
    animation: searchExpand 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes searchExpand {
    from {
      opacity: 0;
      transform: translateY(-8px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .btn-close-mobile-search {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
  }

  .btn-close-mobile-search:active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
  }

  .search-box.mobile-open input {
    flex: 1;
    height: 38px;
    background: #181d2a;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 0 34px 0 38px;
    font-size: 0.92rem;
    color: #fff;
  }

  .search-box.mobile-open input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
  }

  .search-box.mobile-open .search-icon {
    left: 54px;
    width: 16px;
    height: 16px;
    color: #94a3b8;
  }

  .search-box.mobile-open .btn-clear {
    right: 18px;
  }

  .header-right {
    gap: 4px;
  }

  .btn-icon {
    width: 36px;
    height: 36px;
  }

  .desktop-only {
    display: none !important;
  }

  /* 2. Barra de Navegación Inferior Nativa (Bottom App Bar Fijo e Independiente) */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    background: #11141e !important;
    border-top: 1px solid var(--border-subtle) !important;
    border-radius: 0 !important;
    align-items: center !important;
    justify-content: space-around !important;
    z-index: 150 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
  }

  .view-tabs .tab-btn {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 0;
    background: transparent !important;
    border: none !important;
    color: var(--text-muted);
    padding: 4px 0;
    transition: color 0.15s ease, transform 0.1s ease;
    user-select: none;
  }

  .view-tabs .tab-btn:active {
    transform: scale(0.92);
  }

  .view-tabs .tab-btn.active {
    color: var(--accent-primary) !important;
    font-weight: 700;
  }

  .view-tabs .tab-btn svg {
    width: 20px;
    height: 20px;
  }

  /* 3. Subheader Móvil con Desplazamiento Horizontal Suave */
  #subHeader {
    height: var(--subheader-height);
    padding: 0 12px;
  }

  .filter-group {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
  }

  .filter-group::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    padding: 4px 12px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .meta-info {
    font-size: 0.8rem;
    gap: 6px;
    flex-shrink: 0;
  }

  /* 4. Contenedor Principal Ajustado al Bottom Bar */
  #appContainer {
    top: var(--header-height);
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    padding: 8px 12px calc(20px + env(safe-area-inset-bottom, 0px)) 12px;
    -webkit-overflow-scrolling: touch;
    transition: top 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  body.header-hidden #appContainer {
    top: 0;
  }

  /* 5. Banner Hero en Móvil */
  .hero-section {
    padding: 14px 14px 12px 14px;
    margin-bottom: 18px;
    gap: 12px;
  }

  .hero-main-layout {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .hero-banner-side {
    width: 100%;
    max-width: 100%;
  }

  .hero-title {
    font-size: 1.35rem;
    margin-bottom: 4px;
    line-height: 1.25;
  }

  .hero-desc {
    font-size: 0.88rem;
    -webkit-line-clamp: 2;
  }

  .hero-action-btn {
    width: 100%;
    justify-content: center;
    padding: 9px 16px;
  }

  .hero-btn {
    width: 44px;
    height: 40px;
    font-size: 0.95rem;
  }

  /* 6. Tarjetas en 1 Columna en Móvil */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card-item {
    border-radius: 10px;
  }

  /* 7. Modales en Formato Bottom Sheet Móvil */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
    background: rgba(0, 0, 0, 0.75);
  }

  .sheet-handle {
    display: block;
  }

  .quick-popup-content,
  .modal-content,
  .settings-content {
    border-radius: 20px 20px 0 0 !important;
    max-height: 85vh !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8) !important;
    animation: sheetSlideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  @keyframes sheetSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .quick-popup-header {
    padding: 12px 16px;
  }

  .quick-item {
    padding: 10px 12px;
    font-size: 0.92rem;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-title {
    font-size: 1.35rem;
  }

  /* 8. Vista Lista en Móvil: Solo Logo del Canal */
  .list-row {
    padding: 10px 12px;
    gap: 12px;
    border-radius: 10px;
  }

  .list-ch-col {
    width: 44px !important;
    min-width: 44px !important;
    padding: 0 !important;
    gap: 0 !important;
    justify-content: center;
  }

  .list-ch-name-group {
    display: none !important;
  }

  .list-ch-logo {
    width: 42px !important;
    height: 42px !important;
  }

  .list-programs-col {
    flex: 1;
    min-width: 0;
    gap: 3px;
  }

  .list-prog-now {
    gap: 8px;
  }

  .list-time-now {
    font-size: 0.98rem;
  }

  .list-title-now {
    font-size: 1rem;
    font-weight: 700;
  }

  /* REQUERIMIENTO: En móvil ocultar el texto del capítulo y mostrar solo el punto azul */
  .list-chapter-badge .chapter-name {
    display: none !important;
  }

  /* REQUERIMIENTO: En móvil en vista lista, mostrar 'EN VIVO' con un punto rojo pulsante */
  .list-prog-now .live-indicator-compact,
  .list-prog-next .live-indicator-compact {
    background: transparent !important;
    padding: 0 !important;
    gap: 0 !important;
    border-radius: 0 !important;
  }

  .list-prog-now .live-indicator-compact .live-label-text,
  .list-prog-next .live-indicator-compact .live-label-text {
    display: none !important;
  }

  .list-prog-now .live-indicator-compact .live-red-dot,
  .list-prog-next .live-indicator-compact .live-red-dot {
    width: 8px !important;
    height: 8px !important;
    background-color: #ef4444 !important;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.8) !important;
    animation: pulseRedDot 1.8s infinite ease-in-out !important;
  }

  .list-prog-next {
    gap: 8px;
  }

  .list-time-next {
    font-size: 0.84rem;
  }

  .list-title-next {
    font-size: 0.88rem;
  }



  /* 10. Vista Canales en Móvil: Banners 1:1, Selector Desplegable de Canales */
  #guideSelectedMeta {
    display: none !important;
  }

  /* Cabecera del Canal en Móvil (Trigger de menú y opciones al mantener presionado) */
  .guide-channel-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    background: #151924;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.18s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  }

  .guide-channel-header:active {
    background: #1c2232;
    border-color: rgba(56, 189, 248, 0.4);
  }

  .guide-ch-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
  }

  .guide-ch-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px;
    flex-shrink: 0;
  }

  #guideSelectedName {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
  }

  /* Flecha a la derecha para desplegar selector de canales */
  .guide-ch-arrow-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .guide-ch-arrow-btn:active {
    background: rgba(56, 189, 248, 0.25);
    transform: scale(0.95);
  }

  .picker-chevron {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .picker-chevron.open {
    transform: rotate(90deg);
  }

  /* Contenedor relativo en móvil para posicionar el menú desplegable */
  .guide-layout {
    display: block !important;
    position: relative;
    height: auto !important;
    overflow: visible !important;
  }

  .guide-main {
    display: block !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    height: auto !important;
  }

  /* Bloque anclado (sticky) con cabecera de canal y pestañas de fecha */
  .guide-header-sticky-wrap {
    position: sticky;
    top: 0;
    z-index: 85;
    background: #0b0d13;
    margin: -8px -12px 10px -12px;
    padding: 8px 12px 6px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }

  /* Cortina superior opaca que bloquea completamente los programas que suben al deslizar */
  .guide-header-sticky-wrap::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: -20px;
    right: -20px;
    height: 150px;
    background: #0b0d13;
    pointer-events: none;
  }

  .guide-header-sticky-wrap .guide-channel-header {
    margin-bottom: 6px !important;
  }

  .guide-header-sticky-wrap .date-tabs {
    padding: 2px 0 4px 0 !important;
    background: transparent !important;
    border-bottom: none !important;
    gap: 6px !important;
  }

  /* Menú desplegable móvil (oculto por defecto, se despliega al tocar 'Cambiar') */
  .guide-sidebar {
    display: none !important;
  }

  .guide-sidebar.mobile-open {
    display: flex !important;
    position: fixed;
    top: calc(var(--header-height) + 8px);
    left: 12px;
    right: 12px;
    z-index: 160;
    background: #141824;
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.06);
    max-height: 380px;
    overflow: hidden;
    animation: dropdownSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }

  body.header-hidden .guide-sidebar.mobile-open {
    top: 8px;
  }

  @keyframes dropdownSlideDown {
    from {
      opacity: 0;
      transform: translateY(-8px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .guide-sidebar.mobile-open .sidebar-header {
    padding: 10px 12px;
    background: #191f2e;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .guide-sidebar.mobile-open .sidebar-search {
    flex: 1;
    min-width: 0;
    height: 38px;
    font-size: 0.9rem;
    border-radius: 8px;
  }

  .sidebar-close-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
  }

  .sidebar-close-btn:active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
  }

  .guide-sidebar.mobile-open .guide-channel-list {
    max-height: 310px;
    padding: 6px;
    overscroll-behavior: contain;
  }

  .guide-sidebar.mobile-open .guide-ch-item {
    padding: 10px 12px;
    border-radius: 8px;
    gap: 12px;
  }

  .guide-sidebar.mobile-open .guide-ch-item img {
    width: 34px;
    height: 34px;
  }

  .guide-sidebar.mobile-open .guide-ch-item span {
    font-size: 0.94rem;
  }

  .guide-timeline {
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    height: auto !important;
    gap: 10px;
    padding-bottom: 32px;
  }

  .guide-prog-card {
    padding: 10px 12px;
    gap: 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 84px;
  }

  .guide-prog-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
  }

  .guide-prog-time-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin-bottom: 2px;
  }

  .guide-prog-start-time {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 800;
    color: var(--live-green);
    white-space: nowrap;
  }

  .guide-prog-card .live-pill {
    font-size: 0.7rem !important;
    padding: 2px 6px !important;
    letter-spacing: 0.4px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .guide-prog-title {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #ffffff;
  }

  .guide-prog-episode {
    font-size: 0.84rem;
    font-weight: 600;
    color: #60a5fa;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Ocultar descripción en móvil para no apretar la tarjeta */
  .guide-prog-desc {
    display: none !important;
  }

  /* Banner en formato cuadrado 1:1 */
  .guide-prog-banner {
    width: 72px !important;
    min-width: 72px !important;
    height: 72px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 8px !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
  }

  /* 11. Botón Cargar Más */
  .btn-load-more {
    width: 100%;
    padding: 12px;
    font-size: 0.92rem;
  }

  /* 12. Vista Búsqueda en Móvil */
  .search-results-container {
    gap: 22px;
    padding: 6px 0 40px 0;
  }

  .search-section-title {
    font-size: 1.08rem;
  }

  .search-channels-grid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 8px;
  }

  .search-ch-card {
    padding: 10px 6px;
    border-radius: 10px;
  }

  .search-ch-logo-wrap {
    width: 44px;
    height: 44px;
  }

  .search-ch-card-name {
    font-size: 0.78rem;
  }

  .search-prog-card {
    padding: 10px 12px;
    gap: 12px;
    border-radius: 8px;
  }

  .search-prog-ch-logo {
    width: 40px;
    height: 40px;
  }

  .search-prog-title {
    font-size: 0.95rem;
  }

  .search-prog-meta-row {
    font-size: 0.78rem;
  }

  .search-prog-banner {
    display: none !important;
  }
}


/* Channel Actions Sheet & Modal (Long-Press / Hold) */
.channel-actions-sheet {
  background: #141824;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  animation: modalContentPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.channel-actions-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.channel-actions-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.channel-actions-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
  flex-shrink: 0;
}

.channel-actions-header-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.channel-actions-badge {
  font-size: 0.68rem;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.channel-actions-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.channel-actions-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.channel-action-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.channel-action-item:hover,
.channel-action-item:active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.channel-action-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.channel-action-icon.feed-icon {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.channel-action-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.channel-action-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #ffffff;
}

.channel-action-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.channel-action-count {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  background: #1e293b;
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  color: #38bdf8;
  flex-shrink: 0;
}



/* Fullscreen Img */
.fullscreen-img-content {
  background: transparent;
  box-shadow: none;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  width: 100vw;
  height: 100vh;
}
#fullscreenImg {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}


.ch-row-header {
  z-index: 15;
}


/* Mobile Header Layout Fixes */
.header-menu {
  display: flex !important;
  align-items: center;
  gap: 8px;
}
@media (max-width: 768px) {
  .header-menu {
    position: static;
    display: flex !important;
  }
  .btn-search-toggle, .btn-settings {
    position: static !important;
  }
}

.btn-only-arrow {
  padding: 8px !important;
  border-radius: 50% !important;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-only-arrow svg {
  margin: 0 !important;
}


