/* ==========================================================================
   Long Video to Short Video - AI Clip Maker & Viral Shorts Generator
   Production Stylesheet - High Performance, Dark/Light Mode, Mobile Responsive
   ========================================================================== */

:root {
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Light Theme Colors */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-secondary: #f1f5f9;
  --bg-input: #ffffff;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #6366f1;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-inverse: #ffffff;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.1);
  --primary-glow: rgba(99, 102, 241, 0.25);

  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;

  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
  --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  --gradient-surface: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(241,245,249,0.8) 100%);
  --gradient-card: linear-gradient(145deg, #ffffff, #f8fafc);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(99,102,241,0.15) 0%, transparent 70%);

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  --header-height: 72px;
  --max-width: 1280px;
}

[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-surface: #111827;
  --bg-surface-elevated: #1a2234;
  --bg-surface-secondary: #1e293b;
  --bg-input: #0f172a;
  --border-subtle: #1e293b;
  --border-strong: #334155;
  --border-focus: #818cf8;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-inverse: #0f172a;

  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-light: rgba(99, 102, 241, 0.18);
  --primary-glow: rgba(99, 102, 241, 0.4);

  --gradient-surface: linear-gradient(180deg, rgba(26,34,52,0.8) 0%, rgba(17,24,39,0.8) 100%);
  --gradient-card: linear-gradient(145deg, #131d2e, #0d1522);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(99,102,241,0.22) 0%, transparent 70%);

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.5), 0 1px 2px -1px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -2px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7), 0 4px 6px -4px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.8), 0 8px 10px -6px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.45);
}

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

html {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* Accessible Focus States */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 768px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Gradient Background Glow */
.ambient-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 1400px;
  height: 600px;
  background: var(--gradient-glow);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.88);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-main);
  text-decoration: none;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.logo-text span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 992px) {
  .nav-desktop {
    display: flex;
  }
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  background-color: var(--primary-light);
}

.nav-link svg.arrow-icon {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.nav-item:hover .nav-link svg.arrow-icon {
  transform: rotate(180deg);
}

/* Multi-column Mega Dropdown - STRICT RULE: top: 100%; */
.mega-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 780px;
  max-width: 90vw;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--transition-normal);
  z-index: 1050;
}

.nav-item:hover .mega-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mega-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.mega-dropdown-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mega-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.mega-col-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.mega-link-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mega-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.mega-link:hover {
  color: var(--primary);
  background-color: var(--primary-light);
  transform: translateX(3px);
}

.mega-link svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
  transform: scale(1.05);
}

.theme-toggle-btn .icon-sun {
  display: none;
}

.theme-toggle-btn .icon-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle-btn .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle-btn .icon-moon {
  display: none;
}

.btn-header-cta {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: all var(--transition-normal);
}

@media (min-width: 640px) {
  .btn-header-cta {
    display: inline-flex;
  }
}

.btn-header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}

.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

@media (min-width: 992px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xl);
  z-index: 2000;
  padding: 1.5rem;
  overflow-y: auto;
  transition: right var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.mobile-nav-drawer.active {
  right: 0;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.mobile-nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.breadcrumb-nav {
  padding: 1rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb-item a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  color: var(--text-subtle);
  font-size: 0.75rem;
}

.breadcrumb-item.active {
  color: var(--text-main);
  font-weight: 600;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  position: relative;
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.hero-title .gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.18rem);
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 1.75rem;
  line-height: 1.6;
}

.hero-highlights {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero-highlight-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.hero-highlight-item svg {
  color: var(--accent-emerald);
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Main App: Long Video to Short Video Studio
   ========================================================================== */
.studio-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  margin-bottom: 3rem;
  position: relative;
}

/* Upload State / Initial Dropzone */
.dropzone-area {
  padding: 3.5rem 1.5rem;
  text-align: center;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--bg-surface-secondary);
  transition: all var(--transition-normal);
  cursor: pointer;
  margin: 1.5rem;
}

.dropzone-area.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.01);
}

.dropzone-icon-box {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
  animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: translateY(0); box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35); }
  100% { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(236, 72, 153, 0.45); }
}

.dropzone-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.dropzone-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.dropzone-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.sample-prompts {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.sample-pill {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sample-pill:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Studio Main Editor (Hidden until video loaded) */
.studio-editor {
  display: none;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
}

@media (min-width: 1024px) {
  .studio-editor {
    grid-template-columns: 420px 1fr;
    gap: 2rem;
  }
}

@media (min-width: 1200px) {
  .studio-editor {
    grid-template-columns: 460px 1fr;
  }
}

.studio-editor.active {
  display: grid;
}

/* Left Column: Mobile Phone Frame Preview */
.preview-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.phone-mockup {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 9 / 16;
  background: #000000;
  border-radius: 36px;
  border: 10px solid #1e293b;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 18px;
  background: #1e293b;
  border-radius: var(--radius-full);
  z-index: 20;
}

.phone-canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000000;
}

#previewCanvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay Elements on Phone Preview */
.phone-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1rem 1rem;
  z-index: 10;
}

.phone-header-hook {
  text-align: center;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0.5rem auto 0;
  max-width: 90%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.phone-captions-box {
  position: absolute;
  bottom: 22%;
  left: 5%;
  right: 5%;
  text-align: center;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--gradient-primary);
  width: 0%;
  transition: width 0.1s linear;
}

/* Social UI Simulators */
.phone-social-icons {
  position: absolute;
  right: 10px;
  bottom: 60px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  opacity: 0.8;
}

.social-icon-pill {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.75rem;
}

.playback-controls {
  width: 100%;
  max-width: 320px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
}

.btn-ctrl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  transition: background-color var(--transition-fast);
}

.btn-ctrl:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.time-display {
  font-size: 0.8125rem;
  font-family: monospace;
  font-weight: 600;
  color: var(--text-muted);
}

/* Right Column: Controls & AI Viral Clips Selector */
.controls-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Tabs Navigation */
.studio-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-secondary);
}

.tab-btn.active {
  color: var(--primary);
  background: var(--primary-light);
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.tab-content.active {
  display: flex;
}

/* AI Viral Clips Grid */
.clips-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .clips-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.clip-card {
  position: relative;
  background: var(--bg-surface-secondary);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.clip-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.clip-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary);
}

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

.viral-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.viral-score-badge.high {
  background: rgba(236, 72, 153, 0.15);
  color: var(--accent-pink);
  border-color: rgba(236, 72, 153, 0.3);
}

.clip-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.3;
}

.clip-timestamps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.clip-tag {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
}

/* Timeline & Waveform Editor */
.timeline-card {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.waveform-canvas-wrap {
  position: relative;
  width: 100%;
  height: 70px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-bottom: 1rem;
}

#waveformCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.trim-handles-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.trim-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  flex: 1;
}

.trim-input-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.trim-input-group input {
  width: 100%;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Control Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .options-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.select-custom, .input-custom {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast);
}

.select-custom:focus, .input-custom:focus {
  border-color: var(--border-focus);
}

/* Subtitle Preset Selectors */
.subtitle-styles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .subtitle-styles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.sub-style-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 0.5rem;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  gap: 0.35rem;
}

.sub-style-btn:hover {
  border-color: var(--primary);
}

.sub-style-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.sub-style-preview {
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.sub-style-name {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Export & Action Buttons Toolbar */
.studio-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.action-group-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.action-group-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-export-all {
  background: var(--gradient-accent);
}

/* Rendering Progress Overlay Modal */
.render-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.render-modal.active {
  opacity: 1;
  visibility: visible;
}

.render-modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.render-spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid var(--border-subtle);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}

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

.render-progress-bar-wrap {
  width: 100%;
  height: 10px;
  background: var(--bg-surface-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 1.25rem 0 0.5rem;
}

.render-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-primary);
  transition: width 0.15s ease-out;
}

/* ==========================================================================
   Tools Bar (Before Feature Section - Strict 15 links, No scroll)
   ========================================================================== */
.quick-tools-section {
  padding: 2.5rem 0;
  background: var(--bg-surface-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4rem;
}

.quick-tools-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.quick-tools-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.quick-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .quick-tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .quick-tools-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.quick-tool-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.quick-tool-card:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.quick-tool-card svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--primary);
}

/* ==========================================================================
   Features Section
   ========================================================================== */
.features-section {
  padding: 3rem 0;
  margin-bottom: 4rem;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 0.85rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.feature-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.feature-desc {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   How It Works Section
   ========================================================================== */
.how-it-works-section {
  padding: 3rem 0;
  background: var(--bg-surface-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.step-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.step-desc {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   SEO Informational Editorial Paragraph (450-500 words)
   ========================================================================== */
.editorial-section {
  padding: 3rem 0;
  margin-bottom: 4rem;
}

.editorial-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-md);
}

.editorial-content {
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.75;
}

.editorial-content h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.editorial-content h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-main);
}

.editorial-content p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.editorial-content strong {
  color: var(--text-main);
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */
.faq-section {
  padding: 3rem 0;
  margin-bottom: 4rem;
}

.faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

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

.faq-question-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  background: none;
  cursor: pointer;
}

.faq-icon {
  width: 20px;
  height: 20px;
  color: var(--primary);
  transition: transform var(--transition-normal);
  flex-shrink: 0;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) ease-out, padding var(--transition-normal);
  padding: 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.faq-item.active .faq-answer {
  padding-bottom: 1.25rem;
}

/* ==========================================================================
   CTA Section
   ========================================================================== */
.cta-section {
  padding: 4rem 0;
  margin-bottom: 4rem;
}

.cta-card {
  position: relative;
  background: var(--gradient-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 3.5rem 2rem;
  text-align: center;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.cta-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.cta-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 620px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.85rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-cta-primary {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-cta-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
}

.btn-cta-secondary:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3.5rem;
}

@media (min-width: 640px) {
  .footer-top-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-top-grid {
    grid-template-columns: 1.5fr repeat(4, 1fr);
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-desc {
  line-height: 1.6;
  max-width: 320px;
}

.footer-col-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-link {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--primary);
}

.footer-trademark {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-subtle);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.5rem;
  font-size: 0.8125rem;
}

.footer-legal-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* ==========================================================================
   Cookie Banner
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  width: 92%;
  max-width: 580px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-xl);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  transition: transform var(--transition-smooth);
}

.cookie-banner.show {
  transform: translateX(-50%) translateY(0);
}

.cookie-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cookie-text a {
  color: var(--primary);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-cookie-accept {
  padding: 0.45rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--primary);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.btn-cookie-accept:hover {
  background: var(--primary-hover);
}

.btn-cookie-dismiss {
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-cookie-dismiss:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.25rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideInRight 0.3s ease-out;
  pointer-events: auto;
}

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