/* ── RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0A0A0F;
  --surface: #1A1A2E;
  --surface2: #16213E;
  --surface3: #0F1522;
  --violet: #7C3AED;
  --violet-light: #A78BFA;
  --violet-dark: #5B21B6;
  --pink: #EC4899;
  --text: #F1F0FF;
  --text-muted: #8B8BA7;
  --text-dim: #4A4A6A;
  --border: rgba(124,58,237,0.15);
  --border-hover: rgba(124,58,237,0.35);
  --grad: linear-gradient(135deg, #7C3AED, #EC4899);
  --sidebar-w: 240px;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
input, textarea { font: inherit; }
img { display: block; }

/* ── LAYOUT ────────────────────────────────────────────────── */
#sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 24px 0 16px;
  z-index: 200;
  overflow-y: auto;
}
#main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}
#bottom-nav { display: none; }

/* ── SIDEBAR CONTENTS ──────────────────────────────────────── */
.logo {
  display: block;
  padding: 0 20px 24px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.logo-glo { color: var(--text); }
.logo-geek { color: var(--violet-light); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px; font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
  position: relative;
}
.nav-item:hover { background: rgba(124,58,237,0.1); color: var(--text); }
.nav-item.active { background: rgba(124,58,237,0.15); color: var(--violet-light); }
.nav-icon { font-size: 20px; }
.nav-create {
  background: var(--grad);
  color: white !important;
  margin: 8px 0;
  font-weight: 700;
}
.nav-create:hover { opacity: 0.9; }

#sidebar-auth {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px;
  border-radius: 8px;
}
.sidebar-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
  overflow: hidden;
}
.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-credits { font-size: 11px; color: var(--violet-light); }
.sidebar-login-btn {
  width: 100%;
  padding: 10px;
  background: var(--grad);
  border-radius: 8px;
  font-weight: 700;
  text-align: center;
  color: white;
  cursor: pointer;
  transition: opacity 0.15s;
}
.sidebar-login-btn:hover { opacity: 0.85; }

/* ── BOTTOM NAV (mobile) ───────────────────────────────────── */
#bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: none;
  justify-content: space-around; align-items: center;
  height: 60px;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; font-size: 22px;
  color: var(--text-muted); position: relative;
  transition: color 0.15s;
}
.bnav-item.active { color: var(--violet-light); }
.bnav-create {
  background: var(--grad);
  border-radius: 50%;
  width: 44px; height: 44px;
  max-width: 44px; flex: 0 0 44px;
  font-size: 20px;
  color: white !important;
  margin: 0 8px;
}

/* ── BADGE ─────────────────────────────────────────────────── */
.badge {
  position: absolute; top: 8px; right: 8px;
  min-width: 18px; height: 18px;
  background: var(--pink);
  color: white; font-size: 10px; font-weight: 700;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.badge.hidden { display: none; }

/* ── PAGE WRAPPER ──────────────────────────────────────────── */
#page-container { min-height: 100vh; }
.page { padding: 20px; max-width: 680px; margin: 0 auto; }
.page-title {
  font-size: 20px; font-weight: 700; margin-bottom: 20px;
  color: var(--text);
}

/* ── FEED PAGE ─────────────────────────────────────────────── */
#feed-page {
  display: flex; flex-direction: column; align-items: center;
  padding: 0;
}
.feed-header {
  position: sticky; top: 0;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(12px);
  width: 100%; max-width: 560px;
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  z-index: 10;
  margin: 0 auto;
}
.feed-tab {
  flex: 1; padding: 14px 8px;
  text-align: center; font-size: 14px; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer; transition: all 0.15s;
}
.feed-tab.active { color: var(--text); border-bottom-color: var(--violet-light); }

.feed-list { width: 100%; max-width: 560px; }

/* ── VIDEO CARD ────────────────────────────────────────────── */
.video-card {
  display: flex; gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  width: 100%;
}
.video-card-left { flex: 1; min-width: 0; }
.video-card-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.card-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  overflow: hidden; cursor: pointer;
}
.card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.card-username { font-size: 13px; font-weight: 600; cursor: pointer; }
.card-username:hover { color: var(--violet-light); }
.card-follow-btn {
  margin-left: auto;
  padding: 4px 12px;
  border: 1px solid var(--violet);
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  color: var(--violet-light);
  cursor: pointer;
  transition: all 0.15s;
}
.card-follow-btn:hover, .card-follow-btn.following {
  background: var(--violet); color: white;
}

.video-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  max-height: 75vh;
}
.video-wrapper.portrait { aspect-ratio: 9/16; max-width: 320px; }
.video-wrapper.landscape { aspect-ratio: 16/9; width: 100%; }
.video-wrapper.square { aspect-ratio: 1; max-width: 400px; }
.video-wrapper.auto { max-height: 75vh; }
.video-wrapper video {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.video-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.2);
  font-size: 48px;
  opacity: 0; transition: opacity 0.2s;
}
.video-wrapper:hover .video-play-btn { opacity: 1; }
.video-wrapper.paused .video-play-btn { opacity: 1; }
.video-mute-btn {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,0.6); border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer;
  opacity: 0; transition: opacity 0.2s;
}
.video-wrapper:hover .video-mute-btn { opacity: 1; }

.card-title {
  margin-top: 10px; font-size: 14px; line-height: 1.4;
  color: var(--text);
}
.card-tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.card-tag { font-size: 12px; color: var(--violet-light); cursor: pointer; }
.card-tag:hover { text-decoration: underline; }
.card-stats { display: flex; gap: 4px; margin-top: 6px; color: var(--text-muted); font-size: 12px; }

/* Video action buttons (right column) */
.video-actions {
  display: flex; flex-direction: column; gap: 16px;
  padding-top: 44px; align-items: center;
}
.vid-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; transition: transform 0.15s;
}
.vid-btn:hover { transform: scale(1.1); }
.vid-btn-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  border: 1px solid var(--border);
}
.vid-btn.liked .vid-btn-icon { background: rgba(236,72,153,0.2); border-color: var(--pink); }
.vid-btn-count { font-size: 12px; color: var(--text-muted); }

/* ── EXPLORE PAGE ──────────────────────────────────────────── */
#explore-page { padding: 20px; }
.search-bar {
  display: flex; gap: 10px; margin-bottom: 20px;
}
.search-input {
  flex: 1; padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--violet); }
.search-btn {
  padding: 12px 20px;
  background: var(--violet); border-radius: 12px;
  color: white; font-weight: 700; font-size: 15px;
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.explore-card {
  position: relative; border-radius: 10px; overflow: hidden;
  aspect-ratio: 9/16; background: var(--surface);
  cursor: pointer; transition: transform 0.15s;
}
.explore-card:hover { transform: scale(1.02); }
.explore-card video, .explore-card img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.explore-card-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px 8px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
}
.explore-card-title { font-size: 12px; font-weight: 600; color: white; }
.explore-card-author { font-size: 11px; color: rgba(255,255,255,0.7); }
.explore-card-stats { font-size: 11px; color: rgba(255,255,255,0.6); margin-top: 2px; }

/* ── CREATE PAGE ───────────────────────────────────────────── */
#create-page { padding: 24px; max-width: 680px; margin: 0 auto; }
.create-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.create-title { font-size: 22px; font-weight: 800; }
.credits-chip {
  padding: 6px 12px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 20px;
  font-size: 13px; font-weight: 700;
  color: var(--violet-light);
}

/* Steps indicator */
.steps-bar {
  display: flex; gap: 0; margin-bottom: 32px;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.step-indicator {
  flex: 1; padding: 10px 4px;
  text-align: center; font-size: 12px; font-weight: 600;
  color: var(--text-dim);
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: all 0.2s;
}
.step-indicator:last-child { border-right: none; }
.step-indicator.active { background: rgba(124,58,237,0.2); color: var(--violet-light); }
.step-indicator.done { background: rgba(124,58,237,0.08); color: var(--text-muted); }
.step-indicator .step-num { font-size: 16px; display: block; margin-bottom: 2px; }

.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--violet-light);
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* Quality selector */
.quality-row { display: flex; gap: 10px; margin-bottom: 24px; }
.quality-card {
  flex: 1; padding: 14px 10px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px; cursor: pointer;
  text-align: center; transition: all 0.15s;
  position: relative;
}
.quality-card:hover { border-color: var(--violet); }
.quality-card.active { border-color: var(--violet); background: rgba(124,58,237,0.12); }
.quality-badge {
  position: absolute; top: -1px; right: -1px;
  padding: 2px 7px; font-size: 9px; font-weight: 800; letter-spacing: 0.5px;
  border-radius: 0 10px 0 8px;
  background: rgba(124,58,237,0.25); color: var(--violet-light);
}
.quality-badge.top { background: rgba(236,72,153,0.25); color: var(--pink); }
.quality-label { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.quality-res { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.quality-cost { font-size: 13px; font-weight: 700; color: var(--violet-light); }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  min-height: 180px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer;
  background: var(--surface);
  transition: all 0.15s;
  margin-bottom: 12px;
  overflow: hidden;
  position: relative;
}
.upload-zone:hover { border-color: var(--violet); background: rgba(124,58,237,0.05); }
.upload-zone .upload-icon { font-size: 36px; }
.upload-zone .upload-text { font-size: 15px; font-weight: 600; }
.upload-zone .upload-sub { font-size: 12px; color: var(--text-muted); }
.upload-zone .preview-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
}
.upload-btns { display: flex; gap: 10px; margin-bottom: 20px; }
.upload-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.upload-btn:hover { border-color: var(--violet); color: var(--violet-light); }
.upload-btn.danger { border-color: rgba(236,72,153,0.4); color: var(--pink); }

.prompt-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  color: var(--text);
  font-size: 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 20px;
  min-height: 80px;
}
.prompt-input:focus { border-color: var(--violet); }

/* Create CTA */
.cta-btn {
  width: 100%; padding: 16px;
  background: var(--grad);
  border-radius: 14px;
  color: white; font-size: 16px; font-weight: 800;
  text-align: center; cursor: pointer;
  transition: opacity 0.15s;
  border: none;
}
.cta-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cta-btn:not(:disabled):hover { opacity: 0.88; }

/* Step result cards */
.step-result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}
.step-result-card h3 {
  font-size: 16px; font-weight: 700;
  color: var(--violet-light);
  margin-bottom: 14px;
}
.char-field { margin-bottom: 10px; }
.char-field-label { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-bottom: 3px; }
.char-field-value { font-size: 14px; line-height: 1.5; }
.char-image { border-radius: 10px; max-width: 200px; margin: 0 auto 12px; }
.storyboard-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 12px 0;
}
.storyboard-item { border-radius: 8px; overflow: hidden; aspect-ratio: 9/16; background: var(--surface2); }
.storyboard-item img { width: 100%; height: 100%; object-fit: cover; }
.clips-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.clip-item { border-radius: 8px; overflow: hidden; background: var(--surface2); }
.clip-item video { width: 100%; display: block; }

/* Step action row */
.step-actions { display: flex; gap: 10px; margin-top: 12px; }
.step-btn {
  flex: 1; padding: 12px;
  border-radius: 10px;
  font-size: 14px; font-weight: 700;
  text-align: center; cursor: pointer;
  transition: all 0.15s;
}
.step-btn-primary { background: var(--violet); color: white; }
.step-btn-primary:hover { background: var(--violet-dark); }
.step-btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.step-btn-secondary:hover { border-color: var(--violet); color: var(--text); }

/* Final video */
.final-video-wrap {
  max-width: 360px; margin: 0 auto 20px;
  border-radius: 14px; overflow: hidden;
}
.final-video-wrap video { width: 100%; display: block; }
.publish-form-row { margin-bottom: 12px; }
.publish-form-row label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 6px;
}
.publish-input {
  width: 100%; padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text); font-size: 14px; outline: none;
  transition: border-color 0.15s;
}
.publish-input:focus { border-color: var(--violet); }

/* ── NOTIFICATIONS PAGE ────────────────────────────────────── */
#notifs-page { padding: 20px; max-width: 600px; margin: 0 auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.notif-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(124,58,237,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.notif-body { flex: 1; }
.notif-title { font-size: 14px; font-weight: 600; }
.notif-text { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.notif-item.unread .notif-title { color: var(--violet-light); }

/* ── PROFILE PAGE ──────────────────────────────────────────── */
#profile-page, #public-profile-page { padding: 0; max-width: 600px; margin: 0 auto; }
.profile-header {
  padding: 30px 20px 0;
  text-align: center;
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
  margin: 0 auto 12px;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-username { font-size: 20px; font-weight: 800; }
.profile-bio { font-size: 14px; color: var(--text-muted); margin-top: 6px; }
.profile-stats {
  display: flex; justify-content: center; gap: 32px;
  padding: 16px 0;
}
.profile-stat { text-align: center; }
.profile-stat-num { font-size: 20px; font-weight: 800; }
.profile-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.profile-credits-card {
  margin: 0 20px 16px;
  background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(236,72,153,0.1));
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 14px;
  padding: 16px 20px;
}
.credits-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.credits-value { font-size: 28px; font-weight: 900; color: var(--violet-light); margin: 4px 0; }
.topup-btn {
  display: inline-block; padding: 8px 16px;
  background: var(--grad); border-radius: 8px;
  color: white; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: opacity 0.15s;
}
.topup-btn:hover { opacity: 0.85; }

.profile-follow-btn {
  display: inline-block; padding: 10px 32px;
  border: 2px solid var(--violet);
  border-radius: 10px;
  font-weight: 700; font-size: 14px;
  color: var(--violet-light);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 16px;
}
.profile-follow-btn.following {
  background: var(--violet); color: white;
}

.profile-videos-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 2px; padding: 2px;
}
.profile-video-thumb {
  position: relative; aspect-ratio: 9/16;
  overflow: hidden; background: var(--surface);
  cursor: pointer;
}
.profile-video-thumb video, .profile-video-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.profile-video-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 12px 6px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  font-size: 11px; font-weight: 600; color: white;
}

/* ── MODALS ────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
}
.modal-box {
  position: relative; z-index: 1;
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  width: 90%; max-width: 420px;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.25s ease;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-muted);
  transition: all 0.15s;
}
.modal-close:hover { background: var(--border); color: var(--text); }

/* Auth modal */
.auth-box { padding: 32px 28px; }
.auth-title {
  font-size: 22px; font-weight: 800;
  text-align: center; margin-bottom: 8px;
}
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.auth-input {
  width: 100%; padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text); font-size: 14px;
  outline: none; margin-bottom: 12px;
  transition: border-color 0.15s;
}
.auth-input:focus { border-color: var(--violet); }
.auth-submit {
  width: 100%; padding: 14px;
  background: var(--grad);
  border-radius: 12px;
  color: white; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: opacity 0.15s;
  margin-bottom: 16px;
}
.auth-submit:hover { opacity: 0.88; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-dim); font-size: 12px;
  margin-bottom: 14px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-google {
  width: 100%; padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  margin-bottom: 16px;
}
.auth-google:hover { border-color: var(--violet); }
.auth-switch {
  text-align: center; font-size: 13px; color: var(--text-muted);
}
.auth-switch a { color: var(--violet-light); font-weight: 600; cursor: pointer; }

/* Comments bottom modal */
.modal-bottom {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 100%; width: 100%;
  border-radius: 20px 20px 0 0;
  border-bottom: none;
  max-height: 75vh;
  display: flex; flex-direction: column;
  animation: slideFromBottom 0.25s ease;
}
@keyframes slideFromBottom { from { transform: translateY(100%); } }
.modal-handle {
  width: 40px; height: 4px; background: var(--border);
  border-radius: 2px; margin: 10px auto 0;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-close-inline {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-muted);
}

.comments-list { flex: 1; overflow-y: auto; padding: 12px 20px; }
.comment-item {
  display: flex; gap: 10px; margin-bottom: 16px;
}
.comment-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-body { flex: 1; }
.comment-username { font-size: 13px; font-weight: 700; }
.comment-text { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.comment-time { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.comment-delete {
  font-size: 11px; color: var(--pink); cursor: pointer;
  margin-top: 3px;
}
.comment-form {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}
.comment-form.hidden { display: none; }
#comment-avatar.comment-avatar { margin: 0; }
#comment-input {
  flex: 1; padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text); font-size: 13px; outline: none;
}
#comment-input:focus { border-color: var(--violet); }
#comment-submit {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--violet); color: white; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── TOPUP PACKAGES MODAL ──────────────────────────────────── */
#topup-modal .modal-box { padding: 28px 24px; }
.topup-title { font-size: 20px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.topup-subtitle { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 20px; }
.package-list { display: flex; flex-direction: column; gap: 10px; }
.package-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer; transition: all 0.15s;
}
.package-item:hover { border-color: var(--violet); }
.package-item.popular { border-color: rgba(124,58,237,0.5); }
.package-credits { font-size: 16px; font-weight: 800; }
.package-price { font-size: 15px; color: var(--violet-light); font-weight: 700; }
.package-badge {
  font-size: 10px; font-weight: 800;
  background: var(--grad); color: white;
  padding: 2px 7px; border-radius: 6px;
}

/* ── MISC COMPONENTS ───────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 32px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } }

.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 16px; }
.empty-sub { font-size: 13px; margin-top: 6px; color: var(--text-dim); }

.load-more-btn {
  display: block; width: 100%;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-weight: 700; color: var(--text-muted);
  text-align: center; cursor: pointer;
  margin: 16px 0;
  transition: all 0.15s;
}
.load-more-btn:hover { border-color: var(--violet); color: var(--text); }

.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px; font-weight: 600;
  z-index: 900;
  animation: toastIn 0.25s ease, toastOut 0.25s ease 2s forwards;
  white-space: nowrap;
}
@keyframes toastIn { from { opacity:0; transform: translateX(-50%) translateY(10px); } }
@keyframes toastOut { to { opacity:0; } }

.tag-input-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar { display: none; }
  #main { margin-left: 0; padding-bottom: 70px; }
  #bottom-nav { display: flex; }

  .feed-header { max-width: 100%; }
  .feed-list { max-width: 100%; }
  .video-card { padding: 16px 12px; }
  .video-wrapper.portrait { max-width: 100%; }

  .explore-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  #create-page { padding: 16px; }
  .quality-row { gap: 8px; }

  #notifs-page { padding: 16px; }
  .profile-videos-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1200px) {
  .feed-list { max-width: 540px; }
  .explore-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
