:root {
  --bg: #0b0b0c;
  --surface-1: #141416;
  --surface-2: #18181b;
  --surface-3: #1f1f23;
  --line: #2a2a2f;
  --text: #e9e9ea;
  --muted: #a8a8ad;
  --muted2: #7f7f86;
  --accent: #ff3b3b;
  --pill: #232327;
  --pillOn: #2f2f35;
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  --shadow2: 0 16px 40px rgba(0, 0, 0, 0.4);
  --radius: 14px;
  --container: 1320px;
  --select-bg: #0f0f10;
  --select-item-hover: #17171a;
  --select-item-active: #1b66d1;
  --z-popover: 9000;
  --z-modal: 9500;

  /* footer height untuk perhitungan fixed */
  --footer-h: 52px;
  --header-h: 112px; /* ⬅️ tambahkan ini */
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Roboto", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  background: radial-gradient(
      1200px 600px at 50% -10%,
      rgba(255, 59, 59, 0.1),
      transparent 60%
    ),
    linear-gradient(#0b0b0c, #0b0b0c);
  color: var(--text);

  /* biar konten tidak ketutup footer fixed */
  padding-bottom: var(--footer-h);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  background: none;
  border: 0;
  color: inherit;
}

main {
  position: relative;
  z-index: 0;
  padding-top: 16px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

:focus-visible {
  outline: 2px solid rgba(255, 59, 59, 0.65);
  outline-offset: 2px;
  border-radius: 10px;
}

/* ===== Icons (SVG) ===== */
.svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.95;
}

.svg.sm {
  width: 14px;
  height: 14px;
}

.svg.lg {
  width: 18px;
  height: 18px;
}

/* ===== Topbar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(#121213, #101011);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.topbar-row {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:220px;
  flex:0 0 auto;
}

.brand.brand-wide{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-start;
  padding-top:6px; /* ini yang bikin logo turun */
  flex:0 0 auto;
  min-width:0;
}

.brand.brand-wide .brand-logo{
  display:block;
  height:56px;
  width:auto;
  max-width:240px;
  object-fit:contain;
}


/* Teks streaming di bawah logo */
.brand.brand-wide .brand-sub{
  margin:0;
  font-size:11px;
  font-weight:800;
  color:var(--muted2);
  letter-spacing:.4px;
  line-height:1;
}


/* Logo lebih besar, tetap dari assets */
.logo{
  width:44px;
  height:44px;
  border-radius:12px;
  background:url("/assets/img/tsvideo-mark.png") center / contain no-repeat;
  box-shadow:0 10px 20px rgba(255,59,59,.18);
  border:1px solid rgba(255,255,255,.10);
}


.brand-sub{
  font-size:11px;
  font-weight:800;
  color:var(--muted2);
  margin-top:3px;
  letter-spacing:.4px;
}

.brand-name {
  font-weight: 900;
  letter-spacing: 0.3px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 18px;
  line-height: 1;
}

.brand-name .accent {
  color: var(--accent);
}

.brand-sub {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted2);
  margin-top: 2px;
  letter-spacing: 0.4px;
}

.search {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  background: #0c0c0d;
  border: 1px solid #242428;
  border-radius: 12px;
  min-width: 220px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.search .icon {
  color: var(--muted);
}

.search input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 14px;
}

.search input::placeholder {
  color: #6f6f76;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex: 0 0 auto;
  position: relative;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: 0.12s ease;
}

.chip:hover {
  background: #151518;
  border-color: #35353b;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #141416;
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: 0.12s ease;
}

.btn:hover {
  background: #1a1a1d;
  border-color: #35353b;
}

.btn.primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 22px rgba(255, 59, 59, 0.16);
}

.btn.primary:hover {
  filter: brightness(1.05);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 0 10px;
}

.btn.ghost:hover {
  background: #151518;
  border-color: #151518;
  color: var(--text);
}

.avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #141416;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: 0.12s ease;
  padding: 0;
}

.avatar-btn:hover {
  background: #1a1a1d;
  border-color: #35353b;
}

.avatar-btn[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.18);
}

.hamburger-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #141416;
  display: none;
  place-items: center;
  cursor: pointer;
  transition: 0.12s ease;
  padding: 0;
}

.hamburger-btn:hover {
  background: #1a1a1d;
  border-color: #35353b;
}

.hamburger-btn[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.18);
}

/* ===== NAVBAR ===== */
.navrow {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  background: #0f0f10;
}

.nav-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-scroll {
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0 12px;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: max-content;
}

.nav-item {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: 0.12s ease;
  background: transparent;
  align-items: center;
  gap: 8px;
}

.nav-item:hover {
  background: #151518;
  border-color: #1f1f23;
}

.nav-item.active {
  background: rgba(255, 59, 59, 0.1);
  border-color: rgba(255, 59, 59, 0.22);
}

.caret {
  opacity: 0.8;
  display: inline-grid;
  place-items: center;
}

/* Premium (kuning) */
.is-premium {
  color: #f6c744; /* kuning */
}

.is-premium:hover {
  color: #ffd76a; /* kuning lebih terang pas hover */
}

/* opsional: bikin icon juga ikut kuning */
.is-premium .svg {
  stroke: currentColor;
}

/* opsional: kalau Premium lagi active */
.nav-item.is-premium.active {
  background: rgba(246, 199, 68, 0.12);
  border-color: rgba(246, 199, 68, 0.26);
}

/* Categories button (desktop) */
.cat-select {
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
  transition: 0.12s ease;
}

.cat-select:hover {
  background: #151518;
  border-color: #1f1f23;
}

.cat-select[aria-expanded="true"] {
  background: #151518;
  border-color: #1f1f23;
}

/* ===== Popover menus ===== */
.select-menu {
  position: fixed;
  width: 260px;
  max-width: calc(100vw - 32px);
  background: var(--select-bg);
  border: 1px solid #2a2a2f;
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow2);
  z-index: var(--z-popover);
  max-height: 420px;
  overflow: auto;
  scrollbar-width: thin;
}

/* Wajib: atribut hidden harus selalu menang */
[hidden] {
  display: none !important;
}

.select-item {
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.select-item:hover {
  background: var(--select-item-hover);
}

.select-item.is-selected {
  background: var(--select-item-active);
  color: #fff;
}

.select-item .right {
  opacity: 0.85;
}

/* Auth menu */
.auth-menu {
  position: fixed;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--surface-1);
  border: 1px solid #2a2a2f;
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow2);
  z-index: var(--z-popover);
}

/* Mobile: auth menu jadi center fixed (karena tombol akun pindah ke drawer) */
@media (max-width: 980px) {
  .auth-menu {
    position: fixed;
    left: 50%;
    top: calc(var(--header-h) + 12px);
    transform: translateX(-50%);
    width: min(420px, calc(100vw - 24px));
    z-index: 10000;
  }
}

.auth-menu[hidden] {
  display: none;
}

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
}

.auth-title {
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #dadada;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-hint {
  color: var(--muted2);
  font-size: 12px;
  font-weight: 800;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}

.field input {
  height: 40px;
  border-radius: 12px;
  border: 1px solid #2a2a2f;
  background: #0c0c0d;
  color: var(--text);
  padding: 0 12px;
  outline: none;
  font-size: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.field input::placeholder {
  color: #6f6f76;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 0;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  user-select: none;
  cursor: pointer;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.auth-submit {
  width: 100%;
  justify-content: center;
  height: 40px;
  border-radius: 12px;
}

.auth-foot {
  margin: 4px 2px 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}

.auth-foot a {
  color: #d9d9dc;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-foot a:hover {
  color: #fff;
}

/* ===== Mobile drawer overlay ===== */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  z-index: var(--z-modal);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}

.mobile-overlay[hidden] {
  display: none;
}

.mobile-drawer {
  width: min(520px, 50vw);
  height: 100%;
  background: var(--surface-1);
  border-left: 1px solid #2a2a2f;
  box-shadow: var(--shadow2);
  padding: 12px 12px 16px;
  overflow: auto;
  outline: none;
}

.mhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
}

.mtitle {
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #dadada;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mclose {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: 0.12s ease;
}

.mclose:hover {
  background: #151518;
  border-color: #242428;
  color: var(--text);
}

.mgroup {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 2px 4px;
}

.mitem {
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: 0.12s ease;
}

.mitem:hover {
  background: #1a1a1d;
  border-color: #2a2a2f;
}

.mitem.active {
  background: rgba(255, 59, 59, 0.1);
  border-color: rgba(255, 59, 59, 0.22);
}

.mitem .left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mitem .left span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mitem .right {
  color: var(--muted2);
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mcaret {
  display: inline-grid;
  place-items: center;
  transition: transform 0.14s ease;
  opacity: 0.9;
}

.mitem[aria-expanded="true"] .mcaret {
  transform: rotate(180deg);
}

/* sub list categories (mobile) */
.msub {
  margin: 2px 0 2px 14px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msub-item {
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.01);
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.msub-item:hover {
  background: #1a1a1d;
  border-color: #2a2a2f;
}

.msub-item.is-selected {
  background: rgba(27, 102, 209, 0.18);
  border-color: rgba(27, 102, 209, 0.35);
}

/* ===== Footer fixed ===== */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  background: linear-gradient(#101011, #0b0b0c);
  border-top: 1px solid var(--line);
  z-index: 45;
}

.site-footer .container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.site-footer small {
  color: var(--muted2);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.2px;
}

/* ===== actionsPack: dipindah ke drawer saat mobile (search tetap di luar) ===== */
.actions-pack {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* slot di drawer */
.m-actions-slot {
  padding: 0 2px 10px;
  margin: 0 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* style saat actionsPack sudah berada di dalam drawer */
.mobile-drawer .actions-pack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 4px 12px;
}

/* bikin tombol full width di drawer */
.mobile-drawer .actions-pack > button {
  width: 100%;
  justify-content: space-between;
}

/* label akun hanya tampil di drawer */
.avatar-btn .btn-label {
  display: none;
}

.mobile-drawer .avatar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-drawer .avatar-btn .btn-label {
  display: inline;
  font-weight: 900;
}

/* Mobile: sembunyikan actionsPack di topbar (search tetap tampil) */
@media (max-width: 980px) {
  .top-actions .actions-pack {
    display: none;
  }
}

/* ===== Responsive global (header/nav) ===== */
@media (max-width: 980px) {
  .brand {
    min-width: auto;
  }

  .topbar-row {
    flex-wrap: wrap;
  }

  .search {
    flex: 1 1 100%;
    order: 3;
  }

  .top-actions {
    margin-left: auto;
  }
}

@media (max-width: 680px) {
  .navrow {
    display: none;
  }

  .hamburger-btn {
    display: inline-grid;
  }
}

/* Reduced motion (global) */
@media (prefers-reduced-motion: reduce) {
  .mcaret {
    transition: none;
  }
}

/* ========================= CATEGORY UI (public) ========================= */
.cat-list,
#mobileCats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

/* catMenu hanya flex saat sedang dibuka */
#catMenu:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

/* Base button reset + styling */
.cat-opt,
.side-cat,
.mcat {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease,
    box-shadow 0.12s ease;
}

/* Dot icon biar “hidup” kayak dummy */
.cat-opt::before,
.side-cat::before,
.mcat::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
  flex: 0 0 10px;
}

/* Hover */
.cat-opt:hover,
.side-cat:hover,
.mcat:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

/* Active */
.cat-opt.active,
.side-cat.active,
.mcat.active {
  border-color: rgba(255, 59, 59, 0.45);
  background: linear-gradient(
    180deg,
    rgba(255, 59, 59, 0.14),
    rgba(255, 255, 255, 0.04)
  );
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.1px;
}

.cat-opt.active::before,
.side-cat.active::before,
.mcat.active::before {
  background: rgba(255, 59, 59, 0.95);
  box-shadow: 0 0 0 3px rgba(255, 59, 59, 0.15);
}

/* Dropdown menu container (catMenu) biar kayak popup rapi */
.select-menu#catMenu {
  position: fixed;
  z-index: var(--z-popover);
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 10, 12, 0.95);
  backdrop-filter: blur(10px);
  max-height: min(420px, calc(100vh - var(--footer-h) - 80px));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.select-menu#catMenu::-webkit-scrollbar {
  width: 6px;
}

.select-menu#catMenu::-webkit-scrollbar-track {
  background: transparent;
}

.select-menu#catMenu::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 10px;
}

.select-menu#catMenu::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.4);
}

/* Mobile sub list spacing */
#mobileCats {
  padding: 10px 2px;
}



/* =========================
   MOBILE HEADER FIX
   ========================= */
@media (max-width: 980px){
  /* rapikan tinggi header */
  .topbar-row{
    gap:10px;
    padding:10px 0;
  }

  /* logo jangan kegedean di HP */
  .brand.brand-wide .brand-logo{
    height:38px;      /* sebelumnya 52/56 terlalu tinggi di HP */
    max-width:160px;  /* biar gak makan 1 baris */
  }

  /* kalau kamu masih pakai .brand biasa */
  .brand{
    min-width:0;
  }

  /* search jadi full width dan lebih compact */
  .search{
    height:40px;
    border-radius:14px;
  }

  /* top actions rapat dan gak bikin layout makin tinggi */
  .top-actions{
    gap:8px;
  }

  /* tombol icon bulat lebih kecil di HP */
  .avatar-btn,
  .hamburger-btn{
    width:34px;
    height:34px;
  }

  .btn.ghost{
    height:34px;
    padding:0 10px;
    border-radius:999px;
  }

  .chip{
    height:34px;
    padding:0 10px;
    border-radius:999px;
  }
}

@media (max-width: 520px){
  /* di layar kecil, tombol Upload bikin sempit -> jadi icon-only */
  .btn.ghost{
    padding:0 10px;
  }
  .btn.ghost svg{
    margin:0;
  }
}



@media (max-width: 980px){
  .site-footer{
    position: static;
    height: auto;
    padding: 14px 0;
  }
  body{
    padding-bottom: 0;
  }
}











