:root{
  --panel: rgba(18, 22, 33, .72);
  --panel2: rgba(14, 18, 30, .78);
  --border: rgba(255,255,255,.10);
  --text:#e9edf7;
  --muted:#9aa3b2;
  --accent:#ff6a00;
  --accent2:#ff9a3d;
  --good:#58f0a8;
  --danger:#ff6b6b;
  --shadow: 0 18px 70px rgba(0,0,0,.35);
  --radius: 18px;
  --radius2: 22px;
  --sidebar: 260px;
  --topbar: 72px;
  --maxw: 1320px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color:var(--text);
  background:#0b0d12;
  overflow-x:hidden;
}

/* Background theme (same vibe as admin login) */
body::before{
  content:"";
  position:fixed; inset:0;
  background-image:
    radial-gradient(1200px 600px at 30% 10%, rgba(55,115,255,.30), transparent 65%),
    radial-gradient(900px 520px at 80% 20%, rgba(255,106,0,.30), transparent 62%),
    url('/admin/login-bg.jpg');
  background-size:cover;
  background-position:center;
  filter: blur(18px) saturate(1.25) contrast(1.05);
  transform: scale(1.08);
  opacity:0.55;
  z-index:-2;
}
body::after{
  content:"";
  position:fixed; inset:0;
  background: linear-gradient(90deg, rgba(0,0,0,.62), rgba(0,0,0,.40));
  z-index:-1;
}

.portal{
  min-height:100vh;
  display:grid;
  grid-template-columns: var(--sidebar) 1fr;
  grid-template-rows: var(--topbar) 1fr;
}

.topbar{
  grid-column:1/-1;
  height:var(--topbar);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 18px;
  background: rgba(10,13,20,.52);
  backdrop-filter: blur(12px);
  border-bottom:1px solid var(--border);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  user-select:none;
}
.brand .logoX{
  font-weight:900;
  font-size:34px;
  line-height:1;
  color:#b30000;
  text-shadow: 0 10px 20px rgba(0,0,0,.35);
}
.brand .textblock{display:flex;flex-direction:column;line-height:1.05}
.brand .title{
  font-weight:900;
  letter-spacing:.3px;
  font-size:16px;
}
.brand .subtitle{
  font-weight:800;
  letter-spacing:.9px;
  font-size:12px;
  color:rgba(255,255,255,.78);
}

.topnav{display:flex;gap:10px;align-items:center}
.topnav a{
  color:rgba(255,255,255,.88);
  text-decoration:none;
  font-weight:700;
  font-size:14px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid transparent;
}
.topnav a:hover{background: rgba(255,255,255,.05)}
.topnav a.active{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}

.userbox{display:flex;align-items:center;gap:10px}
.userbox .avatar{
  width:34px;height:34px;border-radius:999px;
  background: rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.14);
  display:flex;align-items:center;justify-content:center;
  font-weight:900;color:rgba(255,255,255,.86);
}
.userbox .name{font-weight:800;font-size:14px}
.userbox a{color:rgba(255,255,255,.75);text-decoration:none;font-size:13px}
.userbox a:hover{text-decoration:underline}

.sidebar{
  grid-row:2;
  padding:16px 10px;
  border-right:1px solid var(--border);
  background: rgba(14,18,30,.58);
  backdrop-filter: blur(12px);
}
.sidegroup{padding:0 10px 10px}
.sidegroup .label{
  font-size:12px;
  color:rgba(255,255,255,.60);
  font-weight:900;
  letter-spacing:1px;
  text-transform:uppercase;
  margin:10px 0 8px;
}

.sideitem{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px;
  border-radius:16px;
  color:rgba(255,255,255,.90);
  text-decoration:none;
  font-weight:800;
  border:1px solid transparent;
}
.sideitem:hover{background: rgba(255,255,255,.05)}
.sideitem.active{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}
.sideitem .icon{
  width:28px;height:28px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  background: rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.10);
}

.main{
  grid-row:2;
  padding:22px;
}
.container{max-width:var(--maxw);margin:0 auto}

.card{
  background: linear-gradient(135deg, rgba(18,22,33,.62), rgba(18,22,33,.30));
  border:1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero{padding:26px;position:relative;overflow:hidden}
.hero::before{
  content:"";
  position:absolute;
  inset:-120px;
  background:
    radial-gradient(720px 260px at 20% 25%, rgba(255,106,0,.22), transparent 60%),
    radial-gradient(640px 240px at 70% 20%, rgba(88,240,168,.16), transparent 60%),
    radial-gradient(860px 260px at 80% 75%, rgba(55,115,255,.18), transparent 60%);
  transform: rotate(-8deg);
}

/* TMDB hero banner (uses CSS var --hero-bg:url(...)) */
.hero.tmdb::before{
  inset:-24px;
  transform:none;
  background:
    linear-gradient(135deg, rgba(10,12,18,.86), rgba(10,12,18,.38) 52%, rgba(10,12,18,.86)),
    var(--hero-bg);
  background-size: cover;
  background-position: center;
  filter: saturate(1.08) contrast(1.06);
}

.hero .hero-sub{
  margin-top:10px;
  color:rgba(255,255,255,.88);
  font-size:14px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.hero .chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.28);
  backdrop-filter: blur(6px);
}
.hero > *{position:relative}
.hero h1{margin:0;font-size:42px;letter-spacing:.4px}
.hero p{margin:10px 0 0;color:var(--muted);font-size:16px;max-width:820px}

.big-buttons{display:flex;gap:14px;flex-wrap:wrap;margin-top:18px}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:12px 16px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(12,16,26,.55);
  color:rgba(255,255,255,.92);
  text-decoration:none;
  font-weight:900;
  letter-spacing:.3px;
  transition:.12s ease;
}
.btn:hover{transform: translateY(-1px)}
.btn.primary{
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  color:#121212;
  border-color: rgba(255,255,255,.10);
}
.btn.ghost{background: rgba(255,255,255,.05)}

.row{
  margin-top:18px;
  padding:18px;
}
.row h2{margin:0 0 10px;font-size:16px;letter-spacing:.6px}

.toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:0 0 14px}

.seg{
  display:inline-flex;
  gap:6px;
  padding:6px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
}
.segbtn{
  height:30px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,.85);
  font-weight:900;
  cursor:pointer;
}
.segbtn.on{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
}
.input{
  height:42px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  color:var(--text);
  padding:0 12px;
  outline:none;
}
.select{height:42px}

.grid{
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap:12px;
}

.pager{display:flex;justify-content:center;margin-top:14px}
@media (max-width:1200px){.grid{grid-template-columns: repeat(5, minmax(0,1fr));}}
@media (max-width:1020px){.portal{grid-template-columns: 1fr; grid-template-rows: var(--topbar) auto 1fr;}
  .sidebar{grid-row:2; border-right:0; border-bottom:1px solid var(--border)}
  .grid{grid-template-columns: repeat(4, minmax(0,1fr));}
}
@media (max-width:720px){.grid{grid-template-columns: repeat(2, minmax(0,1fr));} .main{padding:14px} .hero h1{font-size:34px}}

.tile{
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  overflow:hidden;
  background: rgba(0,0,0,.22);
  cursor:pointer;
  transition:.12s ease;
}
.tile:hover{transform: translateY(-1px); border-color: rgba(255,255,255,.18)}
.tile .thumb{
  width:100%;
  aspect-ratio: 2/3;
  background: rgba(255,255,255,.06);
  display:block;
  object-fit: cover;
}
.tile .tpad{padding:10px}
.tile .tname{font-weight:900;font-size:13px;line-height:1.2}
.tile .tmeta{margin-top:4px;color:rgba(255,255,255,.65);font-size:12px}

.list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.item{
  display:flex;
  gap:12px;
  align-items:center;
  padding:10px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.22);
  cursor:pointer;
  transition:.12s ease;
}
.item:hover{transform: translateY(-1px); border-color: rgba(255,255,255,.18)}
.item img{
  width:44px;height:44px;border-radius:12px;
  object-fit:cover;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
}
.item .name{font-weight:900}
.item .meta{color:rgba(255,255,255,.65);font-size:12px}

.playerwrap{
  margin-top:14px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:22px;
  overflow:hidden;
  background:#000;
}
.playerwrap video{width:100%;height:420px;display:block;background:#000}

/* jPlayer inside the modal */
#jp_container{
  width:100%;
  height:420px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  overflow:hidden;
  background:#000;
}
#jp_container .jp-jplayer{height:420px !important;background:#000}
#jp_container video{width:100% !important;height:420px !important;background:#000;object-fit:contain}
/* Make blue.monday skin blend with our theme a bit */
#jp_container .jp-interface{
  background: rgba(10,12,18,.85) !important;
  border-top:1px solid rgba(255,255,255,.10);
}
#jp_container .jp-controls button,
#jp_container .jp-toggles button,
#jp_container .jp-volume-controls button{
  filter: brightness(1.1);
}

.modal{
  position:fixed; inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  background: rgba(0,0,0,.65);
  z-index:9999;
}
.modal.on{display:flex}
.modal .box{
  width:min(980px, 100%);
  border-radius:22px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(10,12,18,.92);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal .boxhead{
  display:flex;justify-content:space-between;align-items:center;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.modal .boxhead .title{font-weight:900}
.modal .close{
  background: rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.12);
  color:rgba(255,255,255,.92);
  border-radius:14px;
  padding:8px 10px;
  cursor:pointer;
  font-weight:900;
}
.modal .body{padding:16px}
.modal .desc{color:rgba(255,255,255,.70);font-size:13px;line-height:1.4}

.badge{
  display:inline-flex;align-items:center;gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color:rgba(255,255,255,.85);
  font-weight:800;
  font-size:12px;
}
.badge.good{border-color: rgba(88,240,168,.30); color: rgba(88,240,168,.92)}
.badge.bad{border-color: rgba(255,107,107,.30); color: rgba(255,107,107,.92)}

.notice{
  margin-top:14px;
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  color:rgba(255,255,255,.85);
}
.notice a{color:rgba(255,255,255,.92)}


/* Channel cards (Live TV) */
.tile.channel .thumb{
  aspect-ratio: 16/9;
  object-fit: contain;
  padding: 14px;
  background: rgba(255,255,255,.06);
}
.tile.channel .tname{font-size:14px; line-height:1.2;}
.tile.channel .tmeta{opacity:.8; font-size:12px; margin-top:6px;}
.tile.channel .tnow{margin-top:8px; font-size:12px; opacity:.95; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;}
.tile.channel .tnow.muted{opacity:.55;}


/* Avatar image support */
.avatar img{width:100%;height:100%;object-fit:cover;border-radius:999px;display:block}
.avatar.guest img{width:60%;height:60%;object-fit:contain;opacity:.9}
.avatar.big{width:72px;height:72px;font-size:28px}


/* LegalVOD Season/Episode selects (modal badge row) */
.lv-select{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  outline: none;
}
.lv-select option{
  color: #111;
}


/* LegalVOD dropdown theme */
.js-lv-control{ color-scheme: dark; }


/* LegalVOD Season/Episode dropdowns in modal */
.js-modal-badges select.js-lv-control{
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
}
.js-modal-badges select.js-lv-control option{
  background: #0b0f14;
  color: rgba(255,255,255,.92);
}

/* ================================
   Global Portal Dropdown Styling
   ================================ */
:root{
  color-scheme: dark;
}
select{
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
}
select:focus{
  outline: none;
  border-color: rgba(255,255,255,.30);
  box-shadow: 0 0 0 3px rgba(179,0,0,.18);
}
select:disabled{
  opacity: .6;
  cursor: not-allowed;
}
select option,
select optgroup{
  background: #0b0f14;
  color: rgba(255,255,255,.92);
}
