/* Lingvo Nonton — modern dark streaming UI */
:root {
  --bg: #0a0e1a;
  --bg2: #0f1426;
  --panel: #141a30;
  --card: #1a2240;
  --line: rgba(255,255,255,.08);
  --txt: #eef2ff;
  --muted: #8b93b8;
  --accent: #6d5cff;
  --accent2: #b44dff;
  --grad: linear-gradient(135deg,#6d5cff,#b44dff);
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0,0,0,.45);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, rgba(109,92,255,.18), transparent 60%),
              radial-gradient(900px 500px at -10% 10%, rgba(180,77,255,.12), transparent 55%), var(--bg);
  color: var(--txt); font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}

/* ── NAV ── */
header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  background: rgba(10,14,26,.72); backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display:flex; align-items:center; gap:10px; font-weight:800; font-size:1.15rem; letter-spacing:.3px; }
.brand .logo {
  width:34px; height:34px; border-radius:10px; background:var(--grad);
  display:grid; place-items:center; font-size:1rem; box-shadow:0 4px 14px rgba(109,92,255,.5);
}
nav { display:flex; gap:4px; margin-left:6px; }
nav button {
  background:none; border:none; color:var(--muted); padding:8px 14px; border-radius:10px;
  font-size:.95rem; cursor:pointer; transition:.2s; font-family:inherit;
}
nav button:hover { color:var(--txt); background:rgba(255,255,255,.05); }
nav button.active { color:var(--txt); background:rgba(109,92,255,.18); font-weight:600; }
.searchbox {
  margin-left:auto; display:flex; align-items:center; gap:8px;
  background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:8px 12px; width:min(320px,42vw);
}
.searchbox input { background:none; border:none; outline:none; color:var(--txt); flex:1; font-size:.95rem; font-family:inherit; }
.searchbox svg { width:18px; height:18px; stroke:var(--muted); flex:none; }
.iconbtn {
  background:var(--panel); border:1px solid var(--line); color:var(--txt); width:40px; height:40px;
  border-radius:11px; cursor:pointer; display:grid; place-items:center; transition:.2s;
}
.iconbtn:hover { border-color:var(--accent); }
.iconbtn svg { width:19px; height:19px; stroke:currentColor; }

/* ── LAYOUT / content ── */
main { max-width:1500px; margin:0 auto; padding:0 20px 60px; }

/* hero */
.hero {
  position:relative; border-radius:22px; overflow:hidden; margin:18px 0 26px; min-height:340px;
  display:flex; align-items:flex-end; padding:34px; box-shadow:var(--shadow);
}
.hero .bg { position:absolute; inset:0; background-size:cover; background-position:center; filter:brightness(.55); z-index:0; transition:transform 1.2s ease; }
.hero:hover .bg { transform:scale(1.04); }
.hero .content { position:relative; z-index:1; max-width:660px; }
.hero h1 { font-size:clamp(1.6rem,4vw,2.8rem); font-weight:800; line-height:1.1; text-shadow:0 4px 24px rgba(0,0,0,.6); }
.hero p { color:#d6d9f0; margin:10px 0 18px; font-size:.98rem; text-shadow:0 2px 12px rgba(0,0,0,.5); }
.badge { display:inline-flex; align-items:center; gap:6px; font-size:.75rem; font-weight:600; color:#fff;
  background:rgba(109,92,255,.85); padding:4px 10px; border-radius:20px; margin-bottom:12px; }

/* buttons */
.btn {
  display:inline-flex; align-items:center; gap:8px; border:none; cursor:pointer; font-weight:700;
  padding:11px 22px; border-radius:12px; font-size:.95rem; transition:.22s; font-family:inherit;
}
.btn-primary { background:var(--grad); color:#fff; box-shadow:0 6px 20px rgba(140,78,255,.4); }
.btn-primary:hover { transform:translateY(-2px); box-shadow:0 10px 26px rgba(140,78,255,.55); }
.btn-ghost { background:rgba(255,255,255,.1); color:#fff; border:1px solid rgba(255,255,255,.2); }
.btn-ghost:hover { background:rgba(255,255,255,.18); }

/* ── rows & cards ── */
.section-title { display:flex; align-items:center; justify-content:space-between; margin:26px 0 14px; }
.section-title h2 { font-size:1.25rem; font-weight:700; }
.source-tag { font-size:.72rem; color:var(--muted); background:var(--panel); border:1px solid var(--line); padding:3px 9px; border-radius:20px; }
.row { display:flex; gap:14px; overflow-x:auto; padding-bottom:10px; scroll-snap-type:x mandatory; scrollbar-width:none; }
.row::-webkit-scrollbar { display:none; }
.card {
  flex:0 0 auto; width:150px; scroll-snap-align:start; cursor:pointer; position:relative;
  border-radius:var(--radius); overflow:hidden; background:var(--card); border:1px solid var(--line);
  transition:transform .22s, box-shadow .22s; scroll-snap-stop:always;
}
.card:hover { transform:translateY(-6px); box-shadow:var(--shadow); }
.card .poster { aspect-ratio:2/3; width:100%; background:#0d1120; }
.card .poster img { width:100%; height:100%; object-fit:cover; display:block; }
.card .meta { padding:9px 10px; }
.card .meta .t { font-size:.83rem; font-weight:600; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.card .meta .y { font-size:.72rem; color:var(--muted); margin-top:2px; }
.card .playbtn {
  position:absolute; inset:0; display:grid; place-items:center; opacity:0; transition:.22s;
  background:linear-gradient(rgba(0,0,0,0), rgba(20,24,48,.75));
}
.card:hover .playbtn { opacity:1; }
.card .playbtn span { width:52px; height:52px; border-radius:50%; background:var(--grad); display:grid; place-items:center; box-shadow:0 8px 24px rgba(140,78,255,.6); }
.card .playbtn svg { width:22px; height:22px; fill:#fff; margin-left:3px; }

/* grid */
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:16px; }
.grid .card { width:auto; }

/* ── search / empty ── */
.notice { text-align:center; color:var(--muted); padding:60px 20px; }
.notice h3 { color:var(--txt); margin-bottom:8px; font-size:1.2rem; }
.spinner { width:40px; height:40px; border:3px solid var(--line); border-top-color:var(--accent); border-radius:50%; margin:60px auto; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── detail ── */
.detail { display:grid; grid-template-columns: 300px 1fr; gap:30px; padding-top:26px; }
.detail .cover { border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); align-self:start; position:sticky; top:80px; }
.detail .cover img { width:100%; display:block; }
.detail h1 { font-size:clamp(1.5rem,3vw,2.3rem); font-weight:800; margin-bottom:8px; }
.detail .sub { color:var(--muted); margin-bottom:14px; display:flex; gap:12px; flex-wrap:wrap; }
.detail .synopsis { color:#c7cce0; line-height:1.7; max-width:75ch; }
.detail .actions { display:flex; gap:12px; margin:20px 0; flex-wrap:wrap; }

/* ── player ── */
.player-overlay { position:fixed; inset:0; background:rgba(5,8,18,.92); z-index:100; display:flex; flex-direction:column; }
.player-head { display:flex; align-items:center; gap:14px; padding:14px 20px; }
.player-head .title { font-weight:700; flex:1; }
.player-wrap { flex:1; display:grid; place-items:center; padding:0 20px; }
video { max-width:100%; max-height:82vh; width:100%; border-radius:14px; background:#000; box-shadow:var(--shadow); }
.sources { display:flex; gap:8px; padding:14px 20px; flex-wrap:wrap; }
.sources .src { background:var(--panel); border:1px solid var(--line); color:var(--txt); padding:8px 14px; border-radius:10px; cursor:pointer; font-size:.85rem; }
.sources .src:hover { border-color:var(--accent); }

/* ── modal ── */
.modal-overlay { position:fixed; inset:0; background:rgba(4,7,16,.7); backdrop-filter:blur(6px); z-index:90; display:none; align-items:center; justify-content:center; padding:16px; }
.modal-overlay.open { display:flex; }
.modal { background:var(--bg2); border:1px solid var(--line); border-radius:20px; width:min(460px,100%); padding:24px; box-shadow:var(--shadow); }
.modal h3 { margin-bottom:6px; font-size:1.15rem; }
.modal .form { display:flex; flex-direction:column; gap:14px; margin-top:18px; }
.field label { display:block; font-size:.82rem; color:var(--muted); margin-bottom:6px; }
.field input, .field select {
  width:100%; background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:11px 12px;
  color:var(--txt); outline:none; font-family:inherit; font-size:.93rem;
}
.field input:focus, .field select:focus { border-color:var(--accent); }
.field .hint { font-size:.75rem; color:var(--muted); margin-top:5px; }
.rowline { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.modal-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:20px; }
.modal-actions .btn-ghost { background:var(--panel); }

/* ── admin panel ── */
.admin { max-width:820px; margin:0 auto; padding-top:26px; }
.admin h1 { font-size:1.5rem; margin-bottom:4px; }
.admin .sub { color:var(--muted); margin-bottom:22px; }
.repo-list { display:flex; flex-direction:column; gap:10px; margin-bottom:24px; }
.repo {
  display:flex; align-items:center; gap:14px; background:var(--panel); border:1px solid var(--line);
  border-radius:14px; padding:14px 16px; transition:.2s;
}
.repo:hover { border-color:rgba(109,92,255,.4); }
.repo .drag { color:var(--muted); cursor:grab; }
.repo .info { flex:1; min-width:0; }
.repo .info .n { font-weight:700; }
.repo .info .d { font-size:.78rem; color:var(--muted); margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.switch { position:relative; width:48px; height:26px; flex:none; }
.switch input { opacity:0; width:0; height:0; }
.switch .slider { position:absolute; inset:0; background:#2a3150; border-radius:20px; transition:.25s; cursor:pointer; }
.switch .slider:before { content:""; position:absolute; height:20px; width:20px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.25s; }
.switch input:checked + .slider { background:var(--grad); }
.switch input:checked + .slider:before { transform:translateX(22px); }
.repo .rm { background:none; border:none; color:#ff5b6e; cursor:pointer; font-size:1.1rem; padding:4px; }

.card-admin { background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:18px; }

/* footer */
footer { text-align:center; color:var(--muted); font-size:.8rem; padding:26px; border-top:1px solid var(--line); }

/* toast */
.toast { position:fixed; bottom:22px; left:50%; transform:translateX(-50%) translateY(80px); background:#171d33; border:1px solid var(--line); color:var(--txt); padding:12px 22px; border-radius:12px; box-shadow:var(--shadow); transition:.3s; z-index:200; opacity:0; }
.toast.show { transform:translateX(-50%) translateY(0); opacity:1; }

/* ── responsive ── */
@media (max-width:640px) {
  header { flex-wrap:wrap; gap:10px; }
  .searchbox { order:5; width:100%; }
  nav { order:4; }
  .brand { order:1; } .iconbtn{ order:3; margin-left:auto; }
  .detail { grid-template-columns:1fr; }
  .detail .cover { position:static; width:170px; }
  .card { width:122px; }
  .grid { grid-template-columns:repeat(auto-fill,minmax(122px,1fr)); }
  .hero { min-height:240px; padding:22px; }
}