/* ==========================================================================
   OmniDownloader - Obsidian Studio Design System
   Crafted with human-first UI/UX principles (Inspired by Linear, Raycast & Vercel)
   ========================================================================== */

:root {
  /* Neutral Obsidian Studio Palette (No loud AI purple tints) */
  --bg-canvas: #090a0f;
  --bg-subtle: #0f1118;
  --bg-surface: #141622;
  --bg-surface-hover: #1c1f2e;
  --bg-surface-active: #24273a;
  --bg-glass: rgba(20, 22, 34, 0.75);

  /* Hairline Precision Borders */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(255, 255, 255, 0.28);
  --border-active-accent: #3b82f6;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* Text Hierarchy */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-disabled: #475569;

  /* Restrained Accents */
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-blue-glow: rgba(59, 130, 246, 0.25);
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.8);
  --shadow-command: 0 16px 48px -12px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08);

  /* Micro Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.08), transparent 70%),
    radial-gradient(circle at 100% 100%, rgba(20, 22, 34, 0.5), transparent 40%);
  background-attachment: fixed;
}

/* Hairline Grid Overlay */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
}

.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 10, 15, 0.85);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(180deg, #1f2233 0%, #12141f 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f8fafc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.brand-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   FAQ Section Styles
   ========================================================================== */
.seo-content-section {
  margin: 4.5rem 0 3.5rem;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .faq-grid {
    grid-template-columns: 1fr;
  }
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.35rem;
  transition: border-color 0.15s ease;
}

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

.faq-question {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.faq-answer {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-version {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-tertiary);
  margin-left: 0.35rem;
}

.nav-cluster {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-engine-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.35rem 0.7rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 999px;
  color: #34d399;
}

.status-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

.btn-nav-extension-zip {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
}

.btn-nav-extension-zip:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-extension-cta {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
}

.btn-extension-cta:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Hero Section & Spotlight Command Bar
   ========================================================================== */
.hero-section {
  text-align: center;
  padding: 4.5rem 0 2rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero-heading {
  font-family: var(--font-heading);
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 0.9rem;
}

.hero-subheading {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* Spotlight Command Bar */
.command-bar-wrapper {
  max-width: 780px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.command-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  padding: 0.4rem 0.5rem 0.4rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-command);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.command-bar:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Hairline Top Shimmer Indicator during loading */
.command-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #3b82f6, #60a5fa, transparent);
  transform: translateX(-100%);
  display: none;
}

.command-bar.is-loading .command-shimmer {
  display: block;
  animation: shimmerMove 1.4s infinite ease-in-out;
}

@keyframes shimmerMove {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.platform-indicator-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.platform-indicator-icon svg {
  width: 20px;
  height: 20px;
}

.command-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.98rem;
  color: var(--text-primary);
  padding: 0.65rem 0;
}

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

.command-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-clear-input {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clear-input:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.kbd-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.2rem 0.45rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-tertiary);
  user-select: none;
}

.btn-fetch-primary {
  background: #ffffff;
  color: #090a0f;
  border: none;
  border-radius: 9px;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.15s var(--ease-out);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn-fetch-primary:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.btn-fetch-primary:active {
  transform: translateY(1px);
}

.btn-fetch-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Quick 1-Click Direct Download Strip */
.quick-direct-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.85rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.quick-strip-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-direct-pill {
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-direct-pill.video {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.btn-direct-pill.video:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.btn-direct-pill.audio {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #d8b4fe;
}

.btn-direct-pill.audio:hover {
  background: #a855f7;
  border-color: #a855f7;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.4);
}

.btn-direct-pill:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Bookmarklet Styles */
.bookmarklet-wrapper {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}

.bookmarklet-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: #93c5fd;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: grab;
  transition: all 0.15s ease;
}

.bookmarklet-pill:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-blue);
  color: #ffffff;
}

.btn-download-extension-zip {
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: all 0.15s ease;
  margin-top: 1rem;
  width: 100%;
}

.btn-download-extension-zip:hover {
  background: var(--accent-blue-hover);
}

/* Platform Dock Bar */
.platform-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.dock-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  user-select: none;
}

.dock-pill svg {
  width: 14px;
  height: 14px;
}

.dock-pill:hover, .dock-pill.active {
  background: var(--bg-surface);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

/* ==========================================================================
   Loading & Status Feedback Bar
   ========================================================================== */
.live-status-bar {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem;
  margin: 1.5rem auto 0;
  max-width: 600px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.spinner-dots {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

/* Error Banner */
.error-banner {
  display: none;
  max-width: 720px;
  margin: 1.5rem auto 0;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  color: #fca5a5;
  font-size: 0.85rem;
  display: none;
  align-items: flex-start;
  gap: 0.75rem;
}

.error-banner.active {
  display: flex;
}

/* ==========================================================================
   Result Video Card (Human-Crafted Studio Layout)
   ========================================================================== */
.result-card {
  display: none;
  max-width: 820px;
  margin: 2.5rem auto 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: cardFadeIn 0.25s var(--ease-out);
}

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

.result-card-inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.75rem;
}

@media (max-width: 768px) {
  .result-card-inner {
    grid-template-columns: 1fr;
  }
}

.media-thumbnail-box {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.thumbnail-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-badge-duration {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.btn-preview-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 17, 24, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preview-play:hover {
  background: var(--accent-blue);
  border-color: #fff;
  transform: scale(1.08);
}

.media-info-column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.media-header {
  margin-bottom: 1.25rem;
}

.media-platform-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-blue);
  margin-bottom: 0.35rem;
}

.media-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-author {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Segmented Control Switcher (Video vs Audio) */
.segmented-control {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 2px;
  margin-bottom: 1rem;
}

.segmented-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.segmented-btn.active {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Quality Resolution Chips */
.quality-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.quality-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.quality-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-medium);
}

.quality-chip.selected {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.5);
}

.chip-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.quality-chip.selected .chip-label {
  color: #93c5fd;
}

.chip-size {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

/* Tactile Primary Action Bar */
.download-action-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-download-main {
  flex: 1;
  background: #ffffff;
  color: #090a0f;
  border: none;
  border-radius: 9px;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s var(--ease-out);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.btn-download-main:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.btn-download-main:active {
  transform: translateY(1px);
}

.btn-download-main:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary-tool {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 9px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-secondary-tool:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
}

/* ==========================================================================
   Real-Time Download Progress Box
   ========================================================================== */
/* ==========================================================================
   Real-Time Studio Download Progress Dashboard
   ========================================================================== */
.progress-card {
  display: none;
  margin-top: 1.25rem;
  background: linear-gradient(180deg, #111420 0%, #0d0f18 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 14px;
  padding: 1.35rem 1.45rem;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7), 0 0 24px -4px rgba(99, 102, 241, 0.15);
  position: relative;
  overflow: hidden;
  animation: cardFadeIn 0.3s ease;
}

.progress-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.6), rgba(168, 85, 247, 0.6), transparent);
}

/* Stepper */
.progress-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  transition: all 0.25s ease;
}

.progress-step-pill .step-indicator {
  position: relative;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-step-pill .step-beacon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.25s ease;
}

.progress-step-pill .step-check {
  display: none;
}

.progress-step-pill.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

.progress-step-pill.active .step-beacon {
  background: #6366f1;
  box-shadow: 0 0 10px #6366f1;
  animation: beaconPulse 1.4s infinite;
}

.progress-step-pill.completed {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.progress-step-pill.completed .step-beacon {
  display: none;
}

.progress-step-pill.completed .step-check {
  display: block;
  stroke: #34d399;
}

@keyframes beaconPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 12px #818cf8; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.step-connector {
  flex: 1;
  height: 1px;
  margin: 0 0.5rem;
  background: rgba(255, 255, 255, 0.08);
}

/* Main Row */
.progress-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

.progress-active-task {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Radar Pulse */
.radar-pulse-box {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

.radar-core {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  box-shadow: 0 0 8px #6366f1;
}

.radar-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 1.5px solid #818cf8;
  animation: radarPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
  opacity: 0;
}

@keyframes radarPing {
  0% { transform: scale(0.8); opacity: 0.8; }
  75%, 100% { transform: scale(1.6); opacity: 0; }
}

.progress-text-stack {
  display: flex;
  flex-direction: column;
}

.progress-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.progress-subtitle {
  color: var(--text-tertiary);
  font-size: 0.74rem;
  margin-top: 0.15rem;
}

/* Big Percent Display */
.progress-percentage-display {
  display: flex;
  align-items: baseline;
  font-family: var(--font-mono);
  color: #ffffff;
}

.progress-big-number {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.progress-percent-symbol {
  font-size: 1.1rem;
  font-weight: 700;
  color: #6366f1;
  margin-left: 2px;
}

/* Track Bar */
.progress-track-wrapper {
  margin-bottom: 1.1rem;
}

.progress-track-bar {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.progress-track-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 35%, #6366f1 70%, #a855f7 100%);
  border-radius: 999px;
  position: relative;
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.55);
}

/* Animated Shimmer Beam */
.progress-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: shimmerGlide 1.8s infinite;
}

@keyframes shimmerGlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.progress-lead-dot {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 12px 3px #ffffff, 0 0 20px 6px #6366f1;
}

/* Muxing / Processing Pulsing Mode */
.progress-card.is-muxing .progress-track-fill {
  background: linear-gradient(
    45deg,
    #6366f1 25%,
    #8b5cf6 25%,
    #8b5cf6 50%,
    #6366f1 50%,
    #6366f1 75%,
    #8b5cf6 75%,
    #8b5cf6
  );
  background-size: 28px 28px;
  animation: muxingStripes 1s linear infinite;
}

@keyframes muxingStripes {
  0% { background-position: 0 0; }
  100% { background-position: 28px 0; }
}

/* Metrics Grid */
.progress-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

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

.metric-cell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: 0.2rem;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #818cf8;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Completion Ready Save Banner */
.ready-download-banner {
  margin-top: 1.15rem;
  padding: 1.1rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  animation: cardFadeIn 0.25s ease;
}

.ready-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.ready-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #34d399;
}

.ready-filename {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 340px;
}

.btn-save-ready {
  background: #10b981;
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

.btn-save-ready:hover {
  background: #059669;
  transform: translateY(-1px);
}

.ready-hint {
  margin-top: 0.45rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.btn-copy-mini {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy-mini:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* ==========================================================================
   Bento Grid Section (Why It's Better / Craft Features)
   ========================================================================== */
.bento-section {
  margin: 5rem 0 3.5rem;
}

.bento-header {
  text-align: center;
  margin-bottom: 2rem;
}

.bento-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 0.4rem;
}

.bento-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

@media (max-width: 820px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
}

.bento-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.15s ease;
}

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

.bento-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.bento-card-title {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.4rem;
}

.bento-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Recent Downloads (History)
   ========================================================================== */
.history-section {
  margin: 3.5rem 0 5rem;
}

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

.history-heading {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.btn-history-clear {
  background: transparent;
  border: none;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.15s ease;
}

.btn-history-clear:hover {
  color: var(--accent-red);
}

.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}

.history-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: border-color 0.15s ease;
}

.history-item:hover {
  border-color: var(--border-medium);
}

.history-thumb-img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}

.history-content {
  flex: 1;
  overflow: hidden;
}

.history-item-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2rem;
}

.history-item-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-tertiary);
  display: flex;
  gap: 0.4rem;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-history-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-history-icon:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
}

.empty-history-text {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 0;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  max-width: 540px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalEnter 0.2s var(--ease-out);
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.btn-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

#videoModal .modal-dialog {
  max-width: 760px;
  padding: 1rem;
  background: #000;
}

#previewVideoPlayer {
  width: 100%;
  max-height: 460px;
  border-radius: 8px;
  outline: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 0;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-engine-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

/* ==========================================================================
   PWA Install Toast & Touch Enhancements
   ========================================================================== */
.btn-pwa-install {
  display: none;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-pwa-install:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
  color: #ffffff;
}

.btn-paste-touch {
  display: none;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-paste-touch:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Media Queries
   ========================================================================== */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .header {
    padding: 0.85rem 0;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .brand-version {
    display: none;
  }

  .nav-engine-status {
    padding: 0.25rem 0.5rem;
    font-size: 0.68rem;
  }

  .nav-engine-status span:last-child {
    display: none; /* Keep green pulse dot only */
  }

  .hero-section {
    padding: 2.75rem 0 1.5rem;
  }

  .hero-heading {
    font-size: clamp(1.85rem, 7vw, 2.6rem);
  }

  .hero-subheading {
    font-size: 0.92rem;
    margin-bottom: 1.75rem;
  }

  /* Command Bar Mobile Adaptation */
  .command-bar {
    padding: 0.4rem 0.5rem 0.4rem 0.85rem;
    gap: 0.5rem;
  }

  .command-input {
    font-size: 0.92rem;
  }

  .kbd-badge {
    display: none; /* Hide desktop Ctrl V on touch devices */
  }

  .btn-paste-touch {
    display: inline-flex;
    align-items: center;
  }

  .btn-fetch-primary {
    padding: 0.6rem 0.95rem;
    font-size: 0.84rem;
  }

  /* Platform Dock as Horizontal Native Carousel */
  .platform-dock {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding: 0.25rem 0.25rem 0.75rem;
    scrollbar-width: none;
  }

  .platform-dock::-webkit-scrollbar {
    display: none;
  }

  .dock-pill {
    flex-shrink: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.76rem;
  }

  /* Result Card Mobile */
  .result-card {
    padding: 1.15rem;
    margin-top: 1.5rem;
  }

  .result-card-inner {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .media-title {
    font-size: 1.05rem;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-btn {
    flex: 1;
    justify-content: center;
    padding: 0.5rem 0.5rem;
  }

  .btn-nav-extension-zip {
    padding: 0.35rem 0.65rem;
    font-size: 0.74rem;
  }

  .btn-direct-pill {
    padding: 0.4rem 0.75rem;
    font-size: 0.76rem;
    min-height: 38px;
  }

  .quality-chips-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .quality-chip {
    padding: 0.6rem 0.75rem;
    min-height: 44px; /* Touch target guideline */
  }

  .download-action-row {
    flex-direction: column;
    gap: 0.6rem;
  }

  .btn-download-main {
    width: 100%;
    padding: 0.85rem;
    font-size: 0.92rem;
    min-height: 48px;
  }

  .btn-secondary-tool {
    width: 100%;
    justify-content: center;
    padding: 0.65rem;
    min-height: 44px;
  }

  /* Bento Grid Mobile */
  .bento-section {
    margin: 3.5rem 0 2.5rem;
  }

  .bento-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .bento-card {
    padding: 1.25rem;
  }

  /* History list */
  .history-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .command-bar {
    flex-wrap: wrap;
    padding: 0.65rem 0.75rem;
  }

  .command-input {
    min-width: 180px;
    order: 1;
  }

  .command-actions {
    width: 100%;
    justify-content: flex-end;
    order: 3;
    margin-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.4rem;
  }

  .quality-chips-grid {
    grid-template-columns: 1fr;
  }
}
