/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --bg-primary: #050B18;
  --bg-secondary: #0D1526;
  --bg-card: #111E35;
  --bg-card-hover: #162440;
  --accent: #2563EB;
  --accent-light: #3B82F6;
  --accent-glow: rgba(37, 99, 235, 0.25);
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted: #4B5563;
  --border: #1E3050;
  --border-active: #2563EB;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-blue: 0 0 0 2px rgba(37,99,235,0.4);

  /* Compatibility aliases for old selectors */
  --bg-base: var(--bg-primary);
  --bg-surface: var(--bg-secondary);
  --bg-input: var(--bg-secondary);
  --border-hover: var(--accent-light);
  --purple-400: var(--accent-light);
  --purple-500: var(--accent);
  --purple-600: #1D4ED8;
  --pink-500: var(--accent-light);
  --pink-400: var(--accent-glow);
  --amber-400: var(--accent-light);
  --green-400: var(--success);
  --red-400: var(--danger);
  --radius-sm: 8px;
  --radius-md: var(--radius);
  --radius-lg: var(--radius-lg);
  --radius-xl: 20px;
  --shadow-glow: 0 0 80px rgba(37, 99, 235, 0.15), 0 0 120px rgba(59, 130, 246, 0.05);
  --shadow-card: var(--shadow);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   AMBIENT BACKGROUND ORBS
   ============================================================ */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: orbReveal 2s ease forwards;
}

.orb-1 {
  width: 600px;
  height: 600px;
  top: -200px;
  left: -150px;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.22) 0%, transparent 70%);
  animation-delay: 0.2s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  top: 40%;
  right: -200px;
  background: radial-gradient(circle, rgba(252, 211, 77, 0.14) 0%, transparent 70%);
  animation-delay: 0.5s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  left: 30%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, transparent 70%);
  animation-delay: 0.8s;
}

/* ── Floating Particles (minimal background animation) ── */
.particle {
  position: fixed;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: rgba(252, 211, 77, 0.55);
  pointer-events: none;
  z-index: 0;
  animation: particleFloat linear infinite;
}

.particle:nth-child(1) {
  left: 5%;
  animation-duration: 12s;
  animation-delay: 0s;
  width: 3px;
  height: 3px;
  opacity: 0.7;
}

.particle:nth-child(2) {
  left: 15%;
  animation-duration: 16s;
  animation-delay: -4s;
  width: 4px;
  height: 4px;
  opacity: 0.55;
}

.particle:nth-child(3) {
  left: 25%;
  animation-duration: 10s;
  animation-delay: -2s;
  width: 2.5px;
  height: 2.5px;
  opacity: 0.65;
}

.particle:nth-child(4) {
  left: 38%;
  animation-duration: 18s;
  animation-delay: -7s;
  width: 3.5px;
  height: 3.5px;
  opacity: 0.5;
}

.particle:nth-child(5) {
  left: 50%;
  animation-duration: 13s;
  animation-delay: -1s;
  width: 3px;
  height: 3px;
  opacity: 0.6;
}

.particle:nth-child(6) {
  left: 62%;
  animation-duration: 9s;
  animation-delay: -5s;
  width: 4.5px;
  height: 4.5px;
  opacity: 0.4;
}

.particle:nth-child(7) {
  left: 73%;
  animation-duration: 14s;
  animation-delay: -3s;
  width: 2.5px;
  height: 2.5px;
  opacity: 0.65;
}

.particle:nth-child(8) {
  left: 83%;
  animation-duration: 11s;
  animation-delay: -6s;
  width: 3.5px;
  height: 3.5px;
  opacity: 0.55;
}

.particle:nth-child(9) {
  left: 92%;
  animation-duration: 15s;
  animation-delay: -2s;
  width: 2px;
  height: 2px;
  opacity: 0.7;
}

.particle:nth-child(10) {
  left: 10%;
  animation-duration: 8s;
  animation-delay: -8s;
  width: 3px;
  height: 3px;
  opacity: 0.45;
}

.particle:nth-child(11) {
  left: 44%;
  animation-duration: 17s;
  animation-delay: -9s;
  width: 4px;
  height: 4px;
  opacity: 0.4;
}

.particle:nth-child(12) {
  left: 58%;
  animation-duration: 11s;
  animation-delay: -11s;
  width: 2.5px;
  height: 2.5px;
  opacity: 0.6;
}

.particle:nth-child(13) {
  left: 30%;
  animation-duration: 20s;
  animation-delay: -5s;
  width: 3px;
  height: 3px;
  opacity: 0.35;
}

.particle:nth-child(14) {
  left: 78%;
  animation-duration: 7s;
  animation-delay: -3s;
  width: 2px;
  height: 2px;
  opacity: 0.7;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) scale(1);
    opacity: 0;
  }

  5% {
    opacity: 1;
  }

  90% {
    opacity: 0.6;
  }

  100% {
    transform: translateY(-8vh) scale(0.4);
    opacity: 0;
  }
}

@keyframes orbReveal {
  to {
    opacity: 1;
  }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  border-bottom: none;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(37, 99, 235, 0.6));
}

.logo-text {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.logo-vip {
  background: linear-gradient(135deg, var(--purple-400), var(--pink-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 99px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-400);
  box-shadow: 0 0 8px var(--green-400);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(0.85);
  }
}

/* ============================================================
   MAIN & SCREENS
   ============================================================ */
main {
  flex: 1;
  position: relative;
  z-index: 1;
}

.screen {
  display: none;
  min-height: calc(100vh - 120px);
  padding: 4rem 2rem;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: screenFadeIn 0.5s ease forwards;
}

@keyframes screenFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   HERO / INPUT SCREEN
   ============================================================ */
.hero-content {
  width: 100%;
  max-width: 700px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--amber-400);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  padding: 6px 14px;
  border-radius: 99px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-light) 0%, #60a5fa 45%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 520px;
}

/* Input Card */
.input-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-card:focus-within {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(37, 99, 235, 0.2), var(--shadow-glow);
}

/* ── Options row (mode toggle + clip count side by side) ──── */
.options-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.options-row .mode-toggle {
  flex: 1;
}

/* ── Clip Count Control ───────────────────────────────────── */
.clip-count-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0.3rem 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 110px;
}

.clip-count-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.clip-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stepper-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-family: inherit;
  padding: 0;
}

.stepper-btn:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.4);
  color: var(--purple-400);
}

.stepper-btn:active {
  transform: scale(0.9);
}

#clips-display {
  font-size: 0.88rem;
  font-weight: 700;
  min-width: 42px;
  text-align: center;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

#clips-display.clips-default {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Pulse on value change */
@keyframes countPop {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.25);
  }

  100% {
    transform: scale(1);
  }
}

.count-pop {
  animation: countPop 0.2s ease;
}

/* ── Mode Toggle (Pad / Fill) ─────────────────────────────── */
.mode-toggle {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* hide the native radio */
.mode-toggle input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.55rem 0.75rem;
  border-radius: calc(var(--radius-md) - 3px);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  position: relative;
}

.mode-hint {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Active state driven by :checked */
input[type="radio"]:checked+.mode-btn {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(37, 99, 235, 0.5);
  color: var(--text-primary);
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.2);
}

input[type="radio"]:checked+.mode-btn .mode-hint {
  color: var(--purple-400);
  opacity: 1;
}

input[type="radio"]:checked+.mode-btn svg {
  stroke: var(--purple-400);
}

.mode-btn:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.1rem;
  transition: border-color var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--purple-500);
}

.input-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color var(--transition);
}

.input-wrapper:focus-within .input-icon {
  color: var(--purple-400);
}

#youtube-url-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-primary);
  caret-color: var(--purple-400);
}

#youtube-url-input::placeholder {
  color: var(--text-muted);
}

#youtube-url-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Video Source Tabs */
.source-tabs {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  margin-bottom: 0.5rem;
}

.source-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: calc(var(--radius-md) - 3px);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.source-tab:hover {
  color: var(--text-secondary);
}

.source-tab.active {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.25), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

/* File Upload Zone */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.25rem 1.5rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--purple-500);
  background: rgba(245, 158, 11, 0.04);
}

.upload-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.upload-zone:hover .upload-icon,
.upload-zone.dragover .upload-icon {
  color: var(--purple-400);
}

.upload-text {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

.upload-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.upload-warning {
  font-size: 0.72rem;
  color: var(--purple-400);
  margin-top: 0.5rem;
  font-weight: 500;
}

.file-info-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: 0.5rem;
}

.file-info-icon {
  font-size: 1.5rem;
}

.file-info-details {
  flex: 1;
  text-align: left;
  min-width: 0;
}

.file-info-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-info-size {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.file-info-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color var(--transition);
  padding: 0.25rem;
  line-height: 1;
}

.file-info-remove:hover {
  color: var(--red-400);
}

/* Bulk mode */
.bulk-mode-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.bulk-mode-toggle .bulk-on-label {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.bulk-url-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bulk-url-container[hidden] {
  display: none !important;
}

.bulk-url-textarea {
  width: 100%;
  min-height: 8.5rem;
  resize: vertical;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.1rem;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
  caret-color: var(--purple-400);
}

.bulk-url-textarea::placeholder {
  color: var(--text-muted);
}

.bulk-url-textarea:focus {
  border-color: var(--purple-500);
}

.bulk-url-textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bulk-url-count {
  font-size: 0.8rem;
  color: var(--purple-400);
  font-weight: 500;
  padding-left: 0.25rem;
  margin: 0;
}

.bulk-progress-panel {
  width: 100%;
  max-width: 420px;
  margin: 0 auto 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bulk-progress-panel[hidden] {
  display: none !important;
}

.bulk-overall-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  text-align: center;
}

.bulk-video-status {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  text-align: center;
}

.bulk-overall-track,
.bulk-results-track {
  height: 6px;
}

.bulk-results-progress {
  margin-top: 0.75rem;
  width: 100%;
  max-width: 360px;
}

.bulk-results-progress[hidden] {
  display: none !important;
}

.bulk-results-status {
  font-size: 0.8rem;
  color: var(--purple-400);
  margin: 0 0 0.4rem;
  font-weight: 500;
}

/* Generate Button */
.btn-generate {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 28px var(--accent-glow);
}

.btn-generate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.65);
}

.btn-generate:active:not(:disabled) {
  transform: translateY(0);
}

.btn-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }

  50%,
  100% {
    left: 150%;
  }
}

/* Stats Row */
.stats-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-number {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple-400), var(--pink-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */
.loading-content {
  width: 100%;
  max-width: 500px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

/* Spinner */
.spinner-ring {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent-light);
  animation: spinOuter 1.2s linear infinite;
}

.ring-inner {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom-color: var(--accent-light);
  animation: spinInner 0.9s linear infinite reverse;
}

.ring-icon {
  color: var(--accent-light);
  animation: iconPulse 1.5s ease-in-out infinite;
}

@keyframes spinOuter {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spinInner {
  to {
    transform: rotate(360deg);
  }
}

@keyframes iconPulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(0.9);
  }
}

.loading-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.loading-message {
  font-size: 1rem;
  color: var(--purple-400);
  font-weight: 500;
  min-height: 1.5em;
  transition: opacity 0.3s ease;
}

/* Progress bar */
.progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--purple-600), var(--pink-500));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.6);
}

/* Step List */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  transition: all 0.4s ease;
}

.step-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: all 0.4s ease;
}

/* Active step */
.step-item.active {
  color: var(--text-primary);
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.06);
}

.step-item.active .step-icon {
  border-color: var(--accent);
  color: var(--accent-light);
  animation: stepPulse 1s ease infinite;
}

/* Completed step */
.step-item.done {
  color: var(--green-400);
  border-color: rgba(52, 211, 153, 0.2);
  background: rgba(52, 211, 153, 0.04);
}

.step-item.done .step-icon {
  border-color: var(--green-400);
  color: var(--green-400);
}

@keyframes stepPulse {

  0%,
  100% {
    box-shadow: none;
  }

  50% {
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
  }
}

/* ============================================================
   RESULTS SCREEN
   ============================================================ */
#screen-results {
  align-items: flex-start;
  flex-direction: column;
  gap: 2rem;
}

#screen-results.active {
  display: flex;
}

.results-header {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-title {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.results-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(37, 99, 235, 0.4);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Gallery */
.results-gallery {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: flex-start;
}

/* Video Card */
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  width: calc(20% - 1.2rem);
  /* 5 per row on wide screens */
  min-width: 160px;
  box-shadow: var(--shadow-card);
  animation: cardReveal 0.5s ease forwards;
  opacity: 0;
}

.video-card:hover {
  border-color: rgba(37, 99, 235, 0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), 0 12px 40px rgba(37, 99, 235, 0.2);
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.video-wrapper {
  /* 9:16 aspect ratio */
  position: relative;
  width: 100%;
  padding-bottom: 177.78%;
  background: #000;
  overflow: hidden;
}

.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Virality Score Badge */
.virality-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: help;
  z-index: 12;
  animation: badgePop 0.4s cubic-bezier(.34, 1.56, .64, 1) both;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

@keyframes badgePop {
  from { transform: scale(0.6) translateY(-4px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.vb-icon {
  font-style: normal;
  font-size: 0.85rem;
  line-height: 1;
}

.vb-score {
  font-size: 0.9rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

/* Red tier: 0-40 */
.virality-red {
  background: var(--danger);
}

/* Yellow tier: 41-70 */
.virality-yellow {
  background: var(--warning);
}

/* Green tier: 71-100 */
.virality-green {
  background: var(--success);
}



/* Card loading overlay (shown until video canplay fires) */
.card-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(4px);
  z-index: 5;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card-loading-overlay.hidden {
  opacity: 0;
}

.card-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.card-loading-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

/* Loading overlay while blob is being fetched */
.video-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  z-index: 2;
}

.video-load-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(252, 211, 77, 0.15);
  border-top-color: var(--purple-400);
  animation: spinOuter 0.9s linear infinite;
}

/* Overlay play icon */
.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity var(--transition);
}

.video-card:hover .video-overlay {
  opacity: 1;
}

.play-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.video-card-footer {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.video-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: var(--purple-400);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-download:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(59, 130, 246, 0.2));
  border-color: var(--purple-500);
  color: white;
  transform: translateY(-1px);
}

.btn-edit-clip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-edit-clip:hover {
  border-color: var(--purple-500);
  color: var(--purple-400);
  background: rgba(37, 99, 235, 0.1);
}

.card-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

/* ============================================================
   CLIP EDITOR MODAL
   ============================================================ */
.clip-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.clip-editor-modal[hidden] {
  display: none !important;
}

.clip-editor-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.clip-editor-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-card, #14141f);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.clip-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.clip-editor-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.clip-editor-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.clip-editor-close:hover {
  color: var(--text-primary);
}

.clip-editor-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.clip-editor-preview-wrap {
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 9 / 16;
  max-height: 320px;
  margin: 0 auto;
  width: 100%;
  max-width: 200px;
}

.clip-editor-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.clip-editor-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--purple-400);
}

.clip-editor-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.clip-editor-range {
  width: 100%;
  margin-bottom: 0.75rem;
  accent-color: var(--purple-500);
}

.clip-editor-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.clip-editor-trim-display {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.clip-editor-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 1.25rem 1rem;
}

.btn-editor {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-editor-save {
  background: linear-gradient(135deg, #D97706, #F59E0B);
  border-color: transparent;
  color: #111;
}

.btn-editor-save:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-editor-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-editor-reset,
.btn-editor-cancel {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.btn-editor-reset:hover,
.btn-editor-cancel:hover {
  border-color: var(--purple-500);
  color: var(--text-primary);
}

.clip-editor-status {
  text-align: center;
  font-size: 0.8rem;
  color: var(--purple-400);
  min-height: 1.25rem;
  margin: 0;
  padding: 0 1.25rem 1rem;
}

/* ============================================================
   PLACEHOLDER / PROCESSING CARD
   ============================================================ */
.video-card-placeholder {
  border-color: rgba(37, 99, 235, 0.12);
}

.video-card-placeholder:hover {
  transform: none;
  box-shadow: var(--shadow-card);
  border-color: rgba(37, 99, 235, 0.12);
}

.placeholder-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(160deg, rgba(37, 99, 235, 0.05) 0%, rgba(8, 11, 20, 0.95) 100%);
  overflow: hidden;
}

/* Shimmer sweep */
.placeholder-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.07), transparent);
  animation: shimmer 2.2s ease-in-out infinite;
}

.placeholder-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(37, 99, 235, 0.15);
  border-top-color: var(--purple-400);
  animation: spinOuter 1s linear infinite;
  position: relative;
  z-index: 1;
}

.placeholder-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.btn-download-ghost {
  width: 100%;
  height: 30px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  animation: ghostPulse 2s ease-in-out infinite;
}

@keyframes ghostPulse {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 0.75;
  }
}

/* ============================================================
   ERROR SCREEN
   ============================================================ */
.error-content {
  width: 100%;
  max-width: 480px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.error-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red-400);
}

.error-title {
  font-size: 1.6rem;
  font-weight: 800;
}

.error-message {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.error-content .btn-generate {
  width: auto;
  padding: 0.85rem 2rem;
}

/* ============================================================
   RESULTS STREAMING BADGE
   ============================================================ */
.results-loading-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--purple-400);
}

.badge-mini-spinner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--purple-400);
  animation: spinOuter 0.8s linear infinite;
  flex-shrink: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #000000;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .video-card {
    width: calc(25% - 1.125rem);
  }
}

@media (max-width: 860px) {
  .video-card {
    width: calc(33.33% - 1rem);
  }
}

@media (max-width: 600px) {
  .screen {
    padding: 2rem 1rem;
  }

  .video-card {
    width: calc(50% - 0.75rem);
  }

  .header-badge span:last-child {
    display: none;
  }

  .hero-title {
    font-size: 2rem;
  }

  .results-title {
    font-size: 1.5rem;
  }

  .stats-row {
    gap: 1rem;
  }
}

@media (max-width: 380px) {
  .video-card {
    width: 100%;
    max-width: 260px;
  }

  .results-gallery {
    justify-content: center;
  }
}

/* ============================================================
   UTILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── AI Viral Hooks ──────────────────────────────────────────────────────── */
.viral-hooks-container {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hooks-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--purple-400);
}

.hooks-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hooks-list li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  padding-right: 5rem;
}

.hooks-list li:hover {
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(37, 99, 235, 0.05);
  color: var(--text-primary);
}

.hooks-list li::after {
  content: 'Click to copy';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--purple-400);
  opacity: 0;
  transition: opacity var(--transition);
}

.hooks-list li:hover::after {
  opacity: 1;
}
/* ============================================================
   APP SHELL � SIDEBAR + MAIN LAYOUT
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* -- SIDEBAR -- */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  gap: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.sidebar-logo .logo-icon {
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-logo .logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-logo .logo-subtitle {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* -- NAV ITEMS -- */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  width: 100%;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-light);
  font-weight: 600;
  border-left: 3px solid var(--accent);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  font-size: 1rem;
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

.version-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* -- MAIN CONTENT -- */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3rem;
  overflow-y: auto;
  max-height: 100vh;
}

/* -- PAGE HEADER -- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  font-weight: 400;
}

/* -- TAB PANELS -- */
.tab-panel {
  display: none;
  animation: fadeInUp 0.3s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* -- STUDIO GRID -- */
.studio-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: start;
}

/* -- ELEVATED INPUT CARD -- */
.elevated {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: -0.25rem;
}

/* Aspect Ratio Section */
.aspect-ratio-section {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.aspect-ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.aspect-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  gap: 0.5rem;
  text-align: center;
}

.aspect-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

.aspect-btn.active {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.25), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: var(--text-primary);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.15);
}

/* Ratio Preview Icons */
.aspect-preview {
  border: 2px solid currentColor;
  border-radius: 4px;
  background: transparent;
  transition: all var(--transition);
}

.aspect-preview.vertical {
  width: 14px;
  height: 24px;
}

.aspect-preview.square {
  width: 18px;
  height: 18px;
}

.aspect-preview.horizontal {
  width: 24px;
  height: 14px;
}

.aspect-btn.active .aspect-preview {
  color: var(--purple-400);
}

.aspect-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.aspect-name {
  font-size: 0.82rem;
  font-weight: 700;
}

.aspect-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.aspect-btn.active .aspect-desc {
  color: var(--text-secondary);
}

/* -- OPTIONS GRID -- */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.option-label-hint {
  font-size: 0.75rem;
  cursor: help;
  opacity: 0.55;
  transition: opacity 0.2s;
  text-transform: none;
  letter-spacing: 0;
}
.option-label-hint:hover { opacity: 1; }

/* Toggle Switch (Face Tracking) */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1), background 0.25s;
}

.toggle-switch input:checked ~ .toggle-track {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-color: rgba(37,99,235,0.4);
  box-shadow: 0 0 10px rgba(37,99,235,0.25);
}

.toggle-switch input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(18px);
  background: #fff;
}

.toggle-label-text {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.toggle-switch input:checked ~ .toggle-label-text {
  color: var(--accent-light);
}

.toggle-on-text  { display: none; }
.toggle-off-text { display: inline; }

.toggle-switch input:checked ~ .toggle-label-text .toggle-on-text  { display: inline; }
.toggle-switch input:checked ~ .toggle-label-text .toggle-off-text { display: none; }



/* -- STATS SIDE PANEL -- */
.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-card-mini {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition);
}

.stat-card-mini:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.stat-mini-icon {
  font-size: 1.4rem;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.stat-mini-number {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--purple-400);
  line-height: 1;
}

.stat-mini-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* -- CENTERED SCREENS -- */
.centered-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

/* -- METRICS GRID -- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.metric-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--icon-color, rgba(37, 99, 235, 0.1));
  border: 1px solid var(--icon-border, rgba(37, 99, 235, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-content {
  flex: 1;
  min-width: 0;
}

.metric-value {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  font-weight: 500;
}

.metric-trend {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.5rem;
  color: var(--text-muted);
}

.metric-trend.positive { color: var(--green-400); }

/* -- SPARKLINE -- */
.metric-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 40px;
  margin-top: auto;
  padding-top: 0.5rem;
  align-self: flex-end;
}

.sparkline-bar {
  width: 6px;
  border-radius: 2px;
  background: rgba(252, 211, 77, 0.15);
  transition: all var(--transition);
  min-height: 4px;
}

.sparkline-bar.active {
  background: var(--purple-400);
}

.metric-card:hover .sparkline-bar {
  background: rgba(252, 211, 77, 0.25);
}

.metric-card:hover .sparkline-bar.active {
  background: var(--purple-400);
}

/* -- DASHBOARD TIPS -- */
.dashboard-tips {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem 2rem;
}

.tips-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--purple-400);
  margin-bottom: 1.25rem;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.tip-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.tip-emoji {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1;
}

.tip-text {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.tip-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* -- HISTORY -- */
.history-container {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.history-empty {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}

.history-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.history-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.history-empty-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 1.25rem;
  transition: all var(--transition);
}

.history-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.history-thumb {
  width: 64px;
  height: 40px;
  border-radius: 8px;
  background: rgba(252,211,77,0.08);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
  overflow: hidden;
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
}

.history-info {
  min-width: 0;
}

.history-url {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.history-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.history-clip-count {
  font-size: 0.72rem;
  background: rgba(252,211,77,0.1);
  color: var(--purple-400);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.btn-view-clips {
  background: rgba(252,211,77,0.08);
  border: 1px solid rgba(252,211,77,0.2);
  color: var(--purple-400);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-view-clips:hover {
  background: rgba(252,211,77,0.15);
  border-color: rgba(252,211,77,0.4);
}

/* -- DANGER BTN -- */
.btn-danger {
  border-color: rgba(248, 113, 113, 0.25);
  color: var(--red-400);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.4);
}

/* -- FOOTER -- */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 240px;
  right: 0;
  padding: 0.75rem 3rem;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: #000000;
  pointer-events: none;
  z-index: 10;
}

/* ============================================================
   EXPORT SETTINGS � DROPDOWNS
   ============================================================ */
.export-settings {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 0.25rem;
}

.export-settings-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.export-dropdowns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.export-dropdown-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.export-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.65rem 2.25rem 0.65rem 0.9rem;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.export-select:hover {
  border-color: var(--border-hover);
}

.export-select:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.1);
}

/* Style dropdown options (works best on Firefox; Chrome uses native) */
.export-select option {
  background: #1a1a12;
  color: var(--text-primary);
  padding: 0.5rem;
}

.select-arrow {
  position: absolute;
  right: 0.75rem;
  pointer-events: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.select-wrapper:hover .select-arrow,
.export-select:focus ~ .select-arrow {
  color: var(--purple-400);
}

/* ============================================================
   CAPTION STYLING SECTION
   ============================================================ */
.caption-styling-section {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.caption-styling-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
}

.caption-styling-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.btn-customize {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-customize:hover {
  border-color: var(--border-hover);
  color: var(--purple-400);
  background: rgba(252, 211, 77, 0.06);
}

/* -- CARDS ROW -- */
.style-cards-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.6rem;
}

.style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--transition);
  overflow: hidden;
  position: relative;
}

.style-card:hover {
  border-color: rgba(252, 211, 77, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}

.style-card.active {
  border-color: var(--purple-400);
  box-shadow: 0 0 0 2px rgba(252, 211, 77, 0.2), 0 6px 24px rgba(252,211,77,0.1);
}

/* Active checkmark badge */
.style-card.active::after {
  content: "?";
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 0.55rem;
  font-weight: 900;
  color: var(--bg-base);
  background: var(--purple-400);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 14px;
  text-align: center;
}

/* -- PREVIEW BOX -- */
.style-preview {
  width: 100%;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  overflow: hidden;
}

.style-card-name {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 0.45rem;
}

.style-card.active .style-card-name {
  color: var(--purple-400);
}

/* -- SHARED WORD STYLES -- */
.sp-word {
  display: block;
  line-height: 1;
  text-align: center;
}

/* -- CARD 1: MrBeast -- */
.mrbeast-preview {
  background: #0b0b0b;
}
.sp-yellow {
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: 1rem;
  font-weight: 900;
  color: #38BDF8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  -webkit-text-stroke: 1px #000;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000;
}
.sp-white {
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: 0.9rem;
  font-weight: 900;
  color: #FFFFFF;
  text-transform: uppercase;
  -webkit-text-stroke: 1px #000;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000;
}

/* -- CARD 2: Hormozi -- */
.hormozi-preview {
  background: linear-gradient(135deg, #1a0a2e 0%, #0d0d0d 100%);
}
.sp-purple {
  font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
  font-size: 0.8rem;
  font-weight: 900;
  color: #c084fc;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.hormozi-pop {
  font-size: 1rem;
  background: linear-gradient(90deg, #38BDF8 0%, #2563EB 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: hormoziPulse 1.4s ease-in-out infinite alternate;
}
@keyframes hormoziPulse {
  from { transform: scale(1);   opacity: 0.9; }
  to   { transform: scale(1.06); opacity: 1;   }
}

/* -- CARD 3: Gary Vee -- */
.garyvee-preview {
  background: #111;
}
.gv-stamp {
  font-family: 'Arial Black', 'Impact', sans-serif;
  font-size: 0.95rem;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.95;
}
.sp-orange {
  font-family: 'Arial Black', sans-serif;
  font-size: 0.75rem;
  font-weight: 900;
  color: #fb923c;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 2px solid #fb923c;
}

/* -- CARD 4: Logan Paul -- */
.loganpaul-preview {
  background: linear-gradient(180deg, #0f172a 0%, #0a0a0a 100%);
}
.lp-text {
  font-family: 'Roboto', 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lp-glow {
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.8), 0 0 20px rgba(56, 189, 248, 0.4);
}

/* -- CARD 5: Minimalist -- */
.minimal-preview {
  background: rgba(255,255,255,0.04);
}
.min-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}
.min-soft {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

/* -- CARD 6: TikTok Pop -- */
.tiktok-preview {
  background: linear-gradient(135deg, #0f0f0f 0%, #1a0a0f 100%);
}
.tt-pop {
  font-family: 'Arial Black', sans-serif;
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ff2d55, #ff6b35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  letter-spacing: 0.03em;
  animation: ttFlicker 2s steps(1) infinite;
}
.tt-scale {
  background: linear-gradient(90deg, #00d2ff, #2563EB);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transform: scale(1.1);
  display: block;
}
@keyframes ttFlicker {
  0%, 90%, 100% { opacity: 1; }
  95%           { opacity: 0.7; }
}

/* -- CARD 7: Netflix -- */
.netflix-preview {
  background: #141414;
}
.nf-text {
  font-family: 'Arial', sans-serif;
  font-weight: bold;
  font-size: 10px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.75);
  padding: 4px 8px;
  border-radius: 2px;
  letter-spacing: 0.02em;
}

/* -- CARD 8: Neon -- */
.neon-preview {
  background: #050505;
}
.ne-text {
  font-family: 'Arial Black', sans-serif;
  font-weight: 900;
  font-size: 12px;
  color: #00FFFF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 0 4px #00FFFF, 0 0 10px #FF00FF, 0 0 20px #00FFFF;
  animation: neonGlow 1.5s ease-in-out infinite alternate;
}
@keyframes neonGlow {
  from {
    text-shadow: 0 0 4px #00FFFF, 0 0 10px #FF00FF, 0 0 20px #00FFFF;
  }
  to {
    text-shadow: 0 0 6px #00FFFF, 0 0 14px #FF00FF, 0 0 25px #00FFFF, 0 0 30px #FF00FF;
  }
}

/* -- CARD 9: Shadow Box -- */
.shadowbox-preview {
  background: #111;
}
.sb-text {
  font-family: 'Arial', sans-serif;
  font-weight: bold;
  font-size: 11px;
  color: #ffffff;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 3px 6px;
  border-radius: 3px;
}

/* -- CARD 10: Gradient -- */
.gradient-preview {
  background: #0a0a0c;
  display: flex;
  gap: 2px;
  align-items: center;
}
.gradient-preview span {
  font-family: 'Arial Black', sans-serif;
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
}
.gr-w1 { color: #FF6B6B; }
.gr-w2 { color: #FFE66D; }
.gr-w3 { color: #4ECDC4; }

/* -- CARD 11: Bold Pop -- */
.boldpop-preview {
  background: #080808;
}
.bp-text {
  font-family: 'Arial Black', 'Impact', sans-serif;
  font-weight: 900;
  font-size: 15px;
  color: #FFD700;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1.5px 1.5px 0 #000;
  animation: bpPop 1s ease-in-out infinite alternate;
}
@keyframes bpPop {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

/* -- CARD 12: Anime -- */
.anime-preview {
  background: #030303;
}
.an-text {
  font-family: 'Arial Black', sans-serif;
  font-weight: 900;
  font-size: 10px;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 1.5px 1.5px 0 #000, -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000;
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 6px;
  letter-spacing: 0.05em;
}

/* ============================================================
   BRAND KIT
   ============================================================ */
.brandkit-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.bk-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition);
}

.bk-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.bk-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bk-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: opacity 0.3s ease;
}

.disabled-overlay {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(100%);
}

.bk-flex-row {
  display: flex;
  gap: 1rem;
}

.file-input {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-input);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color var(--transition);
}

.file-input:hover {
  border-color: var(--accent-light);
}

.bk-preview-box {
  margin-top: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.color-picker-wrapper input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
}

.color-hex {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.bk-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
}


/* ==========================================================================
   NEW ANALYTICS DASHBOARD STYLES
   ========================================================================== */

.dashboard-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-icon {
  font-size: 1.2rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* -- RECENT ACTIVITY -- */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-hover);
}

.activity-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.activity-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.activity-info {
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.activity-dot {
  width: 3px;
  height: 3px;
  background: currentColor;
  border-radius: 50%;
  opacity: 0.5;
}

.activity-score {
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
}

.activity-score.high { color: var(--green-400); }
.activity-score.medium { color: var(--warning); }
.activity-score.low { color: var(--red-400); }

.activity-actions {
  flex-shrink: 0;
}

.activity-actions .btn-view-clips {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.activity-actions .btn-view-clips:hover {
  background: var(--border-hover);
  color: var(--text-primary);
}

/* -- CHART STYLES -- */
.chart-container {
  padding-top: 0.5rem;
}

.chart-bars {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 150px;
  gap: 0.5rem;
}

.chart-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.chart-bar-value {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chart-bar-wrapper:hover .chart-bar-value {
  opacity: 1;
}

.chart-bar {
  width: 100%;
  max-width: 20px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-light) 100%);
  border-radius: 4px 4px 0 0;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 2px;
}

.chart-bar-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* -- TOP PERFORMING CLIPS -- */
.top-clips-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.top-clip-card {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  align-items: center;
}

.top-clip-video-container {
  width: 90px;
  height: 60px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  background: var(--bg-input);
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.05);
}

.top-clip-video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-clip-details {
  flex: 1;
  min-width: 0;
}

.top-clip-title {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-clip-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0.25rem;
}

.top-clip-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.top-clip-badge.high { background: rgba(52,211,153,0.1); color: var(--green-400); border: 1px solid rgba(52,211,153,0.2); }
.top-clip-badge.medium { background: rgba(245,158,11,0.1); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.top-clip-badge.low { background: rgba(239,68,68,0.1); color: var(--red-400); border: 1px solid rgba(239,68,68,0.2); }

.top-clip-score {
  font-weight: 900;
}

.top-clip-hook {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.top-clip-download-btn {
  background: var(--purple-600);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.top-clip-download-btn:hover {
  background: var(--purple-500);
  transform: scale(1.08);
}

/* -- STORAGE & CLEANUP -- */
.storage-info-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.storage-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.storage-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.storage-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-clear-storage {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--red-400);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-clear-storage:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: var(--red-400);
  color: #fff;
}

/* -- EMPTY STATE -- */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.01);
}

/* ============================================================
   EZCLIPPER MODERN SAAS CARD & STUDIO STYLES
   ============================================================ */
.studio-container {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.centered-header {
  text-align: center;
  margin-bottom: 2rem;
}

.centered-header .page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.centered-header .page-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
}

.studio-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: all 0.2s ease;
}

.studio-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Video Source Tab Pills */
.source-tabs-pill {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
}

.source-tabs-pill .source-tab {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.source-tabs-pill .source-tab.active {
  background: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Premium YouTube URL Input Wrapper */
.input-wrapper-saas {
  height: 52px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.75rem;
  transition: all var(--transition);
}

.input-wrapper-saas:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-blue);
}

.input-wrapper-saas input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
}

.input-wrapper-saas input::placeholder {
  color: var(--text-muted);
}

.yt-red-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Upload zone */
.upload-zone-saas {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.upload-zone-saas:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.upload-icon-saas {
  font-size: 2rem;
}

.upload-text-saas {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-subtext-saas {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.upload-warning-saas {
  font-size: 0.75rem;
  color: var(--danger);
}

/* Clip settings grid */
.clip-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .clip-settings-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.settings-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Ratio buttons */
.ratio-options-saas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.ratio-options-saas .aspect-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 8px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  color: var(--text-secondary);
  transition: all var(--transition);
  font-family: inherit;
}

.ratio-options-saas .aspect-btn .ratio-checkmark {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.65rem;
  background: var(--accent);
  color: white;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.ratio-options-saas .aspect-btn.active {
  border: 2px solid var(--accent);
  background: rgba(37, 99, 235, 0.1);
  color: var(--text-primary);
}

.ratio-options-saas .aspect-btn.active .ratio-checkmark {
  display: flex;
}

.ratio-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.ratio-name {
  font-size: 0.85rem, font-weight: 700;
}

.ratio-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Duration pills */
.duration-toggle-saas {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.duration-toggle-saas input {
  display: none;
}

.duration-toggle-saas .duration-pill {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.duration-toggle-saas input:checked + .duration-pill {
  background: var(--accent);
  color: var(--text-primary);
}

/* Crop & CC toggles */
.toggle-pills-saas {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.toggle-pills-saas input {
  display: none;
}

.toggle-pills-saas .toggle-pill {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.toggle-pills-saas input:checked + .toggle-pill {
  background: var(--accent);
  color: var(--text-primary);
}

/* Custom Dropdown select */
.select-wrapper-saas {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrapper-saas .dropdown-saas {
  width: 100%;
  height: 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 0 1rem;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.875rem;
  font-family: inherit;
}

.select-wrapper-saas .dropdown-saas:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-blue);
}

.select-wrapper-saas .select-arrow-saas {
  position: absolute;
  right: 12px;
  font-size: 0.75rem;
  color: var(--accent-light);
  pointer-events: none;
}

/* Number of clips stepper */
.clip-stepper-saas {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.stepper-btn-saas {
  background: transparent;
  border: none;
  color: var(--accent-light);
  font-size: 1.25rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.stepper-btn-saas:hover {
  color: var(--text-primary);
}

.clips-default-saas {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* AI Features toggle switch rows */
.ai-features-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.ai-feature-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  width: 100%;
}

.ai-feature-row-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.feature-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.feature-icon {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
}

.feature-text {
  display: flex;
  flex-direction: column;
}

.feature-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.feature-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Modern Toggle Switch style */
.saas-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.saas-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.saas-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #374151;
  border-radius: 24px;
  transition: 0.3s;
}

.saas-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.saas-switch input:checked + .saas-slider {
  background-color: var(--accent);
}

.saas-switch input:checked + .saas-slider:before {
  transform: translateX(20px);
}

/* Caption Styles cards */
.btn-customize-saas {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-customize-saas:hover {
  border-color: var(--accent-light);
  color: var(--text-primary);
}

.caption-styles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-bottom: 0.5rem;
}

.caption-style-card {
  background: #111E35;
  border: 1px solid #1E3050;
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  color: var(--text-secondary);
  font-family: inherit;
  width: 100%;
  min-height: 110px;
  outline: none;
}

.caption-style-card:hover {
  border-color: #3B82F6;
  transform: translateY(-2px);
}

.caption-style-card.selected {
  border: 2px solid #2563EB;
  background: rgba(37, 99, 235, 0.1);
  color: var(--text-primary);
  transform: scale(1.02);
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.2);
}

.caption-style-card .style-preview {
  height: 70px;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.caption-style-card .style-card-name {
  background: #0D1526;
  padding: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94A3B8;
  text-align: center;
  border-top: 1px solid #1E3050;
  width: 100%;
}

.caption-style-card .style-checkmark {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.75rem;
  background: #2563EB;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
}

.caption-style-card.selected .style-checkmark {
  display: flex;
}

/* Full Width Generate Button */
.btn-generate-saas {
  width: 100%;
  height: 56px;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  border-radius: 14px;
  border: none;
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
  font-family: inherit;
}

.btn-generate-saas:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.btn-generate-saas:active {
  transform: translateY(0);
}

/* ── B-Roll Page Styles ── */
.broll-info-box-blue {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid #3B82F6;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 24px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.broll-layout {
  display: grid;
  grid-template-columns: 40% calc(60% - 24px);
  gap: 24px;
  align-items: start;
}

.broll-left-col {
  overflow-y: auto;
  max-height: 90vh;
  padding-right: 8px;
}

.broll-left-col::-webkit-scrollbar {
  width: 6px;
}
.broll-left-col::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.broll-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.broll-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.broll-section-content.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.broll-radio-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.broll-radio-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  user-select: none;
}

.broll-radio-card input[type="radio"] {
  display: none;
}

.broll-radio-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.broll-radio-card.active {
  border: 2px solid var(--accent);
  background: rgba(37,99,235,0.1);
}

.broll-radio-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.broll-radio-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.broll-radio-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.broll-radio-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.broll-actions-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 24px;
}

.broll-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.broll-btn-filled {
  background: var(--accent);
  color: #ffffff;
}
.broll-btn-filled:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.broll-btn-outline {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent-light);
}
.broll-btn-outline:hover {
  background: rgba(37,99,235,0.08);
  transform: translateY(-1px);
}

.broll-btn-text {
  background: transparent;
  color: var(--text-muted);
}
.broll-btn-text:hover {
  color: var(--text-secondary);
}

.broll-preview-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.broll-video-wrap {
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 65vh;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.broll-video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.broll-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.broll-step {
  display: flex;
  align-items: center;
  gap: 12px;
}

.broll-step-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.broll-step-icon.pending {
  background: #374151;
}

.broll-step-icon.active {
  background: #3B82F6;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  animation: broll-spin 0.8s linear infinite;
  border-radius: 50%;
}

.broll-step-icon.done {
  background: #10B981;
}
.broll-step-icon.done::after {
  content: '✓';
  color: #fff;
  font-size: 11px;
  font-weight: bold;
}

.broll-step-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.broll-step.active .broll-step-text {
  color: var(--text-primary);
  font-weight: 500;
}

.broll-step.done .broll-step-text {
  color: var(--green-400);
}

@keyframes broll-spin {
  to { transform: rotate(360deg); }
}

.broll-results-box {
  background: rgba(16,185,129,0.1);
  border: 1px solid #10B981;
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
}

.broll-results-title {
  font-size: 1rem;
  font-weight: 700;
  color: #10B981;
  margin-bottom: 8px;
}

.broll-results-stats {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* B-Roll Selection Mode Tabs */
.broll-tabs-container {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.broll-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}

.broll-tab-btn:hover {
  color: var(--text-primary);
}

.broll-tab-btn.active {
  background: var(--accent);
  color: white;
}

/* Clip cards grid (multiple mode) */
.broll-cards-grid-multiple {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.broll-cards-grid-multiple::-webkit-scrollbar {
  width: 4px;
}
.broll-cards-grid-multiple::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.broll-clip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.broll-clip-card:hover {
  border-color: var(--border-hover);
}

.broll-clip-card.selected {
  border: 2px solid var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.broll-clip-card.processing {
  border: 2px solid var(--accent);
  animation: brollPulse 1.5s infinite;
}

.broll-clip-card.done {
  border: 2px solid var(--success);
  opacity: 0.85;
}

.broll-clip-card.failed {
  border: 2px solid var(--danger);
}

@keyframes brollPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* Checkbox style inside card */
.broll-clip-card .broll-card-checkbox {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  cursor: pointer;
  z-index: 10;
  accent-color: var(--accent);
}

/* All Clips mode grid */
.broll-thumbnails-grid-all {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
  margin-top: 8px;
}
.broll-thumbnail-item-all {
  position: relative;
  width: 100%;
  padding-bottom: 120%;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.broll-thumbnail-item-all video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.broll-thumbnail-item-all .broll-thumb-label {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 8px;
  padding: 1px 2px;
  border-radius: 2px;
  text-align: center;
}

.broll-card-video-container {
  position: relative;
  width: 100%;
  padding-bottom: 120%;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.broll-card-video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.broll-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.broll-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.broll-card-hook {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.virality-badge-mini {
  align-self: flex-start;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
}
.virality-badge-mini.high {
  background: rgba(52,211,153,0.1);
  color: var(--green-400);
  border: 1px solid rgba(52,211,153,0.2);
}
.virality-badge-mini.medium {
  background: rgba(245,158,11,0.1);
  color: var(--warning);
  border: 1px solid rgba(245,158,11,0.2);
}
.virality-badge-mini.low {
  background: rgba(239,68,68,0.1);
  color: var(--red-400);
  border: 1px solid rgba(239,68,68,0.2);
}

.broll-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.broll-progress-row:last-child {
  border-bottom: none;
}

.broll-progress-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.broll-progress-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.broll-progress-status-text {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Status Icons */
.broll-status-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  flex-shrink: 0;
}

.broll-status-icon.pending {
  background: #374151;
  border: 2px solid var(--border);
}

.broll-status-icon.processing {
  border: 2px solid var(--accent);
  border-top-color: transparent;
  animation: brollSpin 0.8s linear infinite;
  border-radius: 50%;
}

.broll-status-icon.done {
  background: var(--success);
  color: white;
  font-size: 11px;
}
.broll-status-icon.done::after {
  content: '✓';
}

.broll-status-icon.failed {
  background: var(--danger);
  color: white;
  font-size: 11px;
}
.broll-status-icon.failed::after {
  content: '✕';
}

@keyframes brollSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Small button styling */
.broll-btn-small {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}
.broll-btn-small:hover {
  background: var(--border);
}

/* ============================================================
   TEMPLATES - Studio Page
   ============================================================ */
.template-cards-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.template-cards-row::-webkit-scrollbar { height: 4px; }
.template-cards-row::-webkit-scrollbar-track { background: transparent; }
.template-cards-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.template-card {
  flex-shrink: 0;
  min-width: 88px;
  max-width: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.template-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-light);
  background: var(--bg-card-hover);
  box-shadow: 0 6px 20px rgba(37,99,235,0.2);
}
.template-card.selected {
  border: 2px solid var(--accent);
  background: rgba(37,99,235,0.12);
  box-shadow: 0 0 0 1px rgba(37,99,235,0.3), 0 6px 20px rgba(37,99,235,0.2);
}
.template-checkmark {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 11px;
  color: var(--accent-light);
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s;
}
.template-card.selected .template-checkmark { opacity: 1; }
.template-emoji { font-size: 24px; line-height: 1; margin-bottom: 2px; }
.template-name { font-size: 11px; font-weight: 600; color: var(--text-primary); text-align: center; line-height: 1.2; }

.template-card-custom { border-style: dashed; border-color: rgba(37,99,235,0.4); }

.template-card.custom-template .custom-badge {
  position: absolute;
  top: 4px;
  left: 5px;
  font-size: 9px;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 1px 5px;
  border-radius: 4px;
}

.my-templates-dropdown {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
  padding: 12px;
  animation: fadeSlideDown 0.2s ease;
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.my-templates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.my-template-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}
.my-template-item:hover { border-color: var(--accent-light); }
.my-template-info { flex: 1; min-width: 0; }
.my-template-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-template-details { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.my-template-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-tpl-apply { padding: 4px 10px; font-size: 11px; border-radius: 6px; border: 1px solid var(--accent); background: rgba(37,99,235,0.15); color: var(--accent-light); cursor: pointer; font-family: inherit; font-weight: 600; transition: all 0.2s; }
.btn-tpl-apply:hover { background: rgba(37,99,235,0.3); }
.btn-tpl-delete { padding: 4px 8px; font-size: 11px; border-radius: 6px; border: 1px solid rgba(239,68,68,0.3); background: rgba(239,68,68,0.08); color: #f87171; cursor: pointer; font-family: inherit; transition: all 0.2s; }
.btn-tpl-delete:hover { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.5); }
.my-templates-empty { text-align: center; color: var(--text-secondary); font-size: 12px; padding: 12px; line-height: 1.6; }

/* ============================================================
   FILTERS - Studio & Clip Editor
   ============================================================ */
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.editor-filter-pills { gap: 6px; }
.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.filter-btn:hover { border-color: var(--accent-light); color: var(--text-primary); background: rgba(37,99,235,0.1); }
.filter-btn.active { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 2px 8px rgba(37,99,235,0.4); }

/* ============================================================
   BRAND KIT - My Templates Section
   ============================================================ */
.bk-save-template-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 2px solid var(--accent);
  border-radius: 10px;
  color: var(--accent-light);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.bk-save-template-btn:hover { background: rgba(37,99,235,0.12); box-shadow: 0 0 16px rgba(37,99,235,0.2); }
.bk-saved-templates-list { display: flex; flex-direction: column; gap: 10px; }
.bk-template-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; transition: border-color 0.2s; }
.bk-template-card:hover { border-color: var(--accent-light); }
.bk-template-card-info { flex: 1; min-width: 0; }
.bk-template-card-name { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.bk-template-card-details { font-size: 12px; color: var(--text-secondary); }
.bk-template-card-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-bk-apply { padding: 6px 12px; font-size: 12px; border-radius: 8px; border: 1px solid var(--accent); background: rgba(37,99,235,0.15); color: var(--accent-light); cursor: pointer; font-family: inherit; font-weight: 600; transition: all 0.2s; }
.btn-bk-apply:hover { background: rgba(37,99,235,0.3); }
.btn-bk-delete { padding: 6px 10px; font-size: 12px; border-radius: 8px; border: 1px solid rgba(239,68,68,0.3); background: rgba(239,68,68,0.08); color: #f87171; cursor: pointer; font-family: inherit; transition: all 0.2s; }
.btn-bk-delete:hover { background: rgba(239,68,68,0.2); }
.bk-templates-empty { text-align: center; color: var(--text-secondary); font-size: 13px; padding: 20px; line-height: 1.7; background: var(--bg-secondary); border: 1px dashed var(--border); border-radius: 10px; }

/* ============================================================
   TEMPLATE SAVE MODAL
   ============================================================ */
.template-save-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: backdropFadeIn 0.15s ease;
}
@keyframes backdropFadeIn { from { opacity:0; } to { opacity:1; } }
.template-save-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: modalSlideUp 0.2s ease;
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.template-save-modal h3 { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }
.template-save-modal input { width: 100%; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; color: var(--text-primary); font-family: inherit; font-size: 14px; outline: none; margin-bottom: 14px; transition: border-color 0.2s; }
.template-save-modal input:focus { border-color: var(--accent); }
.template-save-modal-btns { display: flex; gap: 10px; }
.btn-tpl-save { flex: 1; padding: 10px; border-radius: 10px; border: none; background: linear-gradient(135deg, var(--accent) 0%, #3b82f6 100%); color: white; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; transition: all 0.2s; }
.btn-tpl-save:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-tpl-cancel { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); font-size: 14px; font-family: inherit; cursor: pointer; transition: all 0.2s; }
.btn-tpl-cancel:hover { background: var(--bg-secondary); }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.ez-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}
.ez-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

