/* Jadwal TV Indonesia — style.css v2: 1 kolom, modern, mobile-first */
:root{
  --bg:#f5f6f8; --surface:#ffffff; --surface-2:#f0f2f5;
  --text:#101828; --muted:#667085; --faint:#98a2b3;
  --line:#e7eaef; --line-soft:#eef1f4;
  --brand:#111827; --accent:#e11d48; --accent-soft:#fff1f2;
  --link:#2563eb; --live:#e11d48; --live-bg:#fff1f2;
  --upcoming:#067647; --upcoming-bg:#ecfdf3;
  --done:#667085; --radius:18px; --radius-sm:12px;
  --shadow:0 1px 2px rgba(16,24,40,.06),0 1px 3px rgba(16,24,40,.06);
  --shadow-lg:0 8px 24px rgba(16,24,40,.10);
}
[data-theme="dark"]{
  --bg:#0b0f14; --surface:#131a23; --surface-2:#1b2531;
  --text:#f2f4f7; --muted:#98a2b3; --faint:#667085;
  --line:#232e3d; --line-soft:#1b2531;
  --brand:#f2f4f7; --accent:#fb7185; --accent-soft:#2a1218;
  --link:#7aa5ff; --live:#fb7185; --live-bg:#2a1218;
  --upcoming:#32d583; --upcoming-bg:#0f241a;
  --done:#98a2b3; --shadow:0 1px 2px rgba(0,0,0,.4);
  --shadow-lg:0 8px 24px rgba(0,0,0,.5);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;background:var(--bg);color:var(--text);line-height:1.55;-webkit-font-smoothing:antialiased}
.wrap{max-width:720px;margin:0 auto;padding:0 16px}
a{color:var(--link);text-decoration:none}
a:hover{text-decoration:underline}
button{font:inherit;cursor:pointer;color:var(--text)}
input,select{font:inherit;color:var(--text)}
img{display:block}

/* ---------- Header ---------- */
.topbar{background:color-mix(in srgb,var(--surface) 88%,transparent);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:30}
.topbar-inner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 16px;max-width:720px;margin:0 auto}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--text)}
.brand:hover{text-decoration:none}
.brand-mark{width:38px;height:38px;border-radius:11px;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center;font-size:19px;flex:0 0 38px}
.brand-text{display:flex;flex-direction:column;line-height:1.2}
.brand-text strong{font-size:17px;font-weight:800;letter-spacing:-.01em}
.brand-text small{color:var(--muted);font-size:12px}
.topbar-right{display:flex;align-items:center;gap:8px}
.clock{font-variant-numeric:tabular-nums;font-weight:700;font-size:13.5px;background:var(--surface-2);border:1px solid var(--line);padding:6px 11px;border-radius:999px;white-space:nowrap}
.icon-btn{width:36px;height:36px;border-radius:50%;border:1px solid var(--line);background:var(--surface);font-size:16px;display:flex;align-items:center;justify-content:center}
.icon-btn:hover{border-color:var(--accent)}

/* ---------- Hero ---------- */
.hero{padding:26px 0 6px}
.hero h1{margin:0;font-size:27px;font-weight:800;letter-spacing:-.02em;line-height:1.2}
.hero h1 .live-dot{color:var(--live)}
.hero p{margin:6px 0 0;color:var(--muted);font-size:14.5px}
.hero p b{color:var(--text)}

/* ---------- Date strip (sticky) ---------- */
.date-strip-wrap{position:sticky;top:60px;z-index:25;background:color-mix(in srgb,var(--bg) 92%,transparent);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);margin:0 -16px;padding:10px 16px 8px;border-bottom:1px solid var(--line-soft)}
.date-strip{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
.date-strip::-webkit-scrollbar{display:none}
.date-pill{flex:0 0 auto;border:1px solid var(--line);background:var(--surface);border-radius:14px;padding:7px 12px;text-align:center;line-height:1.25;min-width:58px;box-shadow:var(--shadow)}
.date-pill small{display:block;font-size:11px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.date-pill b{display:block;font-size:16px;font-weight:800;font-variant-numeric:tabular-nums}
.date-pill:hover{border-color:var(--accent)}
.date-pill.active{background:var(--brand);border-color:var(--brand);color:#fff}
.date-pill.active small{color:rgba(255,255,255,.75)}
.date-pill.today:not(.active){border-color:var(--accent);color:var(--accent)}
.date-pill.today:not(.active) small{color:var(--accent)}

/* ---------- Controls ---------- */
.controls{margin:14px 0 4px;display:flex;flex-direction:column;gap:10px}
.search-row{display:flex;gap:8px}
.search-box{flex:1;display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:0 6px 0 14px;box-shadow:var(--shadow)}
.search-box:focus-within{border-color:var(--accent)}
.search-box input{flex:1;min-width:0;border:0;background:none;outline:none;padding:11px 0;font-size:15px}
.search-box input::placeholder{color:var(--faint)}
.search-clear{border:0;background:none;font-size:16px;color:var(--muted);width:30px;height:30px;border-radius:50%;display:none}
.search-clear.show{display:block}
.filter-row{display:flex;gap:8px}
.filter-row select{flex:1;min-width:0;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);font-size:14px}
.filter-row input[type="date"]{padding:9px 10px;border:1px solid var(--line);border-radius:12px;background:var(--surface);font-size:14px;max-width:158px}

/* ---------- Status ---------- */
.status{color:var(--muted);font-size:13.5px;margin:12px 0 4px}
.status.error{color:var(--live)}
.notice{border:1px solid #f79009;background:#fffaeb;color:#7a2e0e;border-radius:14px;padding:12px 14px;margin-top:16px;font-size:14px}
[data-theme="dark"] .notice{background:#2a2113;color:#fdb022;border-color:#7a4a06}
.ad{margin:16px 0;text-align:center;overflow:hidden}
.ad:empty{display:none}

/* ---------- Section titles ---------- */
.section{margin-top:22px}
.section-head{display:flex;align-items:baseline;gap:10px;margin:0 0 12px}
.section-head h2{margin:0;font-size:18px;font-weight:800;letter-spacing:-.01em}
.section-head .count{color:var(--muted);font-size:13px;font-weight:600}
.section-head .live-pill{margin-left:auto}

/* ---------- Live badge & dots ---------- */
.live-pill{display:inline-flex;align-items:center;gap:6px;background:var(--live);color:#fff;font-size:11.5px;font-weight:800;letter-spacing:.06em;padding:4px 10px;border-radius:999px}
.live-dot{width:8px;height:8px;border-radius:50%;background:currentColor;display:inline-block;animation:pulse 1.6s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.45;transform:scale(.8)}}
@media (prefers-reduced-motion:reduce){.live-dot{animation:none}}

/* ---------- Spotlight (Sedang Tayang) ---------- */
.spotlight-list{display:flex;flex-direction:column;gap:12px}
.spot-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.spot-card:hover{box-shadow:var(--shadow-lg)}
.spot-thumb{position:relative;aspect-ratio:16/9;background:var(--surface-2);overflow:hidden}
.spot-thumb img{width:100%;height:100%;object-fit:cover}
.spot-thumb .live-pill{position:absolute;top:10px;left:10px;box-shadow:0 2px 8px rgba(0,0,0,.35)}
.spot-thumb .spot-channel{position:absolute;left:10px;bottom:10px;background:rgba(10,10,15,.72);color:#fff;font-size:12.5px;font-weight:700;padding:4px 10px;border-radius:999px;backdrop-filter:blur(4px)}
.spot-body{padding:13px 15px 14px}
.spot-body h3{margin:0 0 2px;font-size:16.5px;font-weight:800;letter-spacing:-.01em;line-height:1.3}
.spot-meta{color:var(--muted);font-size:13px;font-variant-numeric:tabular-nums}
.spot-next{margin-top:9px;padding-top:9px;border-top:1px dashed var(--line);color:var(--muted);font-size:13.5px}
.spot-next b{color:var(--text)}
.progress{height:5px;border-radius:999px;background:var(--surface-2);overflow:hidden;margin-top:10px}
.progress i{display:block;height:100%;background:var(--live);border-radius:999px;transition:width .6s ease}
.progress-label{display:flex;justify-content:space-between;color:var(--muted);font-size:12px;margin-top:5px;font-variant-numeric:tabular-nums}

/* ---------- Channel cards ---------- */
.channel-list{display:flex;flex-direction:column;gap:12px}
.channel-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.channel-card:hover{box-shadow:var(--shadow-lg)}
.channel-head{display:flex;align-items:center;gap:12px;width:100%;text-align:left;background:none;border:0;padding:14px 15px;color:var(--text)}
.avatar{width:48px;height:48px;flex:0 0 48px;border-radius:14px;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:15px;letter-spacing:.02em}
.channel-head .ch-name{flex:1;min-width:0}
.channel-head h3{margin:0;font-size:16px;font-weight:800;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.channel-head .ch-meta{color:var(--muted);font-size:12.5px;margin-top:1px}
.chevron{flex:0 0 auto;width:30px;height:30px;border-radius:50%;background:var(--surface-2);display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:14px;transition:transform .25s ease}
.channel-card.open .chevron{transform:rotate(180deg);background:var(--brand);color:#fff}
.channel-now{padding:0 15px 14px}
.now-row{display:flex;gap:10px;align-items:flex-start}
.now-row .time-chip{flex:0 0 auto;font-variant-numeric:tabular-nums;font-weight:800;font-size:13px;color:var(--live);background:var(--live-bg);border-radius:8px;padding:4px 8px;margin-top:1px;white-space:nowrap}
.now-row .now-title{flex:1;min-width:0}
.now-row .now-title strong{display:block;font-size:15px;font-weight:700;line-height:1.35}
.now-row .now-title span{color:var(--muted);font-size:13px;display:block;margin-top:1px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.next-row{margin-top:10px;padding:9px 11px;background:var(--surface-2);border-radius:10px;font-size:13.5px;color:var(--muted);display:flex;gap:8px;align-items:baseline}
.next-row b{color:var(--text);font-variant-numeric:tabular-nums;white-space:nowrap}
.next-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.watch-link{font-size:13px;font-weight:700;white-space:nowrap}
.channel-programs{border-top:1px solid var(--line)}
.channel-programs[hidden]{display:none}

/* ---------- Program timeline ---------- */
.programs{list-style:none;margin:0;padding:6px 0}
.program{border-left:3px solid transparent}
.program.is-live{background:var(--live-bg);border-left-color:var(--live)}
.program-head{display:flex;gap:12px;align-items:flex-start;width:100%;text-align:left;background:none;border:0;padding:11px 15px;color:var(--text)}
.program-head:hover{background:rgba(37,99,235,.05)}
.program.is-live .program-head:hover{background:none}
.time{flex:0 0 62px;font-variant-numeric:tabular-nums;font-weight:800;font-size:13.5px;padding-top:2px}
.time small{display:block;font-weight:600;color:var(--muted);font-size:11.5px}
.p-title{flex:1;min-width:0}
.p-title strong{display:block;font-size:14.5px;font-weight:650;line-height:1.35}
.p-title span{color:var(--muted);font-size:13px;display:block;margin-top:1px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.badge{flex:0 0 auto;font-size:10.5px;font-weight:800;letter-spacing:.04em;padding:3px 8px;border-radius:999px;white-space:nowrap;margin-top:3px}
.badge.live{background:var(--live);color:#fff}
.badge.upcoming{background:var(--upcoming-bg);color:var(--upcoming)}
.badge.done{background:var(--surface-2);color:var(--done)}
.program-detail{padding:0 15px 13px 89px;color:var(--muted);font-size:13.5px}
.program-detail[hidden]{display:none}
.program-detail img{max-width:100%;border-radius:12px;margin:2px 0 8px}
.program-detail p{margin:6px 0}
.programs-empty{padding:16px;color:var(--muted);font-size:14px}

/* ---------- Skeleton ---------- */
.skeleton{border-radius:var(--radius);background:var(--surface);border:1px solid var(--line);padding:15px}
.skeleton .sk{border-radius:8px;background:linear-gradient(90deg,var(--surface-2) 25%,var(--line-soft) 50%,var(--surface-2) 75%);background-size:200% 100%;animation:shimmer 1.3s infinite}
@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
.empty{padding:22px 16px;color:var(--muted);text-align:center;font-size:14.5px;background:var(--surface);border:1px dashed var(--line);border-radius:var(--radius)}
.hint{color:var(--muted);font-size:13px;margin:20px 0 28px}

/* ---------- Footer ---------- */
.footer{border-top:1px solid var(--line);background:var(--surface);padding:24px 0 32px;margin-top:10px}
.footer p{margin:6px 0}
.muted{color:var(--muted);font-size:13.5px}

@media (max-width:480px){
  .hero{padding-top:20px}
  .hero h1{font-size:23px}
  .brand-text small{display:none}
  .clock{display:none}
  .filter-row{flex-wrap:wrap}
  .filter-row input[type="date"]{max-width:none;flex:1}
  .program-detail{padding-left:15px}
  .time{flex-basis:54px}
}
