/* ==========================================================================
   WebPlay — tema escuro estilo streaming
   ========================================================================== */
:root {
  --bg: #090b11;
  --bg-2: #11141d;
  --bg-3: #191d29;
  --surface: #14171f;
  --surface-2: #1a1e29;
  --border: #262c3a;
  --border-soft: #1e2331;
  --text: #f4f6fb;
  --muted: #8b93a7;
  --brand: #e50914;
  --brand-2: #ff2b38;
  --accent: #2dd4bf;
  --gold: #f5c518;
  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 22px;
  /* profundidade em camadas — sombras suaves e realistas */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.30), 0 4px 12px rgba(0,0,0,.20);
  --shadow: 0 10px 34px rgba(0,0,0,.42);
  --shadow-lg: 0 28px 64px rgba(0,0,0,.55);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 32%, transparent);
  --nav-h: 64px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------------------------------------------------------------- tema claro */
:root[data-theme="light"] {
  --bg: #eef1f7;
  --bg-2: #ffffff;
  --bg-3: #e7ebf3;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --border: #dde3ee;
  --border-soft: #e6ebf3;
  --text: #161a24;
  --muted: #5b6474;
  --shadow-sm: 0 1px 2px rgba(30,40,70,.05), 0 4px 12px rgba(30,40,70,.07);
  --shadow: 0 12px 40px rgba(30, 40, 70, .16);
  --shadow-lg: 0 24px 60px rgba(30,40,70,.18);
}
:root[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 80% -10%, #efe6ff 0%, transparent 55%),
    radial-gradient(1000px 700px at -10% 10%, #e2f0ff 0%, transparent 50%),
    var(--bg);
}
:root[data-theme="light"] .nav {
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(255,255,255,.7));
}
:root[data-theme="light"] .nav .links a:hover,
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: #d3d9e6; }
:root[data-theme="light"] .detail p.plot,
:root[data-theme="light"] .epg-name { color: #333a48; }
:root[data-theme="light"] .poster .noimg,
:root[data-theme="light"] .cw-thumb { background: #e7ebf3; }
:root[data-theme="light"] .modal-back { background: rgba(20,26,40,.55); }
:root[data-theme="light"] .search::placeholder,
:root[data-theme="light"] .field input::placeholder { color: #98a1b3; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background:
    radial-gradient(900px 520px at 85% -12%, rgba(124,58,237,.16) 0%, transparent 60%),
    radial-gradient(1000px 720px at -12% 6%, rgba(12,74,150,.16) 0%, transparent 55%),
    radial-gradient(720px 520px at 50% 118%, color-mix(in srgb, var(--brand) 9%, transparent) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: .1px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
::selection { background: color-mix(in srgb, var(--brand) 35%, transparent); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2b3242; border-radius: 20px; border: 2px solid transparent;
  background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #3a4256; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------ navbar */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 26px;
  padding: 0 clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--border-soft);
}
.nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 800;
  font-size: 21px; letter-spacing: -.2px; }
.nav .brand b { color: var(--brand); }
.nav .links { display: flex; gap: 4px; margin-left: 10px; }
.nav .links a {
  position: relative; padding: 8px 14px; border-radius: 10px; color: var(--muted);
  font-size: 14px; font-weight: 600; transition: color .18s, background .18s;
}
.nav .links a:hover { color: var(--text); background: var(--bg-3); }
.nav .links a.active { color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 40%, transparent); }
.nav .spacer { flex: 1; }
.nav .actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text);
  display: grid; place-items: center; font-size: 15px;
  transition: background .18s, border-color .18s, transform .12s;
}
.icon-btn:hover { background: var(--bg-3); border-color: #3a4256; }
.icon-btn:active { transform: scale(.92); }
.nav .burger { display: none; }

/* notificações */
.notif-wrap { position: relative; }
.notif-badge {
  position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 10px; background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--bg);
}
.notif-panel {
  position: absolute; top: 50px; right: 0; width: min(320px, calc(100vw - 32px));
  max-height: 420px;
  overflow-y: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); z-index: 60;
}
.notif-head { padding: 14px 16px; font-weight: 800; border-bottom: 1px solid var(--border); }
.notif-empty { padding: 24px 16px; color: var(--muted); text-align: center; font-size: 14px; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-item b { font-size: 14px; }
.notif-item p { margin: 4px 0 6px; font-size: 13px; color: #c7cdda; line-height: 1.5; }
.notif-item span { font-size: 11px; color: var(--muted); }

/* ------------------------------------------------------------------ layout */
.page { padding: clamp(20px, 4vw, 40px); max-width: 1500px; margin: 0 auto; }
.section-title { font-size: 20px; font-weight: 800; margin: 4px 0 14px; letter-spacing: -.3px; }
.muted { color: var(--muted); }

/* ---------------------------------------------------------------- home hero */
.hero {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  padding: clamp(24px, 4vw, 44px); margin-bottom: 26px;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 52%),
    radial-gradient(110% 130% at 100% 100%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 55%),
    linear-gradient(180deg, #151a28, #0d1019);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.hero h1 { font-size: clamp(22px, 4vw, 34px); margin: 0 0 8px; line-height: 1.1; color: #fff;
  letter-spacing: -.5px; }
.hero p { color: #c9d1e0; max-width: 540px; font-size: 14.5px; }
.hero .hero-meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero .exp { display: inline-flex; align-items: center; gap: 8px; color: #eef1f8;
  background: rgba(0,0,0,.35); padding: 7px 13px; border-radius: 30px; font-size: 13px;
  border: 1px solid rgba(255,255,255,.12); }
.support-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 15px 6px 10px;
  border-radius: 30px; background: rgba(34,197,94,.14); color: var(--text);
  border: 1px solid rgba(34,197,94,.4); transition: .2s;
}
.support-chip:hover { background: rgba(34,197,94,.22); transform: translateY(-1px); }
.support-chip .sc-ic {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg,#22c55e,#15803d); font-size: 15px; flex-shrink: 0;
}
.support-chip .sc-text { display: flex; flex-direction: column; line-height: 1.15; }
.support-chip .sc-label { font-size: 10.5px; color: #7fdca0; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px; }
.support-chip .sc-num { font-size: 14px; font-weight: 800; color: #fff; }

/* planos de renovação */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
  gap: 16px; max-width: 760px; }
.plan-card { background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: 16px;
  padding: 24px 18px; text-align: center; box-shadow: var(--shadow-sm);
  transition: border-color .2s, transform .2s, box-shadow .2s; }
.plan-card:hover { border-color: var(--brand); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.plan-card .plan-name { font-weight: 700; font-size: 15px; }
.plan-card .plan-price { font-size: 27px; font-weight: 900; margin: 8px 0 2px; letter-spacing: -.5px; }
.plan-card .plan-credits { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.renew-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px;
  border-radius: 30px; font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg,var(--brand),var(--brand-2)); border: 1px solid rgba(255,255,255,.15);
  transition: .2s; }
.renew-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* home category cards */
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
  gap: 22px; }
.home-grid.three { grid-template-columns: repeat(3, 1fr); }
.cat-card {
  position: relative; border-radius: 18px; overflow: hidden;
  min-height: 200px; border: 1px solid rgba(255,255,255,.08);
  background: var(--surface); transition: transform .28s cubic-bezier(.2,.7,.2,1), box-shadow .28s;
  display: flex; flex-direction: column; padding: 26px; isolation: isolate;
}
.cat-card::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: var(--grad, linear-gradient(135deg, #232a3d, #12151f));
  transition: transform .4s ease;
}
.cat-card::after { /* brilho/vinheta para dar profundidade */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(120% 80% at 80% 0%, rgba(255,255,255,.18), transparent 55%),
              linear-gradient(180deg, transparent 40%, rgba(0,0,0,.45));
}
.cat-card:hover { transform: translateY(-8px); box-shadow: 0 22px 50px rgba(0,0,0,.5); }
.cat-card:hover::before { transform: scale(1.08); }
.cat-card .cc-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-size: 26px; background: rgba(255,255,255,.16); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.22); box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.cat-card .cc-body { margin-top: auto; }
.cat-card h3 { margin: 0 0 3px; font-size: 21px; font-weight: 800; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.cat-card span { color: rgba(255,255,255,.85); font-size: 14px; }
.cat-card .cc-go {
  margin-top: 16px; font-size: 14px; font-weight: 700; color: #fff;
  display: inline-flex; align-items: center; gap: 6px; opacity: 0;
  transform: translateY(6px); transition: .28s;
}
.cat-card .cc-go b { transition: transform .28s; }
.cat-card:hover .cc-go { opacity: 1; transform: none; }
.cat-card:hover .cc-go b { transform: translateX(4px); }
.grad-live { --grad: linear-gradient(140deg,#ff1e2d,#b00711 55%,#5c0810); }
.grad-movies { --grad: linear-gradient(140deg,#3b82f6,#1d4ed8 55%,#0b2f8a); }
.grad-series { --grad: linear-gradient(140deg,#8b5cf6,#6d28d9 55%,#3b1487); }
.grad-radio { --grad: linear-gradient(140deg,#14b8a6,#0d9488 55%,#065f56); }
.grad-catchup { --grad: linear-gradient(140deg,#f59e0b,#d97706 55%,#7c3f06); }
.grad-account { --grad: linear-gradient(140deg,#475569,#334155 55%,#1e293b); }

@media (max-width: 820px) {
  .home-grid.three { grid-template-columns: 1fr; }
  .cat-card { min-height: 180px; }
  .cat-card .cc-go { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------- content ui */
.content-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; }
.sidebar {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 14px; height: calc(100vh - var(--nav-h) - 80px);
  position: sticky; top: calc(var(--nav-h) + 20px); overflow-y: auto;
}
.search {
  width: 100%; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font-size: 14px;
}
.search:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.search::placeholder { color: var(--muted); }
.sidebar .search { margin-bottom: 12px; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li {
  padding: 10px 14px; border-radius: 10px; color: var(--muted); cursor: pointer;
  font-size: 14px; font-weight: 600; transition: .15s; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-list li:hover { background: var(--bg-3); color: var(--text); }
.cat-list li.active { background: linear-gradient(135deg,var(--brand),var(--brand-2)); color:#fff; }

/* botão "hamburger" das categorias — só aparece no celular (ver media query) */
.cat-toggle { display: none; }

.content-main { min-height: 60vh; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar h2 { margin: 0; font-size: 22px; }
.toolbar .count { color: var(--muted); font-size: 13px; }

/* poster grid (movies / series) */
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
  gap: 18px; }
.poster {
  position: relative; border-radius: 12px; overflow: hidden; background: var(--bg-3);
  aspect-ratio: 2/3; cursor: pointer; border: 1px solid var(--border); transition: .2s;
}
.poster:hover { transform: translateY(-6px) scale(1.02); box-shadow: var(--shadow-lg);
  border-color: var(--brand); z-index: 2; }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .pmeta {
  position: absolute; inset: auto 0 0 0; padding: 26px 12px 12px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.92));
  transform: translateY(8px); opacity: 0; transition: .2s;
}
.poster:hover .pmeta { transform: none; opacity: 1; }
.poster .pmeta h4 { margin: 0 0 4px; font-size: 13px; }
.poster .rate { color: var(--gold); font-size: 12px; }
.poster .noimg { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; width: 100%; height: 100%; color: var(--muted); font-size: 12.5px; font-weight: 600;
  line-height: 1.35; text-align: center; padding: 14px 12px;
  background: linear-gradient(160deg, var(--bg-3), var(--surface)); }
.poster .noimg::before { content: "🎬"; font-size: 30px; opacity: .5; line-height: 1; }

/* botão favoritar (coração) */
.fav-btn {
  border: none; background: rgba(0,0,0,.5); color: #fff; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%; font-size: 15px; line-height: 1;
  display: grid; place-items: center; transition: .15s; flex-shrink: 0; padding: 0;
}
.fav-btn:hover { background: rgba(0,0,0,.72); transform: scale(1.12); }
.fav-btn.on { color: var(--brand); }
.poster .fav-btn { position: absolute; top: 8px; right: 8px; z-index: 3; opacity: 0; }
.poster:hover .fav-btn, .poster .fav-btn.on { opacity: 1; }
.poster .fav-btn.on { background: rgba(0,0,0,.6); }

/* EPG no player ao vivo */
.epg-box { margin-top: 14px; }
.epg-title { margin: 0 0 8px; font-size: 14px; }
.epg-row { display: flex; gap: 12px; padding: 9px 10px; font-size: 13px; align-items: baseline; }
.epg-row + .epg-row { border-top: 1px solid var(--border); }
.epg-row.now { background: color-mix(in srgb, var(--brand) 12%, transparent); border-radius: 8px; }
.epg-time { color: var(--muted); min-width: 46px; font-weight: 700; }
.epg-name { flex: 1; }
.epg-badge { background: var(--brand); color: #fff; font-size: 10px; font-weight: 800;
  padding: 1px 6px; border-radius: 10px; margin-left: 6px; vertical-align: middle; }
.ep-seen { background: rgba(34,197,94,.2); color: #7fdca0; font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 10px; margin-left: 6px; }

/* continuar assistindo (home) */
.cw-wrap { margin-bottom: 28px; }
.cw-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px;
  scroll-snap-type: x proximity; }
.cw-card { flex: 0 0 200px; scroll-snap-align: start; cursor: pointer; }
.cw-thumb { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden;
  background: var(--bg-3); border: 1px solid var(--border); transition: .2s; }
.cw-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cw-play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px;
  color: #fff; background: rgba(0,0,0,.28); opacity: 0; transition: .2s; }
.cw-card:hover .cw-play { opacity: 1; }
.cw-card:hover .cw-thumb { border-color: var(--brand); transform: translateY(-3px); }
/* ✕ para remover do "Continuar assistindo" */
.cw-del { position: absolute; top: 6px; right: 6px; z-index: 3; padding: 0;
  width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(0,0,0,.62); color: #fff; font-size: 12px; line-height: 1;
  display: grid; place-items: center; cursor: pointer; opacity: 0;
  transition: opacity .15s, background .15s, transform .12s; }
.cw-card:hover .cw-del { opacity: 1; }
.cw-del:hover { background: var(--brand); transform: scale(1.1); }
@media (hover: none) { .cw-del { opacity: 1; } }
.cw-bar { height: 4px; background: var(--bg-3); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.cw-bar i { display: block; height: 100%; background: var(--brand); }
.cw-name { margin-top: 6px; font-size: 13px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }

/* channel list (live / radio / catchup) */
.chan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr));
  gap: 12px; }
.chan {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: .15s;
}
.chan:hover { background: var(--bg-3); border-color: var(--brand); transform: translateX(3px); }
.chan .num { min-width: 34px; text-align: center; color: var(--muted); font-weight: 700;
  font-size: 13px; }
.chan .logo { width: 46px; height: 46px; border-radius: 8px; object-fit: contain;
  background: #0a0c12; flex-shrink: 0; }
.chan .cname { flex: 1; font-weight: 600; font-size: 14px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.chan .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
  box-shadow: 0 0 8px var(--brand); }

/* seletor de visualização (lista / ícones) */
.view-toggle { display: inline-flex; gap: 2px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 3px; flex-shrink: 0; }
.view-toggle button { width: 34px; height: 32px; border: none; background: transparent;
  color: var(--muted); border-radius: 7px; font-size: 15px; display: grid; place-items: center;
  transition: .15s; }
.view-toggle button.active { background: linear-gradient(135deg,var(--brand),var(--brand-2)); color: #fff; }
.view-toggle button:hover:not(.active) { color: var(--text); background: var(--bg-3); }

/* canais em ícones médios (grade) */
.chan-grid-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px; }
.chan-tile { position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 10px 12px; text-align: center; cursor: pointer;
  transition: .18s; }
.chan-tile:hover { border-color: var(--brand); transform: translateY(-4px); box-shadow: var(--shadow); }
.chan-tile .ct-logo { width: 76px; height: 76px; margin: 0 auto 9px; border-radius: 12px;
  background: #0a0c12; display: grid; place-items: center; overflow: hidden; }
.chan-tile .ct-logo img { width: 100%; height: 100%; object-fit: contain; }
.chan-tile .ct-name { font-size: 13px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chan-tile .fav-btn { position: absolute; top: 6px; right: 6px; opacity: 0; }
.chan-tile:hover .fav-btn, .chan-tile .fav-btn.on { opacity: 1; }
@media (max-width: 560px) {
  .chan-grid-icons { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
  .chan-tile .ct-logo { width: 62px; height: 62px; }
}

/* filmes/séries — visualização "Lista" (linhas compactas com miniatura) */
.vod-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.vod-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: .15s;
}
.vod-row:hover { background: var(--bg-3); border-color: var(--brand); transform: translateX(3px); }
.vod-row .vr-thumb { width: 44px; height: 62px; border-radius: 8px; object-fit: cover;
  flex-shrink: 0; background: var(--bg-3); }
.vod-row .vr-body { flex: 1; min-width: 0; }
.vod-row .vr-name { font-weight: 600; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vod-row .vr-meta { color: var(--gold); font-size: 12px; margin-top: 3px; }
@media (max-width: 560px) { .vod-list { grid-template-columns: 1fr; } }

/* skeleton / loader */
.loader { display: grid; place-items: center; padding: 60px; color: var(--muted); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border);
  border-top-color: var(--brand); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }

/* skeleton shimmer (estado de carregamento) */
@keyframes shimmer { to { background-position-x: -200%; } }
.skeleton { background: linear-gradient(110deg, var(--bg-3) 8%, var(--surface-2) 20%, var(--bg-3) 34%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 12px; }
.sk-poster { aspect-ratio: 2/3; }
.sk-chan { height: 66px; }
.sk-tile { height: 138px; }
@media (prefers-reduced-motion: reduce) {
  .skeleton, .spinner { animation: none; }
  html { scroll-behavior: auto; }
}

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-block; border: 1px solid var(--border); border-radius: 12px; padding: 12px 20px;
  font-weight: 700; font-size: 14px; letter-spacing: .2px; text-align: center;
  background: var(--bg-3); color: var(--text);
  transition: background .18s, border-color .18s, transform .12s, box-shadow .18s, filter .18s;
}
.btn:hover { background: #232838; border-color: #333b4e; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: none; color: #fff;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 34%, transparent);
}
.btn-primary:hover { filter: brightness(1.08);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--brand) 46%, transparent); }
.btn-primary:active { transform: translateY(1px); }
.btn-block { display: block; width: 100%; }
.btn-play { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

/* ------------------------------------------------------------------ modal */
.modal-back {
  position: fixed; inset: 0; z-index: 100; background: rgba(3,4,8,.82);
  backdrop-filter: blur(8px) saturate(120%); -webkit-backdrop-filter: blur(8px) saturate(120%);
  display: none; align-items: flex-start;
  justify-content: center; padding: 40px 20px; overflow-y: auto;
}
.modal-back.open { display: flex; }
.modal {
  width: min(1000px, 100%); background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
  animation: pop .28s cubic-bezier(.2,.7,.2,1);
}
@keyframes pop { from { transform: scale(.965) translateY(10px); opacity: 0; } }
.modal .close {
  position: absolute; top: 16px; right: 16px; z-index: 5; width: 40px; height: 40px;
  border-radius: 50%; background: rgba(0,0,0,.6); border: 1px solid var(--border);
  color: #fff; font-size: 18px;
}
.player-wrap { position: relative; aspect-ratio: 16/9; background: #000; }
.player-wrap video { width: 100%; height: 100%; }
.detail { padding: 24px; }
.detail-head { display: flex; gap: 22px; margin-bottom: 18px; }
.detail-head img { width: 150px; border-radius: 12px; flex-shrink: 0; }
.detail-head h2 { margin: 0 0 8px; }
.detail-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted);
  font-size: 13px; margin-bottom: 12px; }
.detail-meta .rate { color: var(--gold); }
.detail p.plot { color: #c7cdda; font-size: 14px; line-height: 1.6; }

/* VOD (filmes/séries): vídeo à ESQUERDA, detalhes à DIREITA quando tocando (desktop) */
#modalBody.vod-stage { display: flex; flex-direction: column; }
@media (min-width: 900px) {
  #modal.vod.playing { padding: 16px 10px; }               /* mais espaço p/ o modal crescer */
  #modal.vod.playing .modal { width: min(1850px, calc(100vw - 20px)); }
  #modal.vod.playing #modalBody.vod-stage { flex-direction: row; align-items: flex-start; }
  #modal.vod.playing #modalBody.vod-stage > .player-wrap { flex: 0 0 69%; }
  #modal.vod.playing #modalBody.vod-stage > .detail { flex: 1 1 auto; min-width: 0;
    max-height: 78vh; overflow-y: auto; padding: 22px 24px; }
  #modal.vod.playing #modalBody.vod-stage .detail-head { flex-direction: column; gap: 12px; margin-bottom: 14px; }
  #modal.vod.playing #modalBody.vod-stage .detail-head img { width: 140px; }
  #modal.vod.playing #modalBody.vod-stage .detail h2 { font-size: 22px; }
  #modal.vod.playing #modalBody.vod-stage .detail-meta { font-size: 13px; }
  #modal.vod.playing #modalBody.vod-stage .detail p.plot { font-size: 14px; line-height: 1.6; }
}
.seasons-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.seasons-tabs button { padding: 8px 14px; border-radius: 20px; }
.seasons-tabs button.active { background: linear-gradient(135deg,var(--brand),var(--brand-2)); border:none; color:#fff; }
.ep-list { display: grid; gap: 8px; }
.ep {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: .15s;
}
.ep:hover { border-color: var(--brand); background: var(--bg-3); }
.ep .epn { color: var(--muted); font-weight: 700; min-width: 30px; }
.ep .ename { flex: 1; font-size: 14px; }

/* Série — tela inicial (antes do play): info à ESQUERDA, episódios à DIREITA (desktop).
   Durante a reprodução do episódio (.playing) e no celular volta a empilhar. */
@media (min-width: 900px) {
  #modal.vod.series:not(.playing) .modal { width: min(1240px, calc(100vw - 40px)); }
  #modal.vod.series:not(.playing) #modalBody.vod-stage .series-top {
    display: flex; gap: 26px; align-items: flex-start;
  }
  #modal.vod.series:not(.playing) #modalBody.vod-stage .series-top > .series-meta {
    flex: 0 0 40%; min-width: 0;
  }
  #modal.vod.series:not(.playing) #modalBody.vod-stage .series-top > .ep-list {
    flex: 1 1 auto; min-width: 0; max-height: 66vh; overflow-y: auto; padding-right: 4px;
  }
  #modal.vod.series:not(.playing) #modalBody.vod-stage .series-meta .seasons-tabs { margin-bottom: 0; }
}

/* ------------------------------------------------------------------ login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  position: relative; width: min(430px, 100%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 90%, transparent),
              color-mix(in srgb, var(--bg-2) 90%, transparent));
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--border); border-radius: 22px; padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  animation: authIn .5s cubic-bezier(.2,.7,.2,1);
}
/* halo de gradiente sutil na borda (anel premium) */
.auth-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  padding: 1px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--brand) 60%, transparent),
              transparent 42%, color-mix(in srgb, var(--accent) 32%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .75; pointer-events: none;
}
@keyframes authIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.auth-card .logo { text-align: center; font-size: 30px; font-weight: 900; margin-bottom: 6px; }
.auth-card .logo b { color: var(--brand); }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 28px; font-size: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px;
  font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font-size: 15px; font-family: inherit;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field textarea { resize: vertical; min-height: 60px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #333b4e; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none;
  border-color: var(--brand); box-shadow: var(--ring); background: var(--bg); }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px;
  margin-bottom: 20px; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 18px;
  display: none; }
.alert.show { display: block; }
.alert-error { background: rgba(229,9,20,.15); border: 1px solid rgba(229,9,20,.4); color: #ffb3b8; }
.alert-ok { background: rgba(45,212,191,.12); border: 1px solid rgba(45,212,191,.4); color: #9ff3e8; }
.login-support {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 18px; padding: 10px 14px; border-radius: 12px;
  background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35);
  color: var(--text); font-size: 13px; transition: .2s;
}
.login-support:hover { background: rgba(34,197,94,.2); transform: translateY(-1px); }
.login-support .ls-ic { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 14px;
  background: linear-gradient(135deg,#22c55e,#15803d); }
.login-support b { font-weight: 800; }

/* separador "ou" + entrar com link M3U (login) */
.or-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px;
  color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.m3u-link { width: 100%; background: transparent; border: 1px dashed var(--border);
  color: var(--muted); padding: 11px 14px; border-radius: 12px; font-size: 13px; font-weight: 700;
  transition: color .18s, border-color .18s; }
.m3u-link:hover { color: var(--text); border-color: #3a4256; }
.m3u-box { margin-top: 4px; }

/* ------------------------------------------------------------- settings */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr));
  gap: 20px; }
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 16px; font-size: 16px; letter-spacing: -.2px; }
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: var(--bg-3); border-radius: 30px;
  transition: .2s; border: 1px solid var(--border); }
.switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px;
  left: 4px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(21px); }
.row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* --------------------------------------------------------------- admin */
.admin-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--bg-2); border-right: 1px solid var(--border); padding: 24px 16px; }
.admin-side .brand { font-weight: 900; font-size: 22px; margin-bottom: 28px; padding: 0 8px; }
.admin-side .brand b { color: var(--brand); }
.admin-side a { display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 4px;
  transition: background .15s, color .15s, box-shadow .15s; }
.admin-side a:hover { background: var(--bg-3); color: var(--text); }
.admin-side a.active { background: color-mix(in srgb, var(--brand) 15%, var(--bg-3)); color: #fff;
  box-shadow: inset 3px 0 0 var(--brand); }
.admin-main { padding: 32px clamp(20px,4vw,44px); }
.admin-main h1 { margin: 0 0 24px; }
.admin-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px; align-items: start; max-width: 1100px; }
.admin-settings-grid .card { margin: 0; max-width: none; }
.settings-col { display: grid; gap: 20px; align-items: start; }
.upload-preview { display: inline-block; padding: 10px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg-2); margin-bottom: 8px; }
.upload-preview img { max-height: 46px; max-width: 200px; display: block; }
.upload-preview.small { padding: 8px; }
.upload-preview.small img { max-height: 44px; max-width: 44px; }
.upload-preview.bg { display: block; }
.upload-preview.bg img { max-height: 100px; max-width: 100%; border-radius: 6px; }
.field input[type="file"] { padding: 9px 12px; font-size: 13px; }
.field input[type="file"]::file-selector-button {
  background: var(--bg-3); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px; margin-right: 10px; cursor: pointer; font-weight: 600; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted);
  margin-bottom: 8px; cursor: pointer; }
.chk input { width: auto; }
.range { width: 100%; accent-color: var(--brand); cursor: pointer; }
.range-legend { display: flex; justify-content: space-between; font-size: 11px;
  color: var(--muted); margin-top: 3px; }
.hint { font-size: 12px; margin: 6px 0 0; line-height: 1.5; }
/* chips (ex.: painéis disponíveis para integração) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px;
  border-radius: 30px; background: var(--bg-3); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  box-shadow: 0 0 7px color-mix(in srgb, var(--accent) 70%, transparent); }
.brand-logo { height: 32px; width: auto; display: block; }
.auth-card .logo .brand-logo { height: 96px; max-width: 100%; width: auto;
  object-fit: contain; margin: 0 auto 10px; }
.admin-side .brand .brand-logo { height: 28px; }
@media (max-width: 820px) { .admin-settings-grid { grid-template-columns: 1fr; } }
.table { width: 100%; border-collapse: collapse; background: var(--surface);
  border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--border-soft);
  font-size: 14px; }
.table th { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 12px;
  letter-spacing: .5px; background: color-mix(in srgb, var(--bg-3) 55%, transparent); }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--bg-3) 55%, transparent); }
.table tr:last-child td { border-bottom: none; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 16px;
  margin-bottom: 28px; }
.stat { background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow-sm); }
.stat .n { font-size: 32px; font-weight: 900; letter-spacing: -.6px; }
.stat .l { color: var(--muted); font-size: 13px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 24px; }
.inline-form .field { margin: 0; flex: 1; min-width: 160px; }
.link-danger { color: var(--brand-2); }

/* ------------------------------------------------------------- responsive */
/* Envolve tabelas largas (admin) para rolarem na horizontal sem quebrar a página. */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.table-wrap .table { border-radius: 0; }

@media (max-width: 900px) {
  /* ---- conteúdo: categorias viram um menu "hamburger" (abre/fecha) ---- */
  .content-layout { display: block; }
  .cat-toggle { display: flex; align-items: center; gap: 10px; width: 100%;
    margin-bottom: 14px; padding: 12px 16px; border-radius: 12px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    color: var(--text); font-weight: 700; font-size: 14px; box-shadow: var(--shadow-sm);
    transition: border-color .18s; }
  .cat-toggle:active { border-color: var(--brand); }
  .cat-toggle .ct-ic { font-size: 16px; line-height: 1; }
  .cat-toggle .ct-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cat-toggle .ct-caret { margin-left: auto; color: var(--muted); transition: transform .2s; }
  .cat-toggle[aria-expanded="true"] .ct-caret { transform: rotate(180deg); }

  .sidebar { display: none; position: static; height: auto; max-height: 62vh;
    overflow-y: auto; padding: 12px; margin-bottom: 14px; }
  .sidebar.open { display: block; }
  .sidebar .search { margin-bottom: 10px; }
  .cat-list { display: block; }
  .cat-list li { margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* ---- navbar: menu vira dropdown pelo ☰ ---- */
  .nav { gap: 12px; padding: 0 16px; }
  .nav .links { display: none; }
  .nav .links.open { display: flex; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; background: var(--bg-2); padding: 12px;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow); z-index: 55; }
  .nav .links.open a { padding: 12px 14px; font-size: 15px; }
  .nav .burger { display: grid; }
  .nav .actions { gap: 6px; }

  /* ---- admin: menu lateral vira barra horizontal fixa no topo ---- */
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-side { display: flex; overflow-x: auto; gap: 6px; padding: 12px;
    position: sticky; top: 0; z-index: 20; scrollbar-width: none; }
  .admin-side::-webkit-scrollbar { display: none; }
  .admin-side .brand { display: none; }
  .admin-side a { flex: 0 0 auto; white-space: nowrap; margin-bottom: 0; }
  .admin-main { padding: 22px 16px; }

  .detail-head { flex-direction: column; }
  .detail-head img { width: 120px; }
}

@media (max-width: 560px) {
  .page { padding: 18px 16px; }
  .poster-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .chan-grid { grid-template-columns: 1fr; }
  .hero .exp { flex-wrap: wrap; row-gap: 4px; }

  /* navbar mais compacta */
  .icon-btn { width: 36px; height: 36px; font-size: 14px; }
  .nav .brand { font-size: 18px; }
  .nav .brand .brand-logo { height: 26px; }

  /* painel de notificações ocupa a largura da tela (não corta a mensagem) */
  .notif-panel { position: fixed; top: calc(var(--nav-h) + 6px); left: 12px; right: 12px;
    width: auto; max-height: 72vh; }

  /* modal aproveita a tela toda, player no topo */
  .modal-back { padding: 0; }
  .modal { border-radius: 0; }
  .detail { padding: 16px; }
  .detail-meta { gap: 10px; font-size: 12px; }
  .modal .close { top: 10px; right: 10px; width: 36px; height: 36px; }

  /* planos lado a lado; formulários e stats empilham */
  .plan-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .inline-form .field { min-width: 100%; }
  .stat .n { font-size: 26px; }
  .toolbar #itemSearch { max-width: none; flex: 1 1 100%; }
}
