/* =========================================================================
   iLmTube — "lantern & manuscript" theme
   Deep ink-teal night, brass lamplight accent, serif display for titles,
   an eight-point star (rub el hizb) as the one recurring signature mark.
   ========================================================================= */

:root {
  --ink: #0d1715;
  --ink-2: #101f1c;
  --surface: #142723;
  --surface-2: #1a3129;
  --border: rgba(233, 224, 195, 0.10);
  --border-strong: rgba(233, 224, 195, 0.20);
  --text: #eef1ea;
  --text-muted: #9db3a9;
  --text-faint: #6d8079;
  --gold: #c9a227;
  --gold-light: #e6c765;
  --gold-dim: rgba(201, 162, 39, 0.35);
  --danger: #d16a5a;
  --radius: 10px;
  --radius-lg: 16px;
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-ui: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

.bv-body {
  background: var(--ink);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(201,162,39,0.09), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 0%, rgba(233,224,195,0.05), transparent 55%);
  color: var(--text);
  font-family: var(--font-ui);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ---------- Star mark (signature element) ---------- */
.bv-star {
  display: inline-block;
  width: 1em; height: 1em;
  background: currentColor;
  clip-path: polygon(
    50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%
  );
}

/* ---------- Top bar ---------- */
.bv-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  background: rgba(13, 23, 21, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.bv-brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 19px; letter-spacing: 0.2px;
  color: var(--text); flex-shrink: 0;
}
.bv-brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(150deg, var(--gold-light), var(--gold) 70%);
  display: flex; align-items: center; justify-content: center;
  color: #1a1305; font-size: 12px;
  box-shadow: 0 3px 10px rgba(201,162,39,0.35);
}
.bv-search {
  flex: 1; display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 4px 3px 16px;
  max-width: 560px;
}
.bv-search input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 14px; padding: 9px 6px; font-family: var(--font-ui);
}
.bv-search input::placeholder { color: var(--text-faint); }
.bv-search button {
  width: 34px; height: 34px; border-radius: 50%; border: none; flex-shrink: 0;
  background: var(--gold); color: #1a1305; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.bv-search button:hover { background: var(--gold-light); }

/* ---------- Category pills ---------- */
.bv-cats {
  display: flex; gap: 9px; padding: 12px 18px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.bv-cats::-webkit-scrollbar { display: none; }
.bv-pill {
  flex-shrink: 0; white-space: nowrap;
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; padding: 7px 15px;
  border-radius: 999px; cursor: pointer; transition: all .15s ease;
}
.bv-pill:hover { border-color: var(--border-strong); color: var(--text); }
.bv-pill.active { background: var(--gold); color: #1a1305; border-color: var(--gold); }

/* ---------- Grid ---------- */
.bv-container { padding: 6px 18px 60px; max-width: 1400px; margin: 0 auto; }
.bv-heading-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 2px 6px;
}
.bv-heading-row h1 {
  font-family: var(--font-display); font-weight: 500; font-size: 22px; margin: 0;
}
.bv-heading-row .bv-count { color: var(--text-faint); font-size: 13px; }

.bv-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 16px;
}
@media (max-width: 1100px) { .bv-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .bv-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 10px; } }
@media (max-width: 460px)  { .bv-grid { grid-template-columns: 1fr; } }

.bv-card { display: block; content-visibility: auto; contain-intrinsic-size: 0 260px; }
.bv-thumb {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
}
.bv-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.bv-card:hover .bv-thumb img { transform: scale(1.04); }
.bv-dur {
  position: absolute; right: 6px; bottom: 6px;
  background: rgba(13,23,21,0.85); color: var(--text);
  font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.bv-play-hover {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(13,23,21,0); color: var(--gold-light);
  opacity: 0; transition: all .2s ease; font-size: 26px;
}
.bv-card:hover .bv-play-hover { opacity: 1; background: rgba(13,23,21,0.35); }
.bv-card-meta { padding: 9px 2px 0; }
.bv-card-meta h3 {
  margin: 0; font-size: 14.5px; font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bv-card-sub { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; }
.bv-card-stats { color: var(--text-faint); font-size: 11.5px; margin-top: 2px; }

/* ---------- Load more / spinner ---------- */
.bv-sentinel { display: flex; justify-content: center; padding: 30px 0; }
.bv-spinner {
  width: 26px; height: 26px; color: var(--gold);
  animation: bv-spin 1.1s linear infinite;
}
@keyframes bv-spin { to { transform: rotate(360deg); } }

/* ---------- Empty state ---------- */
.bv-empty-wrap { display: flex; align-items: center; justify-content: center; min-height: 70vh; padding: 30px 20px; }
.bv-empty-card { max-width: 420px; text-align: center; }
.bv-empty-icon {
  width: 84px; height: 84px; margin: 0 auto 20px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--gold);
}
.bv-empty-card h1 { font-family: var(--font-display); font-weight: 500; font-size: 22px; margin: 0 0 8px; }
.bv-empty-card p { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin: 0 0 22px; }

.bv-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: 13.5px;
  border: none; cursor: pointer;
}
.bv-btn-primary { background: var(--gold); color: #1a1305; }
.bv-btn-primary:hover { background: var(--gold-light); }
.bv-btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }

/* ---------- Watch page ---------- */
.bv-watch-wrap { max-width: 1400px; margin: 0 auto; padding: 16px 18px 60px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 26px; }
@media (max-width: 980px) { .bv-watch-wrap { grid-template-columns: 1fr; } }

.bv-player {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #000;
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
}
.bv-player video { width: 100%; height: 100%; display: block; background: #000; }

.bv-title { font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1.35; margin: 18px 0 6px; }
.bv-meta-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.bv-meta-left { color: var(--text-muted); font-size: 13px; }
.bv-meta-actions { display: flex; gap: 8px; }
.bv-icon-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.bv-icon-btn:hover { border-color: var(--border-strong); }

.bv-speaker-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.bv-speaker-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(150deg, var(--gold-light), var(--gold));
  display: flex; align-items: center; justify-content: center; color: #1a1305; font-weight: 800;
}
.bv-speaker-name { font-weight: 700; font-size: 14.5px; }
.bv-speaker-sub { color: var(--text-faint); font-size: 12px; }

.bv-desc-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; font-size: 13.5px; line-height: 1.7; color: var(--text-muted); white-space: pre-line; }

.bv-side-heading { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-faint); margin: 4px 0 12px; }
.bv-related { display: flex; flex-direction: column; gap: 12px; }
.bv-related-card { display: flex; gap: 10px; }
.bv-related-thumb { position: relative; width: 150px; flex-shrink: 0; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: var(--surface); }
.bv-related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bv-related-dur { position: absolute; right: 4px; bottom: 4px; background: rgba(13,23,21,0.85); font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
.bv-related-meta h4 { margin: 0 0 3px; font-size: 13px; line-height: 1.35; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bv-related-meta span { font-size: 11.5px; color: var(--text-faint); }

.bv-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text);
  padding: 11px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 60;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.bv-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Forms (report) ---------- */
.bv-form-wrap { max-width: 560px; margin: 30px auto; padding: 0 18px 60px; }
.bv-form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; }
.bv-form-card h1 { font-family: var(--font-display); font-weight: 500; font-size: 21px; margin: 0 0 6px; }
.bv-form-card p.bv-sub { color: var(--text-muted); font-size: 13.5px; margin: 0 0 20px; }
.bv-field { margin-bottom: 16px; }
.bv-field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.bv-field select, .bv-field input, .bv-field textarea {
  width: 100%; background: var(--ink-2); border: 1px solid var(--border-strong); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font-size: 13.5px; font-family: var(--font-ui); outline: none;
}
.bv-field textarea { resize: vertical; min-height: 90px; }
.bv-field select:focus, .bv-field input:focus, .bv-field textarea:focus { border-color: var(--gold-dim); }
.bv-success { text-align: center; padding: 20px 0; }
.bv-success i { font-size: 40px; color: var(--gold); margin-bottom: 12px; display: block; }

/* Keyboard focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
