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

:root {
  /* ── Obsidian Black Surfaces ── */
  --bg:        #080808;
  --surface:   #111111;
  --surface-2: #1a1a1a;
  --surface-3: #222222;
  --surface-4: #2d2d2d;

  /* ── Borders ── */
  --border:        rgba(255, 255, 255, 0.08);
  --border-hover:  rgba(255, 255, 255, 0.16);
  --border-active: rgba(255, 255, 255, 0.24);

  /* ── Text ── */
  --text:   #f5f5f5;
  --text-2: #a3a3a3;
  --text-3: #737373;

  /* ── Crimson (Primary Accent) ── */
  --blue:       hsl(0, 72%, 51%);
  --blue-light: hsl(0, 72%, 65%);
  --blue-dim:   hsla(0, 72%, 51%, 0.10);
  --blue-glow:  hsla(0, 72%, 51%, 0.25);

  /* ── Crimson Light / Success ── */
  --green:      hsl(0, 75%, 60%);
  --green-dim:  hsla(0, 75%, 60%, 0.10);
  --green-glow: hsla(0, 75%, 60%, 0.25);

  /* ── Red / Error ── */
  --red:     hsl(0, 85%, 60%);
  --red-dim: hsla(0, 85%, 60%, 0.10);

  /* ── Amber (Warnings) ── */
  --amber:     hsl(35, 90%, 55%);
  --amber-dim: hsla(35, 90%, 55%, 0.10);

  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius:    14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
}

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--surface-4); }

/* ─── App Shell ─────────────────────────────────────── */
.app { display: flex; flex-direction: column; height: 100vh; }

/* ─── Topbar ────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 62px;
  border-bottom: 1px solid var(--border);
  background: rgba(9,14,26,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  flex-shrink: 0;
  z-index: 100;
  position: sticky;
  top: 0;
}

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

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, hsl(0, 72%, 51%), hsl(0, 85%, 40%));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.25), 0 4px 14px hsla(0, 72%, 51%, 0.35);
}
.logo-text {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

/* Nav Tabs */
.top-nav { display: flex; gap: 2px; }

.nav-tab {
  padding: 6px 18px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: -0.1px;
}
.nav-tab:hover { color: var(--text); background: var(--surface-2); }
.nav-tab.active {
  color: var(--text);
  background: var(--surface-3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

/* Status Badges */
.yt-status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: border-color 0.15s;
  letter-spacing: -0.1px;
}
.yt-status-badge:hover { border-color: var(--border-hover); }

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}
.status-dot.connected {
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(16,185,129,0.25);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 2px rgba(16,185,129,0.25); }
  50%       { box-shadow: 0 0 0 4px rgba(16,185,129,0.10); }
}

/* ─── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  letter-spacing: -0.1px;
}

.btn-connect {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-connect:hover { background: rgba(239,68,68,0.16); border-color: rgba(239,68,68,0.3); }
.btn-connect.connected {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(16,185,129,0.25);
  pointer-events: none;
}

.btn-generate {
  width: 100%;
  justify-content: center;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius);
  background: linear-gradient(135deg, hsl(0, 72%, 51%), hsl(0, 85%, 40%));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 4px 24px var(--blue-glow);
  letter-spacing: -0.2px;
}
.btn-generate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 8px 32px var(--green-glow);
  filter: brightness(1.08);
}
.btn-generate:active:not(:disabled) { transform: translateY(0); filter: brightness(0.96); }
.btn-generate:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn-outline:hover { border-color: var(--border-hover); color: var(--text); background: var(--surface-2); }

.btn-upgrade {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, hsl(0, 72%, 51%), hsl(0, 85%, 40%));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 4px 24px var(--blue-glow);
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}
.btn-upgrade:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 8px 32px var(--blue-glow); filter: brightness(1.08); }

.btn-ghost {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}
.btn-ghost:hover { color: var(--text-2); }

/* ─── Toggle Switch ─────────────────────────────────── */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--surface-3);
  transition: .3s;
  border-radius: 34px;
  border: 1px solid var(--border);
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-2);
  transition: .3s;
  border-radius: 50%;
}
input:checked + .toggle-slider {
  background: linear-gradient(135deg, hsl(0, 72%, 51%), hsl(0, 85%, 40%));
  border-color: transparent;
}
input:checked + .toggle-slider:before {
  transform: translateX(24px);
  background-color: #fff;
}

/* ─── Background Effects ────────────────────────────── */
.bg-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--blue-glow) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.6;
}
.bg-glow-1 { top: -200px; left: -100px; }
.bg-glow-2 { bottom: -200px; right: -100px; background: radial-gradient(circle, var(--green-glow) 0%, transparent 60%); }

/* ─── Glass Elements ────────────────────────────────── */
.glass-card {
  background: rgba(17, 17, 17, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.02) inset;
  border-radius: var(--radius);
}
.glass-modal {
  background: rgba(17, 17, 17, 0.75);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}

/* ─── Tab Content ───────────────────────────────────── */
.tab-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; position: relative; z-index: 1; }
.tab-content.hidden { display: none !important; }

/* ─── Generate Tab Layout ───────────────────────────── */
.generate-layout {
  display: flex;
  gap: 40px;
  padding: 40px 60px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Center Stage / Hero */
.hero-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 680px;
}

.hero-text { margin-bottom: 8px; }
.hero-title {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero-title span {
  background: linear-gradient(135deg, hsl(0, 72%, 55%), hsl(0, 85%, 45%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 500px;
}

/* Input Card */
.main-input-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.3s;
}
.main-input-card:focus-within { border-color: rgba(220, 38, 38, 0.4); }

.input-row-lg {
  display: flex;
  gap: 12px;
}
.niche-input-lg {
  flex: 1;
  padding: 16px 20px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}
.niche-input-lg:focus { border-color: var(--blue); background: rgba(0,0,0,0.6); }

.btn-generate-lg {
  width: auto;
  padding: 0 28px;
  font-size: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, hsl(0, 72%, 51%), hsl(0, 85%, 40%));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 4px 24px var(--blue-glow);
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-generate-lg:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 8px 32px var(--blue-glow); filter: brightness(1.1); }
.btn-generate-lg:disabled { opacity: 0.5; cursor: not-allowed; }

.panel-header { }
.panel-header h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 4px;
}
.panel-subtitle { font-size: 13px; color: var(--text-2); line-height: 1.55; }

.input-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s;
}
.input-card:focus-within { border-color: var(--border-active); }

.input-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.niche-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  letter-spacing: -0.1px;
}
.niche-input:focus { border-color: var(--blue); background: var(--surface-4); }
.niche-input::placeholder { color: var(--text-3); }

.free-tier-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--amber);
  padding: 8px 12px;
  background: var(--amber-dim);
  border: 1px solid rgba(251,191,36,0.15);
  border-radius: var(--radius-sm);
  text-align: center;
  letter-spacing: -0.1px;
}

/* Progress Card */
.progress-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.progress-card.hidden { display: none !important; }
.progress-header { display: flex; justify-content: space-between; align-items: center; }
.progress-label { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -0.1px; }
#progress-pct { font-size: 13px; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; letter-spacing: -0.2px; }
.progress-track {
  height: 5px;
  background: var(--surface-4);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, hsl(0, 85%, 40%), hsl(0, 72%, 51%), #fff);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--blue-glow);
}
.progress-step { font-size: 12.5px; color: var(--text-2); letter-spacing: -0.1px; }

/* ─── Right Sidebar / Activity ─────────────────────── */
.activity-sidebar {
  width: 380px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  position: sticky;
  top: 0;
}

.activity-header {
  padding: 20px 24px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.activity-header svg { color: var(--blue); }

.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.log-entry {
  display: flex;
  gap: 14px;
  animation: logIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes logIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.log-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.log-body { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.log-sender { font-size: 12px; font-weight: 700; color: var(--text-2); letter-spacing: 0.02em; }
.log-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-top-left-radius: 4px;
  padding: 12px 16px;
}
.log-text a { color: var(--blue); text-decoration: none; font-weight: 600; }
.log-text a:hover { text-decoration: underline; }

/* ─── Analytics Tab ─────────────────────────────────── */
.analytics-layout {
  padding: 40px 60px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.analytics-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat-card {
  padding: 32px 28px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.stat-card:hover {
  border-color: rgba(220, 38, 38, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.02) inset;
}
.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.stat-value {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--text);
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat-sub { font-size: 13px; color: var(--text-3); font-weight: 500; }

/* Videos Table */
.videos-table-card { overflow: hidden; }
.table-header {
  padding: 20px 28px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(0,0,0,0.2);
}
.table-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 15px;
}
.table-row-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  display: grid;
  grid-template-columns: 1fr 100px 130px 80px;
  gap: 20px;
}
.table-row {
  display: grid;
  grid-template-columns: 1fr 100px 130px 80px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 20px;
  transition: background 0.15s;
}
.table-row:last-child { border-bottom: none; }
.table-row:hover { background: rgba(255,255,255,0.03); }
.video-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.1px; }
.video-views { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.video-date { font-size: 13px; color: var(--text-2); font-weight: 500; }
.video-link a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.video-link a:hover { text-decoration: underline; color: var(--blue-light); }

/* ─── Modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none !important; }

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

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border-active);
  border-radius: 20px;
  padding: 44px 40px;
  width: 480px;
  max-width: 95vw;
  box-shadow: 0 40px 100px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04) inset;
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.3), transparent);
}

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

.modal-icon { font-size: 42px; margin-bottom: 18px; }
.modal-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  color: var(--text);
}
.modal-desc {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 24px;
}
.modal-features {
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.feature-item {
  font-size: 13.5px;
  color: var(--green);
  font-weight: 600;
  letter-spacing: -0.1px;
}

/* ─── Pipeline Steps ───────────────────────────────── */
.pipeline-steps {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.pipeline-step span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  transition: color 0.3s;
}
.step-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--surface-4);
  border: 2px solid var(--surface-4);
  transition: background 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.pipeline-step.active .step-dot {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.pipeline-step.active span { color: var(--blue); }
.pipeline-step.done .step-dot {
  background: var(--green);
  border-color: var(--green);
}
.pipeline-step.done span { color: var(--green); }

.step-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-bottom: 17px;
  max-width: 32px;
}

/* ─── Toast ─────────────────────────────────────────── */
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ─── Divider ───────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0 -22px;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 800px) {
  .generate-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .generate-panel { border-right: none; border-bottom: 1px solid var(--border); }
  .stat-cards { grid-template-columns: 1fr; }
  .analytics-layout { padding: 24px 20px; }
  .topbar { padding: 0 18px; }
}
/* -- Toast Notifications -- */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast.show {
    transform: translateX(0);
    opacity: 1;
}
.toast-icon {
    font-size: 20px;
}
.toast-content h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: white;
}
.toast-content p {
    margin: 0;
    font-size: 13px;
    color: var(--text-2);
}
.toast.success { border-left: 4px solid var(--emerald); }
.toast.error { border-left: 4px solid var(--crimson); }
.toast.info { border-left: 4px solid var(--blue); }
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 var(--blue-glow); }
  70% { box-shadow: 0 0 0 15px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.btn-generate {
  animation: pulseGlow 2s infinite;
}
.btn-generate:hover {
  animation: none;
}
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ======================================================
   10x GUI OVERHAUL -- Sidebar Studio Layout
   ====================================================== */

body { overflow: hidden; }

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Left Sidebar */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 2px;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 28px 8px;
}
.sidebar-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: #f5f5f5;
  letter-spacing: -0.5px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #525252;
  text-transform: uppercase;
  padding: 12px 12px 4px 12px;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: #a3a3a3;
  background: transparent;
  border: none;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
  position: relative;
}
.sidebar-btn:hover { color: #f5f5f5; background: #1a1a1a; }
.sidebar-btn.active { color: #dc2626; background: rgba(220,38,38,0.1); font-weight: 600; }
.sidebar-btn.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: #dc2626;
  border-radius: 0 4px 4px 0;
}
.sidebar-btn svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.sidebar-btn.active svg { opacity: 1; }

.sidebar-spacer { flex: 1; }

.sidebar-worker-block {
  padding: 14px;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  margin-top: 12px;
}
.sidebar-worker-block .worker-status { gap: 8px; }
.sidebar-worker-block .worker-label { font-size: 13px; font-weight: 600; }
.sidebar-worker-block p { font-size: 11px; color: #525252; margin-top: 5px; }

/* Main Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.top-header {
  height: 65px;
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 36px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(8,8,8,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  gap: 12px;
  flex-shrink: 0;
}

.top-header .free-tier-badge { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; font-size: 13px; color: var(--text-2); white-space: nowrap; }

.btn-upgrade {
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 14px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-sans);
}
.btn-upgrade:hover { filter: brightness(1.15); }

.content-area { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* Hide old wrappers */
.app { display: none !important; }
.topbar { display: none !important; }

/* Brand Kit Modal */
.brand-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-modal.hidden { display: none !important; }
.brand-modal-inner {
  background: #111111;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}


/* ── Missing Classes Audit Fix ─────────────────────────────────────── */
.days-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.day-cb {
  display: none;
}

.days-selector label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.day-cb:checked + label,
.days-selector label:has(+ .day-cb:checked) {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.setting-group {
  margin-bottom: 24px;
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.setting-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.setting-info p {
  font-size: 13px;
  color: var(--text-2);
  margin: 0;
}

.progress-label-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.btn-refresh {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-refresh:hover {
  background: var(--surface-2);
  color: var(--text);
}

.pricing-card {
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  text-align: left;
}

.pulse-ring {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(34,197,94,0.7);
  animation: pulse-anim 1.5s ease-out infinite;
}

@keyframes pulse-anim {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.ticker-container {
  overflow: hidden;
  white-space: nowrap;
}

.ticker-track {
  display: inline-block;
  animation: ticker 40s linear infinite;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.day-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.day-pill:hover {
  border-color: var(--blue);
  color: var(--text);
}

.day-pill input[type=checkbox] {
  accent-color: var(--blue);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.day-pill:has(input:checked) {
  background: var(--blue-dim);
  border-color: var(--blue);
  color: var(--blue-light);
}

/* ── Clip Gallery Cards ─────────────────────────────────────────── */
.clip-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.clip-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  border-color: rgba(59,130,246,0.35);
}

.clip-card-thumb {
  width: 100%;
  aspect-ratio: 9/16;
  background: var(--bg-1);
  background-size: cover;
  background-position: center;
  position: relative;
}

.clip-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.clip-card:hover .clip-card-overlay {
  background: rgba(0,0,0,0.45);
}

.clip-play-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s, transform 0.2s;
}

.clip-card:hover .clip-play-btn {
  opacity: 1;
  transform: scale(1);
}

.clip-score-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.clip-card-info {
  padding: 14px 16px;
}

.clip-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-2);
}

.clip-views {
  font-weight: 700;
  color: white;
  background: rgba(255,255,255,0.08);
  padding: 3px 8px;
  border-radius: 10px;
}
