/* ==========================================================================
   NusaTube — assets/css/video.css  (halaman video, gaya YouTube)
   Memakai token dari nusatube.css (--surface, --line, --brand, dst).
   Muat SETELAH nusatube.css.
   ========================================================================== */

[hidden] { display: none !important; }

/* ── Avatar (dipakai kreator, komentar, profil) ───────────── */
.nt-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: 50%; overflow: hidden; background: var(--tint); color: var(--brand-ink);
  font-weight: 700; font-family: 'Sora', 'Inter', sans-serif; user-select: none;
}
.nt-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nt-avatar--sm { width: 28px; height: 28px; font-size: 12px; }
.nt-avatar--md { width: 40px; height: 40px; font-size: 16px; }
.nt-avatar--lg { width: 48px; height: 48px; font-size: 19px; }
.nt-avatar--letter { background: linear-gradient(135deg, var(--brand), var(--sky)); color: var(--on-brand); }

/* ── Layout dua kolom ─────────────────────────────────────── */
.nt-watch { padding-top: 20px; }
.nt-watch__layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start;
}
.nt-watch__primary { min-width: 0; }

/* ── Pemutar ──────────────────────────────────────────────── */
.nt-player {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow);
}
.nt-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.nt-player__empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: #9fb8bb; background: var(--surface-2); text-align: center; padding: 20px;
}
.nt-player__empty .nt-icon { width: 40px; height: 40px; }

.nt-watch__title {
  margin: 16px 0 12px; font-family: 'Sora', 'Inter', sans-serif; font-weight: 700;
  font-size: clamp(18px, 2.4vw, 24px); line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere;
}

/* ── Baris kreator + aksi ─────────────────────────────────── */
.nt-watch__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; }
.nt-channel { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nt-channel__avatar { display: inline-flex; border-radius: 50%; transition: transform .15s; }
a.nt-channel__avatar:hover { transform: scale(1.05); }
.nt-channel__info { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; margin-right: 6px; }
.nt-channel__name { font-weight: 600; font-size: 15.5px; display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
a.nt-channel__name:hover { color: var(--brand-ink); }
.nt-channel__sub { font-size: 12.5px; color: var(--muted); }
.nt-verified { width: 16px; height: 16px; color: var(--sky); flex-shrink: 0; }

.nt-watch__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* tombol tonal (like / bagikan) */
.nt-btn--tonal { background: var(--surface-2); color: var(--text); }
.nt-btn--tonal:hover { background: var(--surface-3); }
.nt-btn--tonal.is-on { background: var(--tint); color: var(--brand-ink); }
.nt-btn--tonal.is-on .nt-icon { fill: currentColor; }
.nt-btn--tonal:disabled, .nt-btn--follow:disabled { opacity: .6; cursor: wait; }
.nt-btn__count:empty { display: none; }
.nt-btn__count { font-size: 12.5px; opacity: .75; }

/* tombol ikuti: dua keadaan */
.nt-btn--follow { background: var(--text); color: var(--bg); }
.nt-btn--follow:hover { opacity: .88; }
.nt-btn--follow .nt-follow__on { display: none; }
.nt-btn--follow.is-on { background: var(--surface-2); color: var(--text); }
.nt-btn--follow.is-on .nt-follow__off { display: none; }
.nt-btn--follow.is-on .nt-follow__on { display: inline-flex; align-items: center; gap: 8px; }
.nt-btn--follow .nt-follow__off { display: inline-flex; align-items: center; gap: 8px; }

/* ── Deskripsi ────────────────────────────────────────────── */
.nt-desc { margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.nt-desc__stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 13.5px; color: var(--muted); }
.nt-desc__stats > span { display: inline-flex; align-items: center; gap: 6px; }
.nt-desc__stats strong { color: var(--text); font-weight: 600; }
.nt-desc__stats .nt-icon { width: 15px; height: 15px; }
.nt-desc__text { margin-top: 12px; font-size: 14.5px; line-height: 1.65; color: var(--text); overflow-wrap: anywhere; }
.nt-desc__text.is-collapsed { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nt-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.nt-tag { font-size: 13px; color: var(--brand-ink); }
.nt-tag:hover { text-decoration: underline; }

.nt-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: var(--tint); color: var(--brand-ink);
}
.nt-pill .nt-icon { width: 14px; height: 14px; }
a.nt-pill:hover { background: var(--surface-3); }
.nt-pill--creator { background: var(--brand); color: var(--on-brand); height: 20px; padding: 0 8px; font-size: 11px; }

.nt-link-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 13px; font-weight: 600;
  color: var(--muted); background: none; border: 0; cursor: pointer;
}
.nt-link-btn:hover { color: var(--brand-ink); }
.nt-link-btn .nt-icon { width: 14px; height: 14px; }

/* ── Komentar ─────────────────────────────────────────────── */
.nt-comments { margin-top: 26px; }
.nt-comments__title { font-family: 'Sora', 'Inter', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.nt-comments__note, .nt-comments__empty { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.nt-comments__note .nt-icon { width: 18px; height: 18px; }
.nt-comments__empty { padding: 20px 0; justify-content: center; }
.nt-comments__login {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 14px 16px;
  border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: 14px;
}
.nt-comments__login .nt-icon { color: var(--brand-ink); }
.nt-comments__more { display: flex; justify-content: center; margin-top: 18px; }
.nt-comments__more[hidden], .nt-comments__more [hidden] { display: none; }

.nt-input {
  width: 100%; padding: 10px 2px; font: inherit; font-size: 14.5px; color: var(--text);
  background: transparent; border: 0; border-bottom: 1.5px solid var(--line); border-radius: 0; outline: none;
  transition: border-color .2s;
}
.nt-input::placeholder { color: var(--muted); }
.nt-input:focus { border-bottom-color: var(--brand-ink); }
.nt-input--area { resize: none; line-height: 1.5; min-height: 42px; overflow-y: auto; }

.nt-cform { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 22px; }
.nt-cform__fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.nt-cform__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.nt-cform__actions[hidden] { display: none; }
.nt-cform__actions .nt-btn[disabled] { opacity: .45; cursor: not-allowed; }
.nt-cform--reply { margin: 10px 0 4px; }

.nt-comment { display: flex; gap: 12px; margin-bottom: 18px; }
.nt-comment--reply { margin: 14px 0 0; }
.nt-comment__main { flex: 1; min-width: 0; }
.nt-comment__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; }
.nt-comment__author { font-weight: 600; color: var(--text); }
a.nt-comment__author:hover { color: var(--brand-ink); }
.nt-comment__time { color: var(--muted); font-size: 12.5px; }
.nt-comment__body { margin-top: 3px; font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.nt-comment__actions { margin-top: 2px; }
.nt-comment__replies:empty { display: none; }
.nt-comment__replies { margin-top: 4px; }

/* ── Sidebar video terkait ────────────────────────────────── */
.nt-side__title { font-family: 'Sora', 'Inter', sans-serif; font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.nt-side__list { display: flex; flex-direction: column; gap: 12px; }
.nt-side-card { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 12px; border-radius: 12px; transition: background .2s; }
.nt-side-card:hover { background: var(--surface-2); }
.nt-side-card__thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--surface-3);
}
.nt-side-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nt-side-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 2px 4px 2px 0; }
.nt-side-card__title {
  font-size: 14px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nt-side-card__who, .nt-side-card__meta { font-size: 12.5px; color: var(--muted); }

/* ── Modal bagikan ────────────────────────────────────────── */
.nt-modal {
  position: fixed; left: 50%; top: 50%; z-index: 105; width: min(440px, calc(100vw - 32px));
  padding: 18px 20px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); transform: translate(-50%, -46%) scale(.97); opacity: 0; visibility: hidden;
  transition: transform .2s, opacity .2s, visibility .2s;
}
.nt-modal.is-open { transform: translate(-50%, -50%) scale(1); opacity: 1; visibility: visible; }
.nt-modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.nt-modal__head h3 { font-family: 'Sora', 'Inter', sans-serif; font-size: 17px; }
.nt-modal__head button { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.nt-modal__head button:hover { background: var(--surface-2); }

.nt-share { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.nt-share__item { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 68px; font-size: 12px; color: var(--text); text-align: center; }
.nt-share__item[hidden] { display: none; }
.nt-share__logo {
  display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%;
  font-weight: 700; font-size: 15px; color: #fff; background: var(--brand); transition: transform .15s;
}
.nt-share__item:hover .nt-share__logo { transform: translateY(-2px); }
.nt-share__logo--whatsapp { background: #25D366; }
.nt-share__logo--facebook { background: #1877F2; font-size: 22px; }
.nt-share__logo--x        { background: #111; }
.nt-share__logo--telegram { background: #229ED9; }
button.nt-share__item .nt-share__logo { background: var(--surface-3); color: var(--text); }
.nt-sharelink { display: flex; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.nt-sharelink input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; font: inherit; font-size: 13.5px; color: var(--text); }
.nt-sharelink .nt-btn { height: 36px; }

/* ── Toast ────────────────────────────────────────────────── */
.nt-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 120;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 999px; background: var(--text); color: var(--bg);
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); transition: opacity .2s, transform .2s;
}
.nt-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ── Responsif ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .nt-watch__layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; }
  .nt-side-card { grid-template-columns: 148px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .nt-watch__layout { grid-template-columns: 1fr; }
  .nt-side-card { grid-template-columns: 168px minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .nt-watch { padding-top: 0; }
  .nt-watch__primary { margin-inline: -16px; }              /* pemutar penuh lebar */
  .nt-player { border-radius: 0; box-shadow: none; }
  .nt-watch__title, .nt-watch__bar, .nt-desc, .nt-comments { margin-inline: 16px; }
  .nt-desc { margin-top: 14px; }
  .nt-watch__actions { width: 100%; }
  .nt-watch__actions .nt-btn { flex: 1; }
  .nt-channel { width: 100%; }
  .nt-channel__info { flex: 1; }
  .nt-side-card { grid-template-columns: 140px minmax(0, 1fr); }
  .nt-share__item { width: 60px; }
}