/* Estructura general (menu lateral / barra inferior), secciones y cuadricula de posters. */

/* ---------- estructura general ---------- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.sidenav {
  order: 2; position: fixed; bottom: 0; left: 0; right: 0; display: flex;
  background: var(--bg-nav); border-top: 1px solid var(--border-soft); z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
}
.sidenav .brand, .sidenav .nav-group { display: none; }
.sidenav .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 10px 0; background: none; border: none; color: var(--text-faint);
  font-size: 10px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: transform var(--dur) var(--ease), color .2s, background .2s, box-shadow var(--dur) var(--ease);
  min-width: 0;
}
/* con 7 pestañas el texto no debe empujar a las vecinas en celulares chicos */
.sidenav .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidenav .tab .ic { width: 21px; height: 21px; transition: transform var(--dur) var(--ease); }
.sidenav .tab.active { color: var(--accent); }
.sidenav .tab.active .ic { transform: translateY(-2px) scale(1.08); }
.sidenav .tab:active { transform: scale(.9); }
/* celular: Estrenos, Top, Proximos y En streaming van dentro de "Descubrir" (app-shell.js),
   asi la barra queda en 5 botones anchos en vez de 7 apretados */
.sidenav .tab[data-tab="estrenos"], .sidenav .tab[data-tab="top"], .sidenav .tab[data-tab="proximos"], .sidenav .tab[data-tab="streaming"], .sidenav .tab[data-tab="temporada"] { display: none; }
.content-header .title-desk { display: none; }
.discover-pills:empty { display: none; }
/* las pildoras de Descubrir se deslizan si no caben en un iPhone (343 px utiles) */
.content .discover-pills { gap: 6px; }
.discover-pills .group-tab { padding: 7px 12px; }

.content {
  order: 1; flex: 1; width: 100%; max-width: 1600px; margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 16px calc(110px + env(safe-area-inset-bottom));
}
.content-header h1 { font-family: var(--font-title); font-size: 28px; font-weight: 700; letter-spacing: -.025em; margin: 0 0 18px; line-height: 1.15; }

/* iconos de linea (Lucide) dibujados en index.html */
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
/* la sombra va como box-shadow (no filter: drop-shadow): asi el SVG sigue siendo
   vector y no se ve pixelado. El radio (25%) es el mismo rx="16" del dibujo */
.logo-mark { width: 36px; height: 36px; flex-shrink: 0; border-radius: 25%; box-shadow: 0 6px 16px var(--glow-strong); }

@media (min-width: 900px) {
  .app-shell { flex-direction: row; }
  .sidenav {
    order: 1; position: sticky; top: 0; bottom: auto; left: auto; right: auto;
    flex-direction: column; align-items: stretch; width: 236px; flex-shrink: 0; height: 100vh;
    border-top: none; border-right: 1px solid var(--border-soft); padding: 22px 14px; gap: 2px;
  }
  .sidenav .brand { display: flex; align-items: center; gap: 11px; color: var(--text); font-family: var(--font-title); font-weight: 700; font-size: 23px; letter-spacing: -.02em; padding: 2px 10px 16px; }
  .sidenav .nav-group { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); padding: 14px 12px 6px; }
  .sidenav .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 14px; padding: 10px 12px; border-radius: 12px; color: var(--text-dim); }
  .sidenav .tab .ic { width: 19px; height: 19px; }
  .sidenav .tab:hover { color: var(--text); background: var(--hover-soft); transform: translateX(3px); }
  .sidenav .tab:hover .ic { transform: scale(1.12) rotate(-4deg); color: var(--accent); }
  .sidenav .tab.active { color: var(--text); background: var(--bg-solid); box-shadow: 0 0 0 1px var(--ring), 0 8px 20px var(--glow); }
  .sidenav .tab.active .ic { color: var(--accent); transform: none; }
  .sidenav .tab[data-tab="opciones"] { margin-top: auto; }
  /* PC: el menu lateral tiene sitio para todo; "Descubrir" y sus pildoras sobran */
  .sidenav .tab[data-tab="estrenos"], .sidenav .tab[data-tab="top"], .sidenav .tab[data-tab="proximos"], .sidenav .tab[data-tab="streaming"], .sidenav .tab[data-tab="temporada"] { display: flex; }
  .sidenav .tab-discover, .content .discover-pills { display: none; }
  .content-header .title-desk { display: inline; }
  .content-header .title-mobile { display: none; }
  .content { order: 2; padding: 30px 38px 44px; }
  .content-header h1 { font-size: 36px; }
  .fab { bottom: 32px !important; right: 40px !important; }
}

/* ---------- secciones ---------- */
.screen { display: none; }
.screen.active { display: block; }

/* separacion clara entre Peliculas / Series / Animes */
.estrenos-section { padding-bottom: 34px; margin-bottom: 34px; border-bottom: 1px solid var(--border-soft); }
.estrenos-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.section-title { font-family: var(--font-title); font-size: 19px; font-weight: 700; letter-spacing: -.02em; color: var(--text); margin: 28px 0 14px; }
.section-title:first-child { margin-top: 0; }
.estrenos-section .section-title { margin-top: 0; }

.carousel { position: relative; }

/* cuadricula en todas las pantallas: 2 por fila en celular, mas segun quepan.
   sin carrusel horizontal, para que "Ver mas" sea la unica forma de ver mas */
.row-scroll, .library-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 14px;
}

.ver-mas-btn {
  display: block; margin: 16px auto 0; padding: 10px 26px; border-radius: 999px;
  background: var(--accent-grad) border-box; border: none; color: var(--accent-text);
  font-size: 13px; font-weight: 700; font-family: var(--font-body); cursor: pointer;
  box-shadow: 0 8px 20px var(--glow);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), filter .2s;
}
.ver-mas-btn:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 28px var(--glow-strong); }
.ver-mas-btn:active { transform: scale(.94); }
.ver-mas-btn:disabled { opacity: .55; cursor: default; transform: none; }
/* final honesto de una seccion: ya se mostro todo (ver fullRowsCount() en estrenos.js) */
.end-of-list { text-align: center; font-size: 12.5px; color: var(--text-faint); margin: 18px 0 0; }

/* PC/tablet: cuadricula que reparte todo el ancho, sin huecos irregulares */
@media (min-width: 600px) {
  .row-scroll, .library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .row-scroll, .library-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 26px 18px; }
}
