/* ALTOKE.VIP - estilos del reproductor web, mismo lenguaje visual que la app:
   fondo negro, degradado rojo sutil, partículas de colores, tarjetas "vidrio" */

:root {
  --red: #E62E2F;
  --red-dark: #B5222E;
  --btn-red-start: #FF2A2A;
  --btn-red-end: #C40000;
  --bg: #0b0d12;
  --title: #DBDBDB;
  --title-sub: #A0A0A0;
  --card-bg: #121010;
  --card-border: #2A2626;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(rgba(255,255,255,0.09) 1px, transparent 1px),
    var(--bg);
  background-size: 22px 22px, auto;
  color: var(--title);
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  height: 100%;
  overflow: hidden;
}

#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.glow-top-left {
  position: fixed;
  top: -520px;
  left: 50%;
  transform: translateX(-50%);
  width: 1600px;
  height: 1600px;
  background: radial-gradient(ellipse at center, rgba(230,46,47,0.17) 0%, rgba(230,46,47,0.07) 30%, rgba(0,0,0,0) 58%);
  z-index: 0;
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 40px;
  border-bottom: 1px solid #1c1818;
}

.header .badge-img {
  width: 60px;
  height: 60px;
  border-radius: 14px;
}

.header .titles h1 {
  margin: 0;
  font-size: clamp(20px, 1.6vw, 27px);
  letter-spacing: 0.5px;
}

.header .titles span {
  font-size: 15px;
  color: var(--title-sub);
  letter-spacing: 2px;
}

.header .spacer { flex: 1; }

.header button.logout {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--title-sub);
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
}
.header button.logout:hover { color: var(--title); border-color: var(--red); }

/* ---------- Login screen ---------- */
.login-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.login-split {
  width: 100%;
  max-width: 1300px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 85px;
  flex-wrap: wrap;
}

.login-side {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 26px;
}

.login-side .mark {
  width: 190px;
  height: 190px;
  border-radius: 40px;
  box-shadow: 0 14px 55px rgba(230,46,47,0.3);
}

.login-switch {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: #f1f1f1;
  border: none;
  color: #111;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  padding: 15px 26px;
  border-radius: 999px;
  width: 300px;
  justify-content: center;
}
.login-switch:hover { background: #fff; }
.login-switch.active { background: #fff; }
.login-switch svg { width: 20px; height: 20px; flex-shrink: 0; }

.login-card {
  width: 100%;
  max-width: 540px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 38px;
}

.login-card .field-label {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--title);
  margin-bottom: 22px;
}

.field {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  margin-bottom: 14px;
  padding: 0 6px 0 20px;
}
.field input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--title);
  padding: 17px 10px;
  font-size: 17px;
  min-width: 0;
}
.field input::placeholder { color: #6b6666; }
.field .icon {
  color: var(--title-sub);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.field .icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; }
.field .toggle-visibility {
  background: transparent;
  border: none;
  color: var(--title-sub);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.field .toggle-visibility svg { width: 21px; height: 21px; fill: none; stroke: currentColor; }

.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(90deg, var(--btn-red-start), var(--btn-red-end));
  border: none;
  color: #fff;
  padding: 19px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 14px;
}
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.form-pane { display: none; }
.form-pane.active { display: block; }

.error-msg {
  color: #ff6b6b;
  font-size: 15px;
  margin: 10px 0 0;
  min-height: 18px;
}

.terms-note {
  text-align: center;
  font-size: 14.5px;
  color: var(--title-sub);
  margin-top: 20px;
}
.terms-note a { color: var(--red); text-decoration: underline; cursor: pointer; }

@media (max-width: 900px) {
  .login-split { flex-direction: column; gap: 36px; }
  .login-side { flex-direction: row; gap: 18px; min-width: 0; }
  .login-side .mark { width: 72px; height: 72px; border-radius: 18px; }
  .login-switch { width: auto; font-size: 13px; padding: 11px 18px; }
}

/* ---------- Home screen ---------- */
.header .avatar {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.header .back-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--title-sub);
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
}
.header .back-btn:hover { color: var(--title); border-color: var(--red); }

.home-cards {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 44px;
  padding: 30px;
  flex-wrap: wrap;
}

.home-card {
  width: 320px;
  height: 420px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  cursor: pointer;
  border: 1px solid;
  transition: transform 0.15s;
  background-size: cover;
  background-position: center;
}
.home-card:hover { transform: translateY(-5px); }
.home-card-icon svg { width: 90px; height: 90px; }

.home-card-live {
  border-color: rgba(230,46,47,0.4);
  background: radial-gradient(circle at 50% 30%, rgba(230,46,47,0.12), rgba(0,0,0,0.3));
  color: #ff5050;
}
.home-card-movie {
  border-color: rgba(255,152,0,0.4);
  background: radial-gradient(circle at 50% 30%, rgba(255,152,0,0.12), rgba(0,0,0,0.3));
  color: #ff9800;
}
.home-card-series {
  border-color: rgba(171,71,188,0.4);
  background: radial-gradient(circle at 50% 30%, rgba(171,71,188,0.12), rgba(0,0,0,0.3));
  color: #ab47bc;
}

.home-card-label {
  color: var(--title);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
}

.exp-note {
  text-align: center;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  padding-bottom: 34px;
}

@media (max-width: 1100px) {
  .home-card { width: 260px; height: 340px; }
}
@media (max-width: 700px) {
  .home-card { width: 85vw; max-width: 320px; height: 300px; }
}

/* ---------- Episodes screen ---------- */
.episodes-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 28px 40px;
}

.season-title {
  color: var(--title);
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 14px;
  letter-spacing: 0.5px;
}

.episode-row {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 10px;
  cursor: pointer;
}
.episode-row:hover { border-color: var(--red); }
.episode-row .ep-num {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(230,46,47,0.15);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.episode-row .ep-name {
  font-size: 17px;
  color: var(--title);
}

/* ---------- Catalog screen ---------- */
.catalog {
  flex: 1;
  display: flex;
  min-height: 0;
}

.sidebar {
  width: 320px;
  border-right: 1px solid #1c1818;
  padding: 22px 16px;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar .cat-item {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 16px;
  color: var(--title-sub);
  cursor: pointer;
  margin-bottom: 6px;
}
.sidebar .cat-item:hover { background: #141010; color: var(--title); }
.sidebar .cat-item.active {
  background: linear-gradient(135deg, rgba(230,46,47,0.18), rgba(181,34,46,0.08));
  border: 1px solid rgba(230,46,47,0.35);
  color: #fff;
}

.channel-grid {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: grid;
  /* Se ajusta de forma fluida al ancho disponible - nunca deja una columna
     a medio cortar en el borde, y en ~2560px de ancho cae naturalmente en
     torno a 6 columnas de miniaturas grandes. */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  align-content: start;
}

.channel-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
}
.channel-card:hover { border-color: var(--red); transform: translateY(-3px); }
.channel-card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #0a0808;
  border-radius: 10px;
  margin-bottom: 12px;
}
.channel-card .name {
  font-size: 16px;
  color: var(--title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.state-msg {
  padding: 50px;
  text-align: center;
  color: var(--title-sub);
  font-size: 18px;
}

/* ---------- Player overlay ---------- */
.player-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 50;
  display: none;
  flex-direction: column;
}
.player-overlay.active { display: flex; }
.player-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 26px;
  background: rgba(0,0,0,0.6);
}
.player-top button {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--title);
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
}
.player-top .title { font-size: 18px; color: var(--title); }
video#video-player {
  flex: 1;
  width: 100%;
  background: #000;
}

@media (max-width: 700px) {
  .sidebar { width: 180px; }
  .channel-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .channel-card img { height: 150px; }
}

/* ---------- Barras de scroll invisibles (el scroll sigue funcionando) ---------- */
.sidebar,
.channel-grid,
.home-cards,
.login-wrap,
.episodes-wrap {
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* Edge/IE viejo */
}
.sidebar::-webkit-scrollbar,
.channel-grid::-webkit-scrollbar,
.home-cards::-webkit-scrollbar,
.login-wrap::-webkit-scrollbar,
.episodes-wrap::-webkit-scrollbar {
  display: none;              /* Chrome/Safari/Edge nuevo */
}
