/* ============================================
   TUBERADAR — NEON CYBER DESIGN SYSTEM
   ============================================ */

/* ===== FONTS & ROOT ===== */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* === COLOR PALETTE === */
  --bg-base:       #050810;
  --bg-surface:    #080d1a;
  --bg-card:       #0a1020;
  --bg-card-hover: #0d1428;
  --bg-elevated:   #111827;
  --bg-input:      #0c1525;

  /* Neon Accent Colors */
  --cyan:          #00e5ff;
  --cyan-dim:      rgba(0,229,255,0.08);
  --cyan-border:   rgba(0,229,255,0.25);
  --cyan-glow:     rgba(0,229,255,0.15);
  --purple:        #a855f7;
  --purple-dim:    rgba(168,85,247,0.08);
  --purple-border: rgba(168,85,247,0.25);
  --pink:          #ec4899;
  --green:         #10b981;
  --green-dim:     rgba(16,185,129,0.1);
  --orange:        #f59e0b;
  --red:           #ef4444;
  --blue:          #3b82f6;
  --gold:          #fbbf24;
  --gold-dim:      rgba(251,191,36,0.1);
  --gold-border:   rgba(251,191,36,0.25);

  /* Text Colors */
  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;
  --text-cyan:      #00e5ff;

  /* Borders */
  --border:        rgba(0,229,255,0.08);
  --border-strong: rgba(0,229,255,0.18);

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 30px rgba(0,229,255,0.06);
  --shadow-glow-strong: 0 0 60px rgba(0,229,255,0.12);
  --glow-cyan: 0 0 20px rgba(0,229,255,0.5);
  --glow-purple: 0 0 20px rgba(168,85,247,0.5);
}

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

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 14px;
}

/* ===== MATRIX BACKGROUND ===== */
#matrix-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.03;
  pointer-events: none;
}

.particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--cyan);
  border-radius: 50%;
  animation: floatParticle linear infinite;
  opacity: 0;
}

@keyframes floatParticle {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.2; }
  100% { transform: translateY(-20vh) scale(1.5); opacity: 0; }
}

/* ===== APP LAYOUT ===== */
#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ===== TOP NAVBAR ===== */
#topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0;
  height: 56px;
  padding: 0 16px;
  background: rgba(5,8,16,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 4px 30px rgba(0,0,0,0.5), 0 1px 0 rgba(0,229,255,0.08);
  flex-shrink: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 20px;
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #000;
  box-shadow: var(--glow-cyan);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1;
}

.brand-tag {
  font-size: 9px;
  color: var(--cyan);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0.7;
}

/* ===== NAV MENU ===== */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 8px;
}
.nav-menu::-webkit-scrollbar { display: none; }

.nav-group-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 0 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  font-weight: 500;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
}

.nav-btn i { font-size: 12px; }

.nav-btn:hover {
  color: var(--cyan);
  background: rgba(0,229,255,0.07);
  border-color: rgba(0,229,255,0.12);
}

.nav-btn.active {
  color: var(--cyan);
  background: rgba(0,229,255,0.1);
  border: 1px solid rgba(0,229,255,0.22);
  font-weight: 600;
}

.nav-btn.active:hover {
  color: var(--purple);
  background: rgba(168,85,247,0.1);
  border-color: rgba(168,85,247,0.25);
}

.nav-btn.active:hover::before {
  background: var(--purple);
  box-shadow: var(--glow-purple);
}

.nav-btn.active::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px 2px 0 0;
  box-shadow: var(--glow-cyan);
  transition: all 0.2s ease;
}

/* Live dot */
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: livePulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

/* ===== NAV ACTIONS ===== */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-gray { background: rgba(71,85,105,0.2); color: var(--text-muted); border: 1px solid rgba(71,85,105,0.3); }
.status-green { background: var(--green-dim); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.status-red { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0,229,255,0.04);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.icon-btn:hover {
  color: var(--cyan);
  border-color: var(--cyan-border);
  background: var(--cyan-dim);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-trigger { display: none; }

/* ===== MAIN CONTENT ===== */
#main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

#main-content::-webkit-scrollbar { width: 4px; }
#main-content::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-title-wrap h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-title-wrap p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.page-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* ===== CARDS ===== */
.card {
  background: rgba(10,16,32,0.8);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--border-strong);
}

.card-glow {
  border-color: var(--cyan-border);
  box-shadow: 0 0 30px rgba(0,229,255,0.08);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i { color: var(--cyan); font-size: 13px; }

/* Corner accent */
.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40px; height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  border-radius: 14px 0 0 0;
}

.card-gold::after { background: linear-gradient(90deg, var(--gold), transparent); }
.card-purple::after { background: linear-gradient(90deg, var(--purple), transparent); }

/* ===== STAT CARDS ===== */
.stat-card {
  background: rgba(10,16,32,0.85);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* Glow orb top-right */
.stat-card::before {
  content: '';
  position: absolute;
  top: -10px; right: -10px;
  width: 90px; height: 90px;
  border-radius: 50%;
  opacity: 0.07;
  background: var(--stat-glow, var(--cyan));
  transition: opacity 0.3s;
}
.stat-card:hover::before { opacity: 0.14; }

/* Bottom accent line */
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--stat-glow, var(--cyan)), transparent);
  border-radius: 0 0 16px 16px;
  opacity: 0;
  transition: opacity 0.3s;
}
.stat-card:hover::after { opacity: 1; }

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.stat-icon.cyan   { background: rgba(0,229,255,0.13);   color: #00e5ff; box-shadow: 0 0 20px rgba(0,229,255,0.15); }
.stat-icon.green  { background: rgba(16,185,129,0.13);  color: #34d399; box-shadow: 0 0 20px rgba(52,211,153,0.15); }
.stat-icon.purple { background: rgba(168,85,247,0.13);  color: #c084fc; box-shadow: 0 0 20px rgba(192,132,252,0.15); }
.stat-icon.orange { background: rgba(245,158,11,0.13);  color: #fbbf24; box-shadow: 0 0 20px rgba(251,191,36,0.15); }
.stat-icon.red    { background: rgba(239,68,68,0.13);   color: #f87171; box-shadow: 0 0 20px rgba(248,113,113,0.15); }
.stat-icon.blue   { background: rgba(99,102,241,0.13);  color: #818cf8; box-shadow: 0 0 20px rgba(129,140,248,0.15); }
.stat-icon.gold   { background: rgba(251,191,36,0.13);  color: #fbbf24; box-shadow: 0 0 20px rgba(251,191,36,0.15); }

/* Stat glow variable per color */
.stat-card:has(.cyan)   { --stat-glow: #00e5ff; }
.stat-card:has(.green)  { --stat-glow: #34d399; }
.stat-card:has(.purple) { --stat-glow: #c084fc; }
.stat-card:has(.orange) { --stat-glow: #fbbf24; }
.stat-card:has(.red)    { --stat-glow: #f87171; }
.stat-card:has(.blue)   { --stat-glow: #818cf8; }
.stat-card:has(.gold)   { --stat-glow: #fbbf24; }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 10.5px;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 600;
}

/* ===== GRIDS ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), rgba(0,180,200,0.8));
  color: #000;
  border-color: transparent;
  box-shadow: 0 0 20px rgba(0,229,255,0.3);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 30px rgba(0,229,255,0.5);
  transform: translateY(-1px);
}

.btn-cyan {
  background: rgba(0,229,255,0.12);
  color: var(--cyan);
  border-color: var(--cyan-border);
}
.btn-cyan:hover:not(:disabled) {
  background: rgba(0,229,255,0.2);
  box-shadow: 0 0 16px rgba(0,229,255,0.2);
}

.btn-purple {
  background: rgba(168,85,247,0.12);
  color: var(--purple);
  border-color: var(--purple-border);
}
.btn-purple:hover:not(:disabled) {
  background: rgba(168,85,247,0.2);
}

.btn-gold {
  background: rgba(251,191,36,0.12);
  color: var(--gold);
  border-color: var(--gold-border);
}
.btn-gold:hover:not(:disabled) {
  background: rgba(251,191,36,0.2);
  box-shadow: 0 0 16px rgba(251,191,36,0.2);
}

.btn-danger {
  background: rgba(239,68,68,0.12);
  color: var(--red);
  border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,0.2); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.03);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 7px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
}

.btn-red { background: rgba(239,68,68,0.12); color: var(--red); border-color: rgba(239,68,68,0.3); }
.btn-red:hover:not(:disabled) { background: rgba(239,68,68,0.2); }

.ghost-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 5px;
  transition: color 0.2s;
}
.ghost-btn:hover { color: var(--text-primary); }

/* ===== INPUTS ===== */
.input, .select, textarea.input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
  padding: 9px 14px;
  outline: none;
  transition: all 0.2s ease;
}

.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--cyan-border);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.06), 0 0 16px rgba(0,229,255,0.06);
  background: rgba(0,229,255,0.03);
}

.input::placeholder { color: var(--text-muted); }

.select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2300e5ff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.select option { background: var(--bg-card); color: var(--text-primary); }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.search-input-wrap .input {
  padding-left: 36px;
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group .input { flex: 1; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
  background: rgba(10,16,32,0.8);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.filter-group.grow { flex: 1; min-width: 200px; }

/* ===== VIDEO GRID ===== */
.video-grid { display: grid; gap: 14px; }
.video-grid-4 { grid-template-columns: repeat(4, 1fr); }
.video-grid-3 { grid-template-columns: repeat(3, 1fr); }

.video-card {
  background: rgba(10,16,32,0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.video-card:hover {
  border-color: var(--cyan-border);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 20px rgba(0,229,255,0.06);
  transform: translateY(-3px);
}

.video-card.selected {
  border-color: var(--cyan-border);
  box-shadow: 0 0 0 2px rgba(0,229,255,0.3), 0 0 30px rgba(0,229,255,0.1);
}

.video-thumb-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-elevated);
}

.video-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.video-card:hover .video-thumb-wrap img { transform: scale(1.05); }

.video-duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.video-viral-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #ff6b00, #ff0080);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.video-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-card:hover .video-play-overlay { opacity: 1; }

.video-play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
  box-shadow: 0 0 30px rgba(0,229,255,0.6);
  transform: scale(0.8);
  transition: transform 0.2s;
}

.video-card:hover .video-play-btn { transform: scale(1); }
.video-play-btn i { color: #000; font-size: 18px; }

.video-select-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 10px;
  color: transparent;
}

.video-card.selected .video-select-check {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #000;
}

.video-info {
  padding: 12px 12px 8px;
}

/* ── Title ── */
.video-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 7px;
  letter-spacing: -0.1px;
}

/* ── Channel row ── */
.video-channel {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
}

.video-channel img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.vc-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.vc-subs {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Stat pills ── */
.vstat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.vstat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.vstat i { font-size: 8px; }

/* Colors per stat type */
.vstat-views  { background: rgba(99,102,241,0.15); color: #818cf8; }
.vstat-vph    { background: rgba(0,229,255,0.12);  color: #00e5ff; }
.vstat-likes  { background: rgba(16,185,129,0.12); color: #34d399; }
.vstat-ratio  { background: rgba(236,72,153,0.12); color: #f472b6; }
.vstat-dur    { background: rgba(255,255,255,0.06); color: #94a3b8; }
.vstat-time   { background: rgba(255,255,255,0.06); color: #94a3b8; }
.vstat-cmt    { background: rgba(245,158,11,0.12);  color: #fbbf24; }

/* ── Viral score bar ── */
.vs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.vs-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.vs-bar-wrap {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 6px;
  overflow: hidden;
}

.vs-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 6px currentColor;
}

.vs-num {
  font-size: 11px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
  min-width: 22px;
  text-align: right;
}

/* Keep old classes for compatibility */
.video-stats  { display: flex; flex-wrap: wrap; gap: 8px; }
.video-stat   { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.video-stat i { font-size: 9px; }
.vph-highlight { color: var(--cyan); font-weight: 600; }
.viral-bar { width:100%; height:3px; background:rgba(255,255,255,0.06); border-radius:2px; overflow:hidden; margin-top:6px; }
.viral-bar-fill { height:100%; border-radius:2px; transition:width 0.5s ease; }
.viral-bar-fill.viral-max  { background: linear-gradient(90deg, var(--cyan), var(--purple)); }
.viral-bar-fill.viral-high { background: linear-gradient(90deg, var(--orange), #ff6b00); }
.viral-bar-fill.viral-mid  { background: var(--blue); }
.viral-bar-fill.viral-low  { background: var(--text-muted); }

/* ===== VIDEO CARD ACTIONS ===== */
.video-card-actions {
  display: flex;
  gap: 1px;
  padding: 6px 8px 8px;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 6px;
  background: rgba(0,0,0,0.15);
}

.vca-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 10.5px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.18s ease;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.1px;
}

.vca-btn i { font-size: 10px; }

.vca-btn:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.9);
}

.vca-analisis {
  color: rgba(0,229,255,0.6);
}
.vca-analisis:hover {
  color: var(--cyan);
  background: rgba(0,229,255,0.1);
  border-color: rgba(0,229,255,0.15);
}

.vca-transkrip {
  color: rgba(168,85,247,0.6);
}
.vca-transkrip:hover {
  color: var(--purple);
  background: rgba(168,85,247,0.1);
  border-color: rgba(168,85,247,0.15);
}

.vca-simpan {
  color: rgba(251,191,36,0.5);
}
.vca-simpan:hover {
  color: var(--gold);
  background: rgba(251,191,36,0.1);
  border-color: rgba(251,191,36,0.15);
}
.vca-simpan.saved {
  color: var(--gold);
  background: rgba(251,191,36,0.12);
  border-color: rgba(251,191,36,0.2);
}

/* ===== VIDEO SAVE BTN (live & bank) ===== */
.video-save-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.6);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.video-save-btn:hover { color: var(--gold); border-color: var(--gold-border); background: rgba(251,191,36,0.15); }
.video-save-btn.saved { color: var(--gold); border-color: var(--gold-border); background: var(--gold-dim); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-gray { background: rgba(71,85,105,0.2); color: var(--text-muted); border: 1px solid rgba(71,85,105,0.2); }
.badge-green { background: var(--green-dim); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.badge-red { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.badge-gold { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-border); }
.badge-cyan { background: var(--cyan-dim); color: var(--cyan); border: 1px solid var(--cyan-border); }
.badge-purple { background: var(--purple-dim); color: var(--purple); border: 1px solid var(--purple-border); }

/* ===== TABS ===== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  gap: 4px;
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== LOADING ===== */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(0,229,255,0.1);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
}

.empty-state i {
  font-size: 40px;
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.6;
}

/* ===== TOASTS ===== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(10,16,32,0.95);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  min-width: 280px;
  max-width: 380px;
  font-size: 13px;
  color: var(--text-primary);
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease forwards;
  animation-delay: 0s, 3.2s;
  pointer-events: all;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.toast.success { border-color: rgba(16,185,129,0.3); }
.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.warning { border-color: rgba(245,158,11,0.3); }
.toast.info { border-color: var(--cyan-border); }

@keyframes slideInRight {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateX(10px); }
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 60px rgba(0,229,255,0.04);
  animation: modalIn 0.3s ease;
  overflow: hidden;
}

@keyframes modalIn {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-lg { max-width: 760px; }
.modal-xl { max-width: 1000px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close:hover { color: var(--red); border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.1); }

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* YouTube player */
.yt-player-wrap iframe {
  width: 100%;
  height: 450px;
  display: block;
  border: none;
}

/* ===== NOTIFICATION PANEL ===== */
.notif-panel {
  position: fixed;
  top: 60px;
  right: 16px;
  width: 340px;
  max-height: 500px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.25s ease;
}

.notif-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.notif-item:hover { background: rgba(0,229,255,0.03); }
.notif-item.unread { border-left: 3px solid var(--cyan); }
.notif-item-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.notif-item-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ===== COMPARE BAR ===== */
.compare-bar {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  transition: bottom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.compare-bar.visible { bottom: 24px; }

.compare-bar-content {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10,16,32,0.95);
  border: 1px solid var(--cyan-border);
  border-radius: 14px;
  padding: 10px 16px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 30px rgba(0,229,255,0.1);
}

/* ===== ANALYTICS MODAL SPECIFIC ===== */
.perf-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.perf-metric-val {
  font-size: 24px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1;
  margin-bottom: 6px;
}

.perf-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.earnings-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.earnings-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.earnings-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Space Grotesk', sans-serif;
}

/* Transcript box */
.transcript-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  max-height: 360px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.7;
  scrollbar-width: thin;
}

.transcript-line { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.03); }
.transcript-time { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--cyan); margin-right: 10px; flex-shrink: 0; }

/* ===== SEARCHABLE SELECT DROPDOWN ===== */
.ss-wrap {
  position: relative;
  cursor: pointer;
}

.ss-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 36px 9px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 130px;
}

.ss-wrap.open .ss-display,
.ss-display:hover {
  border-color: var(--cyan-border);
  background: rgba(0,229,255,0.03);
}

.ss-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cyan);
  font-size: 10px;
  pointer-events: none;
  transition: transform 0.2s;
}

.ss-wrap.open .ss-arrow { transform: translateY(-50%) rotate(180deg); }

.ss-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  z-index: 500;
  display: none;
  overflow: hidden;
  box-shadow: 0 16px 50px rgba(0,0,0,0.6);
}

.ss-wrap.open .ss-dropdown { display: flex; flex-direction: column; }

.ss-search-wrap { padding: 10px; border-bottom: 1px solid var(--border); }
.ss-search {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: 'Space Grotesk', sans-serif;
  padding: 7px 10px;
  outline: none;
}
.ss-search:focus { border-color: var(--cyan-border); }

.ss-list { max-height: 220px; overflow-y: auto; scrollbar-width: thin; }
.ss-option {
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  white-space: nowrap;
}
.ss-option:hover { background: rgba(0,229,255,0.06); color: var(--text-primary); }
.ss-option.selected { color: var(--cyan); background: var(--cyan-dim); }
.ss-option.hidden { display: none; }
.ss-empty { padding: 12px 14px; font-size: 12px; color: var(--text-muted); text-align: center; }

/* ===== OPPORTUNITY METER ===== */
.opportunity-meter {
  height: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
}

.opportunity-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--red), var(--orange), var(--green));
  transition: width 0.8s ease;
}

/* ===== ANALYTICS TAB CONTENT ===== */
.analytics-tab-content { padding-top: 16px; }

/* ===== GLOWING TEXT ===== */
.text-cyan { color: var(--cyan); }
.text-gold { color: var(--gold); }
.text-purple { color: var(--purple); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }

/* ===== UTIL ===== */
.w-full { width: 100%; }
.text-center { text-align: center; }

/* ===== MOBILE SIDEBAR ===== */
.mobile-sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100vh;
  background: rgba(8,13,26,0.98);
  border-right: 1px solid var(--border-strong);
  box-shadow: 4px 0 40px rgba(0,0,0,0.6);
  z-index: 500;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
  backdrop-filter: blur(20px);
}
.mobile-sidebar::-webkit-scrollbar { display: none; }

.mobile-sidebar.open { left: 0; }

.mobile-sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: rgba(8,13,26,0.98);
  backdrop-filter: blur(20px);
  z-index: 1;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 400;
  backdrop-filter: blur(3px);
  display: none;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.mobile-overlay.active { display: block; }

.mobile-nav {
  padding: 10px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mobile-nav-group {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 12px 4px 4px;
}

.mobile-nav .nav-btn {
  width: 100%;
  justify-content: flex-start;
  padding: 11px 14px;
  font-size: 13px;
  border-radius: 10px;
  gap: 10px;
  color: rgba(255,255,255,0.8);
  border: 1px solid transparent;
}

/* Force span text always visible in sidebar — never hidden */
.mobile-nav .nav-btn span {
  display: inline !important;
  color: inherit;
  font-size: 13px;
  font-weight: 500;
}

.mobile-nav .nav-btn i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.mobile-nav .nav-btn:hover {
  color: var(--cyan);
  background: rgba(0,229,255,0.07);
  border-color: rgba(0,229,255,0.12);
}

.mobile-nav .nav-btn.active {
  color: var(--cyan);
  background: rgba(0,229,255,0.1);
  border-color: rgba(0,229,255,0.22);
  font-weight: 600;
}


/* ===== ANIMATIONS ===== */
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Live badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* ============================================================
   RESPONSIVE — TUBERADAR
   Breakpoints: 1200 | 900 | 640 | 480 | 360
   ============================================================ */

/* ── 1200px — Large Tablet ── */
@media (max-width: 1200px) {
  .video-grid-4          { grid-template-columns: repeat(3, 1fr); }
  .grid-4                { grid-template-columns: repeat(2, 1fr); }
}

/* ── 900px — Tablet ── */
@media (max-width: 900px) {
  /* Topnav only: icon-only mode (sidebar not affected) */
  #nav-menu .nav-btn span { display: none; }
  #nav-menu .nav-btn      { padding: 6px 10px; gap: 0; }
  .nav-menu               { gap: 1px; }
  .brand-tag              { display: none; }

  /* Grids */
  .video-grid-4          { grid-template-columns: repeat(2, 1fr); }
  .video-grid-3          { grid-template-columns: repeat(2, 1fr); }
  .grid-4                { grid-template-columns: repeat(2, 1fr); }
  .grid-3                { grid-template-columns: repeat(2, 1fr); }

  /* Modal */
  .modal                 { width: 96vw; max-height: 90vh; }

  /* Settings tabs wrap */
  .settings-tabs         { width: 100%; }
  .settings-tab          { flex: 1; justify-content: center; font-size: 12px; padding: 7px 10px; }
}

/* ── 640px — Mobile ── */
@media (max-width: 640px) {
  /* Navbar */
  #topnav                { padding: 0 12px; height: 52px; }
  .nav-menu              { display: none; }
  .mobile-menu-trigger   { display: flex !important; }
  .brand-name            { font-size: 14px; }

  /* Main content */
  #main-content          { padding: 14px 12px; }

  /* Page header */
  .page-header           { flex-direction: column; gap: 10px; margin-bottom: 16px; }
  .page-title-wrap h1    { font-size: 18px; }
  .page-header-actions   { width: 100%; }

  /* Cards */
  .card                  { padding: 14px; border-radius: 12px; }

  /* Grids */
  .video-grid-4, .video-grid-3 { grid-template-columns: 1fr; gap: 10px; }
  .grid-4, .grid-3       { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-2                { grid-template-columns: 1fr; }

  /* Filter bar */
  .filter-bar            { padding: 12px; gap: 8px; }
  .filter-group          { min-width: calc(50% - 4px); }
  .filter-group.grow     { min-width: 100%; }

  /* Buttons */
  .btn                   { padding: 8px 14px; font-size: 12px; }

  /* Input group — stack on small */
  .input-group           { flex-direction: column; }
  .input-group .btn      { width: 100%; justify-content: center; }

  /* Stat cards */
  .stat-card             { padding: 14px; }
  .stat-value            { font-size: 22px; }

  /* Modal */
  .modal                 { width: 100vw; min-height: 50vh; max-height: 92vh; border-radius: 16px 16px 0 0; margin-top: auto; }
  .modal-overlay         { align-items: flex-end; }
  .modal-xl              { width: 100vw; }
  .modal-lg              { width: 100vw; }
  .modal-body            { padding: 14px; }

  /* Video card */
  .video-card            { border-radius: 10px; }
  .vca-btn span          { display: none; }

  /* Compare bar */
  .compare-bar-content   { flex-wrap: wrap; gap: 6px; font-size: 12px; }
  .compare-bar-content .btn { padding: 5px 10px; font-size: 11px; }

  /* Settings tabs */
  .settings-tabs         { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .settings-tab          { flex-shrink: 0; font-size: 11px; padding: 7px 12px; }

  /* Notification panel */
  .notif-panel           { width: 100vw; right: 0; border-radius: 0 0 16px 16px; }

  /* Nav actions — hide status badge label on mobile */
  .status-badge span:last-child { display: none; }
  .status-badge          { padding: 4px 7px; }
}

/* ── 480px — Small Mobile ── */
@media (max-width: 480px) {
  /* Grids stay 1-col for video */
  .video-grid-4, .video-grid-3 { grid-template-columns: 1fr; gap: 8px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }

  /* Page padding tighter */
  #main-content          { padding: 12px 10px; }

  /* Card padding */
  .card                  { padding: 12px; }

  /* Filter: all full width */
  .filter-group          { min-width: 100%; }

  /* Video card info */
  .video-title           { font-size: 11px; -webkit-line-clamp: 2; }
  .video-stats           { gap: 5px; flex-wrap: wrap; }
  .video-stat            { font-size: 9px; }

  /* Stat card */
  .stat-card             { flex-direction: column; text-align: center; gap: 8px; }
  .stat-card::before     { display: none; }
  .stat-value            { font-size: 26px; }

  /* Modal fullscreen */
  .modal                 { border-radius: 14px 14px 0 0; }

  /* Btn full width in stacked context */
  .page-header-actions .btn { width: 100%; justify-content: center; }
}

/* ── 360px — Very Small Phone ── */
@media (max-width: 360px) {
  .video-grid-4, .video-grid-3 { grid-template-columns: 1fr; }
  #main-content          { padding: 10px 8px; }
  .page-title-wrap h1    { font-size: 16px; }
  .btn                   { padding: 7px 12px; font-size: 11px; }
  .card                  { padding: 10px; }
}

/* ── Mobile sidebar ── */
.mobile-menu-trigger     { display: none; }

@media (max-width: 640px) {
  .mobile-menu-trigger   { display: flex; }
}


/* ===== SETTINGS TABS ===== */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 5px;
  background: rgba(10,16,32,0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
}

.settings-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.settings-tab i { font-size: 12px; }

.settings-tab:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.05);
}

.settings-tab.active {
  color: #00e5ff;
  background: rgba(0,229,255,0.1);
  border-color: rgba(0,229,255,0.2);
  font-weight: 700;
  box-shadow: 0 0 20px rgba(0,229,255,0.08);
}

/* Active tab bottom accent */
.settings-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00e5ff, transparent);
  border-radius: 2px;
}

/* Responsive: on small screens make tabs scrollable not squished */
@media (max-width: 600px) {
  .settings-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .settings-tab  { flex-shrink: 0; flex: unset; font-size: 11px; padding: 8px 12px; }
}


/* ============================================================
   MOBILE UTILITIES & PAGE-SPECIFIC RESPONSIVE
   ============================================================ */

/* ── Responsive Table Wrapper ── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
}
.table-scroll table { min-width: 540px; }

/* ── Touch-friendly tap areas ── */
@media (hover: none) and (pointer: coarse) {
  .nav-btn        { min-height: 44px; }
  .btn            { min-height: 44px; }
  .icon-btn       { width: 40px; height: 40px; }
  .video-card:hover { transform: none; }
  .stat-card:hover  { transform: none; }
}

/* ── Bottom-sheet modal handle ── */
@media (max-width: 640px) {
  .modal::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    margin: 10px auto -6px;
    flex-shrink: 0;
  }

  /* Make modal header sticky on mobile */
  .modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    border-radius: 0;
  }

  /* Full-width buttons in modal footer */
  .modal-footer {
    flex-wrap: wrap;
    gap: 8px;
  }
  .modal-footer .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  /* Bulk analysis: stack input row */
  #bulk-input-row {
    flex-direction: column;
  }

  /* Niche: stack search row */
  #niche-search-row {
    flex-direction: column;
  }

  /* Compare: horizontal scroll channel grid */
  #compare-channel-grid {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  #compare-channel-grid > * {
    min-width: 200px;
    flex-shrink: 0;
  }

  /* Settings: API key table responsive */
  #keys-list table,
  #or-keys-list table {
    min-width: 480px;
  }
  #keys-list,
  #or-keys-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Settings: 2-col layout → 1-col on tablet */
  #settings-tab-content > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Data tab: reduce grid to 2-col */
  #settings-tab-content .grid-3 { grid-template-columns: repeat(2, 1fr); }


  /* Search filter bar: 2-col on mobile */
  .filter-bar .filter-group:first-child { min-width: 100%; }

  /* AI Tools: stack buttons */
  #ai-tools-actions {
    flex-direction: column;
  }
  #ai-tools-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Compare bar: show compact */
  .compare-bar {
    bottom: 0;
    border-radius: 16px 16px 0 0;
    padding: 12px 16px;
  }

  /* Notif panel */
  .notif-panel {
    top: 52px;
  }

  /* Page header actions: stack buttons */
  .page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Video analytics modal: stack header */
  #modal-analytics-body [style*="display:flex;gap:16px"] {
    flex-direction: column;
  }
  #modal-analytics-body img[style*="width:260px"] {
    width: 100% !important;
    height: auto !important;
  }

  /* Transcript box */
  .transcript-box { font-size: 12px; }

  /* Earnings cards: 2 per row */
  .earnings-card { min-width: calc(50% - 5px); }
}

/* ── 480px specific page fixes ── */
@media (max-width: 480px) {
  /* Stat cards: full width single column */
  .grid-4 .stat-card { padding: 12px 10px; }
  .stat-icon         { width: 36px; height: 36px; font-size: 15px; }
  .stat-value        { font-size: 22px; }
  .stat-label        { font-size: 10px; }

  /* Performance metric cards: 2-col */
  .grid-4[style]     { grid-template-columns: repeat(2, 1fr) !important; }

  /* Card header: stack title+actions */
  .card-header       { flex-wrap: wrap; gap: 8px; }

  /* Video card: more compact */
  .video-card-body   { padding: 10px; }

  /* Settings data tab: 1-col */
  #settings-tab-content .grid-3 { grid-template-columns: 1fr; }

  /* Niche results: 1-col */
  .niche-grid        { grid-template-columns: 1fr !important; }

  /* AI Tools: compact */
  .ai-tools-grid     { grid-template-columns: 1fr !important; }
}
