/* static/css/sidebar.css — menú lateral de layout.html (toda la navegación vive acá) */

.app-shell {
  display: flex;
  /* body es una columna flex de alto 100%: sin esto el contenedor se encogía y el menú se cortaba */
  flex: 1 0 auto;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--sidebar-fondo);
  border-right: 1px solid var(--sidebar-borde);
  color: #fff;
  transition: transform 0.25s ease;
  z-index: 1040;
}

/* Pegado arriba y del alto de la pantalla; si no entra, se desplaza solo el menú */
.sidebar-inner {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 1.3rem 0.9rem 1.1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-inner::-webkit-scrollbar { width: 6px; }
.sidebar-inner::-webkit-scrollbar-thumb { border-radius: 6px; background: rgba(255, 255, 255, 0.2); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 0 0.35rem 1.1rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}

.sidebar-brand:hover { color: #fff; }

.sidebar-brand img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16);
  transition: transform 0.25s ease;
}

html[data-tema="oscuro"] .sidebar-brand img { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12); }
.sidebar-brand:hover img { transform: scale(1.06); }

.sidebar-brand-nombre {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.28rem;
  line-height: 1.1;
}

.sidebar-brand-slogan { font-size: 0.76rem; opacity: 0.72; line-height: 1.3; }

/* Hora y clima de El Alto, discreto bajo el logo */
.sidebar-clima {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  margin: -0.3rem 0.2rem 0.9rem;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

html[data-tema="oscuro"] .sidebar-clima {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(29, 107, 255, 0.1);
  box-shadow: none;
}

.clima-hora,
.clima-temp { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.clima-hora time { font-weight: 700; letter-spacing: 0.02em; }
.clima-temp #climaGrados { font-weight: 700; }
.clima-temp small { opacity: 0.65; font-size: 0.7rem; }
.sidebar-clima .icono { opacity: 0.8; }
html[data-tema="oscuro"] .sidebar-clima .icono { color: #7dd3fc; opacity: 1; }
.clima-sep { width: 1px; height: 16px; background: rgba(255, 255, 255, 0.2); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--sidebar-texto);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar-nav a .icono { font-size: 1.05rem; width: 24px; text-align: center; }
.sidebar-nav a:hover { background: var(--sidebar-hover); color: #fff; transform: translateX(2px); }

.sidebar-nav a.activo {
  background: var(--sidebar-activo);
  color: var(--sidebar-activo-texto);
  font-weight: 600;
  box-shadow: var(--sidebar-activo-glow);
}

.sidebar-nav .vivo-punto {
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: pulso-vivo 1.6s infinite;
}

@keyframes pulso-vivo {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* ---- Parte de abajo: tema y sesión ---- */
.sidebar-pie {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 1rem;
}

.selector-tema {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-texto);
  font-size: 0.9rem;
  font-weight: 500;
}

.selector-tema-pista {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 58px;
  height: 28px;
  padding: 0 7px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.8rem;
}

.selector-tema-pista::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFD166;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

html[data-tema="oscuro"] .selector-tema-pista::after {
  transform: translateX(30px);
  background: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.selector-tema-pista .icono { position: relative; z-index: 1; }
.selector-tema-pista .tema-sol { color: #1a1a1a; }
html[data-tema="oscuro"] .selector-tema-pista .tema-sol { color: rgba(255, 255, 255, 0.5); }
html[data-tema="oscuro"] .selector-tema-pista .tema-luna { color: #fff; }

.sidebar-sesion {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-sesion a {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, filter 0.2s ease;
}

.sidebar-sesion .sesion-principal { background: var(--acento); color: #fff; box-shadow: var(--glow); }
.sidebar-sesion .sesion-principal:hover { color: #fff; filter: brightness(1.12); }
.sidebar-sesion .sesion-secundaria { border: 1px solid rgba(255, 255, 255, 0.18); color: var(--sidebar-texto); }
.sidebar-sesion .sesion-secundaria:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Laptops de 14": un poco más compacto */
@media (min-width: 992px) and (max-width: 1440px) {
  .sidebar { width: 230px; }
  .sidebar-inner { padding: 1.1rem 0.8rem 1rem; }
  .sidebar-brand img { width: 44px; height: 44px; }
  .sidebar-brand-nombre { font-size: 1.15rem; }
  .sidebar-nav a { padding: 8px 12px; font-size: 0.94rem; }
}

@media (min-width: 992px) and (max-height: 800px) {
  .sidebar-nav { gap: 1px; }
  .sidebar-nav a { padding-top: 7px; padding-bottom: 7px; }
  .sidebar-brand { padding-bottom: 0.8rem; margin-bottom: 0.6rem; }
}

/* Celular / tablet: el menú se esconde y se abre con la hamburguesa */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(280px, 85vw);
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
  }

  .sidebar-inner { position: static; height: 100%; }
  .sidebar.abierto { transform: translateX(0); }
}

/* «25.1 HD» junto al lema, debajo de «UPEA Televisión» */
.sidebar-brand-canal {
  color: var(--sidebar-activo);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* «UPEA Televisión» en una sola línea */
.sidebar-brand .sidebar-brand-nombre {
  font-size: 1.02rem;
  white-space: nowrap;
}
