/* ═══════════════════════════════════════════
   WATCHVAULT — Dark Cinematic UI
   Aesthetic: Film noir × modern streaming
═══════════════════════════════════════════ */

:root {
  --black: #080810;
  --dark: #0e0e1a;
  --card: #12121f;
  --border: rgba(255,255,255,0.07);
  --surface: #1a1a2e;
  --accent: #e63946;
  --accent2: #f4a261;
  --gold: #ffd166;
  --text: #f0f0f5;
  --muted: #6e6e85;
  --dim: #3a3a55;
  --green: #06d6a0;

  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;

  --r: 10px;
  --r-lg: 16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── SCROLLBAR ────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 99px; }

/* ─── TOP BAR ──────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 62px;
  background: rgba(8,8,16,0.85);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  user-select: none;
}
.logo-icon {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}
.logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--text);
}
.logo-text em {
  font-style: normal;
  color: var(--accent);
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-tab {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--text); background: var(--surface); }
.nav-tab.active { color: var(--text); background: var(--surface); font-weight: 600; }

/* Search */
.search-wrap {
  position: relative;
}
.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 14px 7px 32px;
  border-radius: 99px;
  outline: none;
  width: 180px;
  transition: width .3s, border-color .2s;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--accent); width: 220px; }
.search-icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 16px;
  pointer-events: none;
}

/* Balance Widget */
.balance-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 8px 5px 14px;
  cursor: default;
}
.balance-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.balance-amount {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--gold);
}
.balance-btn {
  background: var(--accent);
  border: none;
  color: white;
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, background .2s;
}
.balance-btn:hover { background: #ff4d5a; transform: scale(1.1); }

/* Avatar */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: white;
  flex-shrink: 0;
}

/* ─── HERO ──────────────────────────────── */
.hero {
  position: relative;
  height: 100vh;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(8,8,16,1) 0%,
    rgba(8,8,16,0.7) 40%,
    rgba(8,8,16,0.2) 70%,
    transparent 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 52px 72px;
  max-width: 680px;
}

.hero-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 88px);
  letter-spacing: 3px;
  line-height: 0.95;
  margin-bottom: 16px;
  color: white;
}

.hero-desc {
  font-size: 15px;
  line-height: 1.65;
  color: rgba(240,240,245,0.75);
  max-width: 480px;
  margin-bottom: 20px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 99px;
  color: var(--accent2);
}

.hero-duration, .hero-year {
  font-size: 13px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 12px;
}

.btn-play {
  background: var(--accent);
  color: white;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--r);
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all .2s;
}
.btn-play:hover { background: #ff4d5a; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(230,57,70,0.35); }

.btn-ghost {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: var(--r);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all .2s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.15); }

.hero-scroll-hint {
  position: absolute;
  bottom: 28px;
  right: 40px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ─── STATS BAR ──────────────────────────── */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--dark);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat-item {
  flex: 1;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  border-right: 1px solid var(--border);
  transition: background .2s;
}
.stat-item:last-child { border-right: none; }
.stat-item:hover { background: var(--surface); }
.stat-num {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--accent);
  line-height: 1;
}
.stat-lbl {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

/* ─── MAIN CONTENT ───────────────────────── */
.main-content {
  padding: 40px 40px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 28px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--text);
}
.section-count {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ─── GRID — horizontal scroll row ─────── */
.video-grid {
  display: flex;
  flex-direction: row;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
  cursor: grab;
}
.video-grid:active { cursor: grabbing; }
.video-grid::-webkit-scrollbar { height: 5px; }
.video-grid::-webkit-scrollbar-track { background: var(--dark); border-radius: 99px; }
.video-grid::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 99px; }

.video-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
}

/* ─── VIDEO CARD ────────────────────────── */
.video-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.video-card:hover {
  transform: translateY(-5px);
  border-color: rgba(230,57,70,0.35);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.video-card.watched { opacity: 0.75; }
.video-card.watched:hover { opacity: 1; }

.card-thumb-wrap {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--surface);
  overflow: hidden;
}
.card-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.video-card:hover .card-thumb { transform: scale(1.05); }

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8,8,16,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s;
}
.video-card:hover .card-overlay { opacity: 1; }

.play-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding-left: 3px;
  box-shadow: 0 0 30px rgba(230,57,70,0.5);
  transform: scale(0.85);
  transition: transform .2s;
}
.video-card:hover .play-circle { transform: scale(1); }

.watched-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--green);
  color: #080810;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  letter-spacing: 0.5px;
}
.pin-badge {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 18px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}
.card-duration {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.75);
  color: white;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 5px;
}

.card-body { padding: 14px 16px 12px; }

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.card-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 99px;
}
.card-cat.animation { background: rgba(244,162,97,0.15); color: var(--accent2); }
.card-cat.film { background: rgba(230,57,70,0.15); color: var(--accent); }
.card-cat.nature { background: rgba(6,214,160,0.15); color: var(--green); }

.card-year { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
  color: var(--text);
}
.card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 12px;
}

.card-footer {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.card-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 99px;
  cursor: pointer;
  transition: all .2s;
}
.card-btn:hover { border-color: var(--dim); color: var(--text); }
.card-btn.like.active { color: var(--accent); border-color: rgba(230,57,70,0.4); background: rgba(230,57,70,0.1); }
.card-btn.pin.active { color: var(--gold); border-color: rgba(255,209,102,0.4); background: rgba(255,209,102,0.08); }

/* ─── EMPTY STATE ─────────────────────────── */
.empty-state {
  flex: 1;
  text-align: center;
  padding: 80px 20px;
  min-width: 300px;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { color: var(--muted); font-size: 15px; }

/* ─── MODAL ─────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 780px;
  overflow: hidden;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform .3s;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 10;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.modal-close:hover { background: var(--accent); border-color: var(--accent); }

.modal-video {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
  background: black;
}

.modal-info { padding: 20px 24px 24px; }

.modal-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--text);
}

.modal-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--r);
  cursor: pointer;
  transition: all .2s;
}
.action-btn:hover { color: var(--text); border-color: var(--dim); }
.action-btn.like-btn.active { color: var(--accent); border-color: rgba(230,57,70,0.5); background: rgba(230,57,70,0.1); }
.action-btn.pin-btn.active { color: var(--gold); border-color: rgba(255,209,102,0.5); background: rgba(255,209,102,0.08); }
.action-icon { font-size: 16px; }

.modal-desc {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(240,240,245,0.7);
  margin-bottom: 16px;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.meta-tag {
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 99px;
  color: var(--accent2);
}
.meta-dur {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.meta-src {
  font-size: 11px;
  color: var(--dim);
  font-style: italic;
}

.pin-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(255,209,102,0.06);
  border: 1px solid rgba(255,209,102,0.2);
  border-radius: var(--r);
  font-size: 13px;
  color: var(--gold);
}

/* ─── BALANCE MODAL ───────────────────────── */
.balance-modal {
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  width: 100%;
  max-width: 340px;
  position: relative;
  transform: scale(0.95);
  transition: transform .3s;
}
.modal-overlay.open .balance-modal {
  transform: scale(1);
}
.bm-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 2px;
  margin-bottom: 16px;
  color: var(--text);
}
.bm-amount {
  font-family: var(--font-mono);
  font-size: 40px;
  color: var(--gold);
  margin-bottom: 22px;
  line-height: 1;
}
.bm-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}
.bm-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: var(--r);
  border: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.bm-btn.add { background: rgba(6,214,160,0.15); color: var(--green); border: 1px solid rgba(6,214,160,0.3); }
.bm-btn.add:hover { background: rgba(6,214,160,0.25); }
.bm-btn.sub { background: rgba(230,57,70,0.12); color: var(--accent); border: 1px solid rgba(230,57,70,0.3); }
.bm-btn.sub:hover { background: rgba(230,57,70,0.22); }
.bm-history {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bm-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 12px 0; }
.bm-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-family: var(--font-mono);
}
.bm-entry.credit { color: var(--green); }
.bm-entry.debit { color: var(--accent); }
.bm-time { color: var(--muted); font-size: 11px; }

/* ─── WITHDRAW PANEL ─────────────────────── */
.bm-withdraw-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--r);
  cursor: pointer;
  margin-bottom: 0;
  transition: color .2s, border-color .2s;
}
.bm-withdraw-toggle:hover { color: var(--text); border-color: var(--dim); }
.wd-arrow { transition: transform .25s; font-size: 12px; }

.bm-withdraw-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .3s ease;
  background: rgba(255,209,102,0.04);
  border-left: 2px solid rgba(255,209,102,0.25);
  border-radius: 0 0 var(--r) var(--r);
  padding: 0 14px;
  margin-bottom: 0;
}
.bm-withdraw-panel.open {
  max-height: 200px;
  padding: 14px 14px;
  margin-bottom: 12px;
}

.wd-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gold);
  margin-bottom: 12px;
}
.wd-notice-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}
.wd-notice strong { font-weight: 700; }

.wd-input-row {
  display: flex;
  align-items: center;
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0 12px;
  margin-bottom: 10px;
}
.wd-currency {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 14px;
  margin-right: 6px;
}
.wd-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 9px 0;
  width: 100%;
}
.wd-input::placeholder { color: var(--dim); }
.wd-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.wd-btn {
  width: 100%;
  background: rgba(255,209,102,0.12);
  border: 1px solid rgba(255,209,102,0.35);
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 9px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .2s;
  margin-bottom: 8px;
}
.wd-btn:hover { background: rgba(255,209,102,0.2); }

.wd-coming {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

/* ─── TOAST ──────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: 99px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: all .3s;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── RESPONSIVE ─────────────────────────── */
@media (max-width: 860px) {
  .nav-tabs { display: none; }
  .hero-content { padding: 0 24px 56px; }
  .main-content { padding: 24px 16px 60px; }
  .topbar { padding: 0 16px; gap: 12px; }
  .search-input { width: 130px; }
  .balance-label { display: none; }
}

@media (max-width: 540px) {
  .search-wrap { display: none; }
  .video-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 48px; }
}
