/* ===== SNIPER YT - DARK GOLD THEME ===== */
:root {
  --gold: #F5C518;
  --gold-dark: #D4A017;
  --gold-light: #FFD700;
  --gold-dim: rgba(245, 197, 24, 0.15);
  --gold-border: rgba(245, 197, 24, 0.3);
  --bg-primary: #0D0D0D;
  --bg-secondary: #141414;
  --bg-card: #1A1A1A;
  --bg-card-hover: #222222;
  --bg-input: #111111;
  --text-primary: #F0F0F0;
  --text-secondary: #A0A0A0;
  --text-muted: #606060;
  --border: #2A2A2A;
  --border-light: #333333;
  --red: #FF4444;
  --green: #22C55E;
  --blue: #3B82F6;
  --purple: #A855F7;
  --orange: #F97316;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }
* { scrollbar-width: thin; scrollbar-color: var(--border-light) transparent; }

/* ===== ANIMATIONS ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
@keyframes livePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.85); } }
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes goldGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(245,197,24,0.2); }
  50% { box-shadow: 0 0 20px rgba(245,197,24,0.5); }
}

.page-enter { animation: fadeInUp 0.3s ease; }
.fade-in { animation: fadeIn 0.25s ease; }

/* ===== SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
}

/* ===== GRADIENT BORDER CARD ===== */
.card-gradient-border {
  border: 1px solid transparent;
  background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
              linear-gradient(135deg, var(--gold), var(--orange)) border-box;
}

/* ===== LAYOUT ===== */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ===== SIDEBAR ===== */
#sidebar {
  width: 240px; min-width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
  z-index: 100;
}
#sidebar.collapsed { width: 64px; min-width: 64px; }
#sidebar.collapsed .nav-label,
#sidebar.collapsed .sidebar-logo-text,
#sidebar.collapsed .sidebar-section-title { display: none; }
#sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
#sidebar.collapsed .nav-icon { margin: 0; }

.sidebar-logo {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.sidebar-logo-text h1 { font-size: 15px; font-weight: 800; color: var(--gold); letter-spacing: -0.3px; }
.sidebar-logo-text p { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.sidebar-section-title {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.2px;
  padding: 10px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-md);
  cursor: pointer; transition: all var(--transition);
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  margin-bottom: 2px; position: relative;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); transform: translateX(2px); }
.nav-item.active {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--gold);
  border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--red);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center;
}
.sidebar-bottom { padding: 10px 8px; border-top: 1px solid var(--border); }

/* ===== MAIN CONTENT ===== */
#main-content {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; background: var(--bg-primary);
}

/* ===== TOPBAR ===== */
#topbar {
  height: 54px; min-height: 54px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
}
#topbar-title { font-size: 15px; font-weight: 700; color: var(--text-primary); flex: 0 0 auto; letter-spacing: -0.2px; }
.topbar-caption {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-caption-author {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}
.topbar-caption-author:hover { text-decoration: underline; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.topbar-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all var(--transition); position: relative;
}
.topbar-btn:hover { border-color: var(--gold-border); color: var(--gold); background: var(--gold-dim); }
.topbar-btn .notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px; background: var(--red);
  border-radius: 50%; border: 2px solid var(--bg-secondary);
}

/* ===== PAGE CONTENT ===== */
#page-content { flex: 1; overflow-y: auto; padding: 20px; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card-sm { padding: 14px; }
.card:hover { border-color: var(--border-light); }
.card-gold { border-color: var(--gold-border); background: var(--gold-dim); }
.card-interactive { cursor: pointer; }
.card-interactive:hover { border-color: var(--gold-border); box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* ===== STAT CARDS ===== */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--gold-border); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.stat-icon.gold { background: var(--gold-dim); color: var(--gold); }
.stat-icon.red { background: rgba(255,68,68,0.15); color: var(--red); }
.stat-icon.green { background: rgba(34,197,94,0.15); color: var(--green); }
.stat-icon.blue { background: rgba(59,130,246,0.15); color: var(--blue); }
.stat-icon.purple { background: rgba(168,85,247,0.15); color: var(--purple); }
.stat-value { font-size: 22px; font-weight: 800; color: var(--text-primary); line-height: 1; letter-spacing: -0.5px; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm); font-size: 13px;
  font-weight: 600; cursor: pointer; border: none;
  transition: all var(--transition); white-space: nowrap;
  font-family: inherit; letter-spacing: 0.1px;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn:active:not(:disabled) { transform: scale(0.97) !important; }

.btn-gold { background: var(--gold); color: #000; }
.btn-gold:hover:not(:disabled) {
  background: var(--gold-light); transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(245,197,24,0.35);
}
.btn-outline {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover:not(:disabled) { border-color: var(--gold-border); color: var(--gold); background: var(--gold-dim); }
.btn-ghost { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border-light); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover:not(:disabled) { background: #ff2222; box-shadow: 0 4px 14px rgba(255,68,68,0.3); }
.btn-green { background: var(--green); color: #000; }
.btn-green:hover:not(:disabled) { background: #16a34a; box-shadow: 0 4px 14px rgba(34,197,94,0.3); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; justify-content: center; }

/* ===== INPUTS ===== */
.input, .select, textarea.input {
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 13px; width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none; font-family: inherit;
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.08);
}
.input:hover:not(:focus), .select:hover:not(:focus) { border-color: var(--border-light); }
.input::placeholder { color: var(--text-muted); }
.select { appearance: none; cursor: pointer; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
label.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; display: block; }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.6; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
}
.badge-gold { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-border); }
.badge-red { background: rgba(255,68,68,0.15); color: var(--red); }
.badge-green { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-blue { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-purple { background: rgba(168,85,247,0.15); color: var(--purple); }
.badge-gray { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border); }

/* ===== VIDEO CARD ===== */
.video-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer; position: relative;
}
.video-card:hover {
  border-color: var(--gold-border);
  transform: translateY(-3px);
  box-shadow: 0 10px 35px rgba(0,0,0,0.45);
}
.video-card.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dim); }
.video-thumb-wrap { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #111; }
.video-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s 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.88); color: #fff;
  font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px;
}
.video-viral-badge {
  position: absolute; top: 6px; left: 6px;
  background: var(--gold); color: #000;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px;
}
.video-save-btn {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(0,0,0,0.75); border: none; color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 12px; opacity: 0; transition: all var(--transition);
}
.video-card:hover .video-save-btn { opacity: 1; }
.video-save-btn:hover { color: var(--gold); background: rgba(0,0,0,0.92); }
.video-save-btn.saved { color: var(--gold); opacity: 1; }
.video-select-check {
  position: absolute; top: 6px; left: 6px;
  width: 22px; height: 22px; border-radius: 5px;
  background: rgba(0,0,0,0.75); border: 2px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: transparent; transition: all var(--transition);
}
.video-card.selected .video-select-check { background: var(--gold); border-color: var(--gold); color: #000; }
.video-info { padding: 12px; }
.video-title {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  line-height: 1.45; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.video-channel { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.video-channel img { width: 16px; height: 16px; border-radius: 50%; }
.video-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.video-stat { font-size: 11px; color: var(--text-secondary); display: flex; align-items: center; gap: 3px; }
.video-stat i { font-size: 10px; color: var(--text-muted); }
.vph-highlight { color: var(--gold); font-weight: 700; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.88); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

/* Video Player Modal - Always on top */
#modal-player.modal-overlay { z-index: 10000; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 18px; width: 100%; max-height: 90vh;
  display: flex; flex-direction: column;
  transform: scale(0.94) translateY(8px);
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-sm { max-width: 480px; }
.modal-md { max-width: 680px; }
.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1100px; }
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.modal-close {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { color: var(--text-primary); border-color: var(--border-light); background: var(--bg-card-hover); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  flex-shrink: 0;
}

/* ===== TABS ===== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab-btn {
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; border: none;
  background: transparent; border-bottom: 2px solid transparent;
  transition: all var(--transition); margin-bottom: -1px;
  white-space: nowrap; font-family: inherit;
}
.tab-btn:hover { color: var(--text-primary); background: var(--bg-card); border-radius: 6px 6px 0 0; }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.2s ease; }

/* ===== VIRAL SCORE BAR ===== */
.viral-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.viral-bar-fill { height: 100%; border-radius: 3px; transition: width 0.6s cubic-bezier(0.4,0,0.2,1); }
.viral-low { background: var(--text-muted); }
.viral-mid { background: var(--orange); }
.viral-high { background: var(--gold); }
.viral-max { background: linear-gradient(90deg, var(--gold), var(--red)); }

/* ===== LOADING ===== */
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  animation: spin 0.75s linear infinite;
}
.loading-overlay {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 40px;
  color: var(--text-muted); font-size: 13px;
}

/* ===== TOAST ===== */
#toast-container {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; min-width: 280px; max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--gold); }
.toast.warning { border-left: 3px solid var(--orange); }

/* ===== SEARCH FILTERS ===== */
.filter-bar {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  margin-bottom: 20px;
}
.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-group.grow { flex: 1; min-width: 200px; }
.search-input-wrap { position: relative; }
.search-input-wrap .input { padding-left: 36px; }
.search-input-wrap i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; }

/* ===== GRID ===== */
.video-grid { display: grid; gap: 16px; }
.video-grid-4 { grid-template-columns: repeat(4, 1fr); }
.video-grid-3 { grid-template-columns: repeat(3, 1fr); }
.video-grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1400px) { .video-grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) { .video-grid-4, .video-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .video-grid-4, .video-grid-3, .video-grid-2 { grid-template-columns: 1fr; } }

/* ===== COMPARE ACTION BAR ===== */
#compare-bar {
  position: fixed; bottom: 0; left: 240px; right: 0;
  background: var(--bg-secondary); border-top: 1px solid var(--gold-border);
  padding: 12px 24px; display: flex; align-items: center; gap: 12px;
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); z-index: 50;
  backdrop-filter: blur(8px);
}
#compare-bar.visible { transform: translateY(0); }
#sidebar.collapsed ~ #main-content #compare-bar { left: 64px; }

/* ===== NOTIFICATION PANEL ===== */
#notif-panel {
  position: fixed; top: 54px; right: 0; width: 360px;
  background: var(--bg-card); border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border); border-radius: 0 0 0 14px;
  max-height: calc(100vh - 54px); overflow-y: auto;
  z-index: 200; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);
}
#notif-panel.open { transform: translateX(0); }
.notif-item {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-card-hover); }
.notif-item.unread { border-left: 3px solid var(--gold); }
.notif-item-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.notif-item-msg { font-size: 12px; color: var(--text-muted); }
.notif-item-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ===== PROGRESS BAR ===== */
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--gold); border-radius: 3px; transition: width 0.4s ease; }

/* ===== KEY MANAGEMENT ===== */
.key-item {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
  transition: border-color var(--transition);
}
.key-item:hover { border-color: var(--border-light); }
.key-item.active-key { border-color: var(--gold-border); }
.key-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.key-status.on { background: var(--green); box-shadow: 0 0 8px var(--green); animation: livePulse 2s infinite; }
.key-status.off { background: var(--text-muted); }

/* ===== NICHE METER ===== */
.opportunity-meter {
  width: 100%; height: 10px; background: var(--border);
  border-radius: 5px; overflow: hidden; margin: 8px 0;
}
.opportunity-fill {
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--red), var(--orange), var(--gold), var(--green));
  transition: width 0.9s cubic-bezier(0.4,0,0.2,1);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; gap: 12px;
  color: var(--text-muted); text-align: center;
}
.empty-state i { font-size: 44px; opacity: 0.25; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
.empty-state p { font-size: 13px; max-width: 300px; line-height: 1.6; }

/* ===== MISC UTILITIES ===== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }
.text-purple { color: var(--purple); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } .topbar-caption { display: none; } }

/* ===== SEARCHABLE SELECT ===== */
.ss-wrap { position: relative; }
.ss-display {
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm);
  padding: 9px 32px 9px 12px; font-size: 13px; width: 100%;
  cursor: pointer; transition: border-color var(--transition); outline: none;
  display: flex; align-items: center; gap: 6px; user-select: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ss-display:hover, .ss-wrap.open .ss-display { border-color: var(--gold-border); }
.ss-arrow {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 11px; pointer-events: none;
  transition: transform var(--transition);
}
.ss-wrap.open .ss-arrow { transform: translateY(-50%) rotate(180deg); }
.ss-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--gold-border);
  border-radius: var(--radius-md); z-index: 500; overflow: hidden;
  box-shadow: var(--shadow-lg); display: none; flex-direction: column;
  animation: scaleIn 0.15s ease;
}
.ss-wrap.open .ss-dropdown { display: flex; }
.ss-search-wrap { padding: 8px; border-bottom: 1px solid var(--border); }
.ss-search {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm); padding: 7px 10px;
  font-size: 12px; outline: none; font-family: inherit;
}
.ss-search:focus { border-color: var(--gold-border); }
.ss-list { max-height: 220px; overflow-y: auto; padding: 4px; }
.ss-option {
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px;
  color: var(--text-primary); cursor: pointer; transition: background 0.15s;
  display: flex; align-items: center; gap: 6px;
}
.ss-option:hover { background: var(--bg-card-hover); }
.ss-option.selected { background: var(--gold-dim); color: var(--gold); }
.ss-option.hidden { display: none; }
.ss-empty { padding: 12px; text-align: center; font-size: 12px; color: var(--text-muted); }

/* ===== VIDEO CARD ACTIONS ===== */
.video-play-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.25s;
}
.video-card:hover .video-play-overlay { background: rgba(0,0,0,0.45); }
.video-play-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(245,197,24,0.92); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; opacity: 0; transform: scale(0.75);
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1); padding-left: 3px;
}
.video-card:hover .video-play-btn { opacity: 1; transform: scale(1); }

.video-card-actions {
  display: flex; border-top: 1px solid var(--border);
}
.vca-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 8px 4px; background: none; border: none;
  cursor: pointer; font-size: 10px; font-weight: 600;
  color: var(--text-muted); transition: all var(--transition);
  border-right: 1px solid var(--border); font-family: inherit;
}
.vca-btn:last-child { border-right: none; }
.vca-btn i { font-size: 13px; }
.vca-analisis:hover { color: var(--gold); background: var(--gold-dim); }
.vca-transkrip:hover { color: var(--purple); background: rgba(168,85,247,0.1); }
.vca-simpan:hover { color: var(--green); background: rgba(34,197,94,0.1); }
.vca-simpan.saved { color: var(--green); }

/* ===== VIDEO PLAYER MODAL ===== */
#modal-player .modal { max-width: 860px; background: #000; border-color: #333; }
#modal-player .modal-header { background: #111; border-color: #333; }
#modal-player .modal-title { color: #fff; }
#modal-player .modal-close { background: #222; border-color: #444; color: #aaa; }
.yt-player-wrap {
  position: relative; width: 100%; padding-top: 56.25%;
  background: #000;
}
.yt-player-wrap iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  border: none;
}

/* ===== ANALYTICS MODAL TABS ===== */
.analytics-tab-content { padding: 16px 0; }
.perf-metric-card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px; text-align: center;
  transition: border-color var(--transition);
}
.perf-metric-card:hover { border-color: var(--border-light); }
.perf-metric-val { font-size: 22px; font-weight: 800; margin-bottom: 3px; letter-spacing: -0.5px; }
.perf-metric-label { font-size: 11px; color: var(--text-muted); }
.earnings-card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px; text-align: center; flex: 1;
  transition: border-color var(--transition);
}
.earnings-card:hover { border-color: var(--border-light); }
.earnings-val { font-size: 17px; font-weight: 700; color: var(--gold); margin-top: 4px; }
.earnings-label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; }
.transcript-box {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; max-height: 320px; overflow-y: auto;
  font-size: 13px; line-height: 1.8; color: var(--text-secondary);
}
.transcript-line { padding: 3px 0; border-bottom: 1px solid var(--border); }
.transcript-time { color: var(--gold); font-size: 11px; font-weight: 600; margin-right: 8px; }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  #sidebar {
    position: fixed; left: -240px; height: 100vh;
    transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
    z-index: 1000;
  }
  #sidebar.mobile-open { left: 0; box-shadow: 4px 0 30px rgba(0,0,0,0.6); }
  #main-content { width: 100%; margin-left: 0; }
  #compare-bar { left: 0; }
  .modal-overlay { padding: 6px; }
  .modal { border-radius: 12px; max-height: 95vh; }
  .modal-xl, .modal-lg { max-width: 100%; }
  .modal-body { padding: 14px; }
  #page-content { padding: 10px; }
  .filter-bar { padding: 12px; flex-direction: column; gap: 10px; }
  .filter-group.grow { min-width: 100%; }
  .filter-group { width: 100%; }
  .filter-group .select, .filter-group .input { width: 100%; }
  .video-grid-4, .video-grid-3, .video-grid-2 { grid-template-columns: 1fr !important; }
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-3 { grid-template-columns: 1fr !important; }
  .grid-2 { grid-template-columns: 1fr !important; }
  .stat-card { padding: 12px 14px; }
  .stat-value { font-size: 18px; }
  #topbar { padding: 0 10px; height: 48px; min-height: 48px; }
  #topbar-title { font-size: 13px; }
  .topbar-caption { font-size: 10px; padding: 0 6px; }
  .topbar-btn { width: 30px; height: 30px; font-size: 12px; }

  /* Hamburger button */
  .mobile-menu-btn { display: flex !important; }

  /* Mobile overlay */
  .mobile-overlay {
    position: fixed; inset: 0; z-index: 999;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .mobile-overlay.active { opacity: 1; pointer-events: all; }

  /* Notif panel full width */
  #notif-panel { width: 100%; border-radius: 0; top: 48px; max-height: calc(100vh - 48px); }

  /* Compare page grid */
  #compare-results .card table { font-size: 11px; }

  /* AI Tools SEO grid */
  #tab-seo > div { grid-template-columns: 1fr !important; }
  #seo-detail-grid { grid-template-columns: 1fr !important; }

  /* Channel page grids */
  #ch-video-grid > div { grid-template-columns: repeat(2, 1fr) !important; }

  /* Video card actions smaller */
  .vca-btn { padding: 6px 2px; font-size: 9px; }
  .vca-btn i { font-size: 12px; }

  /* Sidebar bottom */
  .sidebar-bottom { padding: 8px; }

  /* Earnings cards */
  .earnings-card { padding: 10px; }
  .earnings-val { font-size: 14px; }

  /* Perf metric cards */
  .perf-metric-val { font-size: 18px; }

  /* Searchable select dropdown */
  .ss-dropdown { position: fixed; left: 10px !important; right: 10px !important; top: auto !important; bottom: 60px; max-height: 50vh; }
}

/* Hamburger button - hidden on desktop */
.mobile-menu-btn {
  display: none;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  align-items: center; justify-content: center;
  font-size: 16px; transition: all var(--transition);
}
.mobile-menu-btn:hover { border-color: var(--gold-border); color: var(--gold); }

/* ===== LIVE INDICATOR ===== */
.live-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  animation: livePulse 1.5s ease-in-out infinite;
}

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.section-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
