/* ==========================================================================
   StreamVault Design System
   Human-Crafted, Premium SaaS Styling
   ========================================================================== */

:root {
  /* Color Palette - Dark Theme (Obsidian & Electric Crimson/Violet) */
  --bg-base: #07090e;
  --bg-surface: #0d111b;
  --bg-elevated: #131927;
  --bg-glass: rgba(13, 17, 27, 0.78);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-focus: #ff1a4b;

  --accent-primary: #ff1a4b;
  --accent-hover: #ff2e5d;
  --accent-violet: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-gold: #f59e0b;
  --accent-gradient: linear-gradient(135deg, #ff1a4b 0%, #a855f7 50%, #6366f1 100%);
  --accent-gradient-hover: linear-gradient(135deg, #ff2e5d 0%, #b36bf9 50%, #7579f3 100%);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --badge-bg: rgba(255, 26, 75, 0.12);
  --badge-text: #ff6b8b;
  --badge-border: rgba(255, 26, 75, 0.28);

  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px var(--border-subtle);
  --shadow-glow: 0 0 35px rgba(255, 26, 75, 0.25);
  --btn-glow: 0 0 24px rgba(255, 26, 75, 0.4), 0 8px 20px -6px rgba(168, 85, 247, 0.4);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.88);

  --border-subtle: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-focus: #ff1a4b;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --badge-bg: #fee2e2;
  --badge-text: #dc2626;
  --badge-border: #fecaca;

  --shadow-card: 0 15px 35px -10px rgba(0, 0, 0, 0.08), 0 0 0 1px #e2e8f0;
  --shadow-glow: 0 0 25px rgba(255, 26, 75, 0.15);
  --btn-glow: 0 4px 18px rgba(255, 26, 75, 0.3);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 26, 75, 0.08) 0%, transparent 60%),
    radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px;
  background-attachment: fixed;
}

/* Ambient Floating Glow Mesh */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  animation: floatGlow 16s ease-in-out infinite alternate;
}

.ambient-glow-1 {
  top: -80px;
  left: 20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 26, 75, 0.4) 0%, transparent 70%);
}

.ambient-glow-2 {
  top: 180px;
  right: 12%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.35) 0%, transparent 70%);
  animation-duration: 20s;
  animation-delay: -6s;
}

.ambient-glow-3 {
  bottom: 80px;
  left: 25%;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
}

@keyframes floatGlow {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.08); }
  100% { transform: translateY(20px) scale(0.95); }
}

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

/* ==========================================================================
   Header Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background-color: var(--bg-glass);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 26, 75, 0.4);
  transition: transform 0.2s ease;
}

.brand-logo:hover .logo-icon {
  transform: scale(1.06) rotate(-3deg);
}

.logo-highlight {
  background: linear-gradient(135deg, #ff1a4b 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge-free {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background-color: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
  letter-spacing: -0.01em;
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.theme-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.theme-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  background: var(--bg-surface);
}

/* ==========================================================================
   Hero Section & Converter Box
   ========================================================================== */
.hero-section {
  padding: 70px 0 50px;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: var(--radius-full);
  background: rgba(13, 17, 27, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  margin-bottom: 24px;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary);
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.12;
  margin-bottom: 18px;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #ff6b8b 40%, #c084fc 80%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .gradient-text {
  background: linear-gradient(135deg, #e11d48 0%, #9333ea 50%, #4f46e5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.12rem;
  color: var(--text-secondary);
  max-width: 660px;
  margin: 0 auto 44px;
  line-height: 1.65;
}

/* ==========================================================================
   Command Center Converter Box
   ========================================================================== */
.converter-box {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 780px;
  margin: 0 auto;
  box-shadow: 
    0 30px 60px -15px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: all 0.3s ease;
}

.converter-box:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.converter-box:focus-within {
  border-color: rgba(255, 26, 75, 0.35);
  box-shadow: 
    0 35px 70px -15px rgba(0, 0, 0, 0.85),
    0 0 40px rgba(255, 26, 75, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* URL Input Form */
.url-input-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (min-width: 640px) {
  .url-input-form {
    flex-direction: row;
  }
}

.input-shell {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
  transition: all 0.25s ease;
}

.input-shell:focus-within {
  border-color: var(--accent-primary);
  background: #111726;
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.35),
    0 0 0 3px rgba(255, 26, 75, 0.14),
    0 0 20px rgba(255, 26, 75, 0.16);
}

/* Light Theme Overrides for Command Bar & Input */
[data-theme="light"] .converter-box {
  background: #ffffff !important;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .converter-box:focus-within {
  border-color: rgba(255, 26, 75, 0.4);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1), 0 0 25px rgba(255, 26, 75, 0.12);
}

[data-theme="light"] .input-shell {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .input-shell:focus-within {
  background: #ffffff !important;
  border-color: #ff1a4b !important;
  box-shadow: 
    0 0 0 3.5px rgba(255, 26, 75, 0.14),
    0 4px 16px rgba(255, 26, 75, 0.08) !important;
}

.input-icon {
  display: flex;
  align-items: center;
  color: var(--accent-primary);
  padding-left: 2px;
  padding-right: 12px;
  filter: drop-shadow(0 0 8px rgba(255, 26, 75, 0.5));
}

[data-theme="light"] .input-icon {
  color: #ff1a4b;
  filter: drop-shadow(0 0 4px rgba(255, 26, 75, 0.25));
}

.video-url-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  min-width: 0;
  font-weight: 500;
}

[data-theme="light"] .video-url-input {
  color: #0f172a;
}

.video-url-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

[data-theme="light"] .video-url-input::placeholder {
  color: #94a3b8;
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: var(--transition);
}

[data-theme="light"] .action-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.action-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

[data-theme="light"] .action-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.clear-btn {
  padding: 8px;
  border-radius: 50%;
}

.kbd-hint {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  letter-spacing: -0.02em;
}

[data-theme="light"] .kbd-hint {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent-gradient);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--btn-glow);
  white-space: nowrap;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: rotate(25deg) translateY(-100%);
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover::after {
  transform: rotate(25deg) translateY(100%);
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(255, 26, 75, 0.5), 0 10px 25px -6px rgba(168, 85, 247, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-arrow {
  transition: transform 0.2s ease;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

/* Quick Feature Tags */
.quick-feature-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .quick-feature-tags {
  border-top: 1px solid #e2e8f0;
}

.tag-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

[data-theme="light"] .tag-label {
  color: #64748b;
}

.quick-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

[data-theme="light"] .quick-tag {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.quick-tag:hover {
  background: rgba(255, 26, 75, 0.12);
  border-color: rgba(255, 26, 75, 0.3);
  color: var(--text-primary);
  transform: translateY(-1px);
}

[data-theme="light"] .quick-tag:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Trust Metrics Strip */
.trust-metrics-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 860px;
  margin: 32px auto 0;
}

@media (min-width: 768px) {
  .trust-metrics-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

.metric-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 16px;
  padding: 14px 16px;
  text-align: left;
  box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.metric-pill:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 26, 75, 0.35);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.15);
}

/* Light Theme Overrides for Metric Pill */
[data-theme="light"] .metric-pill {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .metric-pill:hover {
  background: #ffffff;
  border-color: rgba(255, 26, 75, 0.35);
  box-shadow: 0 14px 32px -8px rgba(255, 26, 75, 0.12);
}

[data-theme="light"] .metric-text strong {
  color: #0f172a;
}

[data-theme="light"] .metric-text span {
  color: #64748b;
}

/* Animated Icon Boxes - Font Awesome 6 Library Integration */
.metric-icon-box {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.metric-pill:hover .metric-icon-box {
  transform: scale(1.1);
}

.icon-fa-anim {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 1. Lightning Bolt (Speed Pulse) */
.icon-box-bolt {
  background: rgba(255, 26, 75, 0.12);
  color: #ff1a4b;
  border: 1px solid rgba(255, 26, 75, 0.28);
  box-shadow: 0 0 16px rgba(255, 26, 75, 0.12);
}

.icon-box-bolt .icon-fa-anim {
  --fa-animation-duration: 2s;
  --fa-bounce-height: -4px;
}

[data-theme="light"] .icon-box-bolt {
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fee2e2;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.12);
}

/* 2. Studio Audio (Beat Pulse) */
.icon-box-audio {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.28);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.12);
}

.icon-box-audio .icon-fa-anim {
  --fa-animation-duration: 1.8s;
  --fa-beat-scale: 1.15;
}

[data-theme="light"] .icon-box-audio {
  background: #f5f3ff;
  color: #8b5cf6;
  border: 1px solid #ede9fe;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.12);
}

/* 3. Security Shield (Glow Fade) */
.icon-box-shield {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.28);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.12);
}

.icon-box-shield .icon-fa-anim {
  --fa-animation-duration: 2.2s;
  --fa-beat-fade-scale: 1.08;
  --fa-beat-fade-opacity: 0.75;
}

[data-theme="light"] .icon-box-shield {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #d1fae5;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.12);
}

/* 4. Universal Devices (Smooth Pulse) */
.icon-box-devices {
  background: rgba(6, 182, 212, 0.12);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.28);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.12);
}

.icon-box-devices .icon-fa-anim {
  --fa-animation-duration: 2.2s;
  --fa-beat-fade-scale: 1.08;
  --fa-beat-fade-opacity: 0.75;
}

[data-theme="light"] .icon-box-devices {
  background: #ecfeff;
  color: #0891b2;
  border: 1px solid #cffafe;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.12);
}

.metric-text {
  display: flex;
  flex-direction: column;
}

.metric-text strong {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.metric-text span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Error Banner */
.error-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 16px;
  text-align: left;
  font-size: 0.92rem;
}

.error-close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: auto;
}

/* Loading State */
.loading-state {
  padding: 36px 20px;
  text-align: center;
}

.spinner-ring {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Result Card (Cinematic Preview & Studio Formats)
   ========================================================================== */
.result-card {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  animation: fadeInResult 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.video-preview-row {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 26px;
  padding: 16px;
  background: rgba(19, 25, 39, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
}

@media (min-width: 600px) {
  .video-preview-row {
    flex-direction: row;
    align-items: center;
  }
}

.thumbnail-wrapper {
  position: relative;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.thumbnail-wrapper:hover .video-thumb {
  transform: scale(1.05);
}

.duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.video-meta {
  flex: 1;
  min-width: 0;
}

.video-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.channel-name {
  font-weight: 600;
  color: var(--text-primary);
}

.meta-dot {
  color: rgba(255, 255, 255, 0.2);
}

/* Tabs & Audio Selector */
.format-tabs-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
}

.format-tabs {
  display: flex;
  gap: 10px;
  background: rgba(13, 17, 27, 0.7);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 26, 75, 0.35);
}

.language-dub-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dub-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dub-select {
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.dub-select:focus {
  border-color: var(--accent-primary);
}

/* Formats Grid */
.formats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

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

.format-item-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(19, 25, 39, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s ease;
}

.format-item-card:hover {
  border-color: rgba(255, 26, 75, 0.35);
  background: rgba(23, 31, 48, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.6);
}

.format-item-card.format-4k {
  border-color: rgba(245, 158, 11, 0.25);
}
.format-item-card.format-4k:hover {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.18);
}

.format-item-card.format-1080p {
  border-color: rgba(255, 26, 75, 0.22);
}
.format-item-card.format-1080p:hover {
  border-color: rgba(255, 26, 75, 0.5);
  box-shadow: 0 0 25px rgba(255, 26, 75, 0.15);
}

.format-info-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.format-res {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.format-type-icon {
  display: flex;
  align-items: center;
  color: var(--accent-primary);
}

.format-badge {
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.format-badge.badge-best {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.format-size {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-download-stream {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(255, 26, 75, 0.3);
}

.btn-download-stream:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 18px rgba(255, 26, 75, 0.45);
}

.btn-download-stream.is-downloading {
  opacity: 0.8;
  pointer-events: none;
  background: #334155;
  box-shadow: none;
}

.card-footer-actions {
  margin-top: 26px;
  text-align: center;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

/* ==========================================================================
   Bento Grid Features Section
   ========================================================================== */
.features-section {
  padding: 90px 0;
  position: relative;
}

.section-heading {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

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

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

.feature-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 28px 24px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 26, 75, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 26, 75, 0.1);
  border: 1px solid rgba(255, 26, 75, 0.2);
  color: var(--accent-primary);
  margin-bottom: 20px;
  transition: transform 0.25s ease;
}

.feature-icon svg {
  width: 26px;
  height: 26px;
}

.feature-icon.icon-shield {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.feature-icon.icon-video {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
}

.feature-icon.icon-mobile {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(3deg);
}

.feature-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

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

/* ==========================================================================
   How It Works (Numbered Track Steps)
   ========================================================================== */
.how-section {
  padding: 80px 0;
  background: rgba(13, 17, 27, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@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: 18px;
  padding: 32px 26px;
  transition: all 0.3s ease;
}

.step-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

.step-number {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ff1a4b 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 14px;
  line-height: 1;
}

.step-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.step-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ==========================================================================
   SEO Content & Authority Section
   ========================================================================== */
.seo-section {
  padding: 80px 0 40px;
}

.seo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

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

.seo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.seo-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.4);
}

.seo-card-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.seo-card-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.seo-card-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */
.faq-section {
  padding: 80px 0;
}

.faq-container {
  max-width: 760px;
}

.accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accordion-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

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

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.chevron {
  transition: transform 0.25s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}

.accordion-item.active .chevron {
  transform: rotate(180deg);
  color: var(--accent-light);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  padding: 0 24px;
}

.accordion-item.active .accordion-content {
  max-height: 400px;
  transition: max-height 0.4s ease-in-out;
  padding-bottom: 20px;
}

.accordion-content p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-base);
  padding: 60px 0 30px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

@media (min-width: 768px) {
  .footer-top {
    grid-template-columns: 1.5fr 2fr;
  }
}

.footer-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 12px;
  max-width: 320px;
}

.footer-disclaimer h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.footer-disclaimer p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
  }
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Product polish
   ========================================================================== */
:root {
  --bg-base: #070b14;
  --bg-surface: #0d1422;
  --bg-elevated: #121c2e;
  --bg-glass: rgba(7, 11, 20, 0.82);
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-hover: rgba(148, 163, 184, 0.28);
  --accent-primary: #5b5ce2;
  --accent-hover: #6d6ff0;
  --accent-light: #a5b4fc;
  --accent-gradient: linear-gradient(135deg, #7173f3 0%, #4f46c9 100%);
  --text-secondary: #9aa8bd;
  --text-muted: #6f7d92;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-card: 0 24px 60px -28px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-subtle);
  --transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-base: #f5f7fb;
  --bg-surface: #ffffff;
  --bg-elevated: #eef2f8;
  --bg-glass: rgba(245, 247, 251, 0.88);
  --border-subtle: #e1e7f0;
  --border-hover: #c7d2e2;
  --text-secondary: #536176;
  --text-muted: #8692a5;
  --shadow-card: 0 24px 50px -28px rgba(31, 41, 55, 0.28), 0 0 0 1px #e1e7f0;
}

body {
  background-image:
    radial-gradient(ellipse 70% 45% at 50% -12%, rgba(99, 102, 241, 0.18), transparent 68%),
    linear-gradient(180deg, transparent 0%, rgba(99, 102, 241, 0.025) 100%);
}

.container {
  max-width: 1180px;
  padding-left: 28px;
  padding-right: 28px;
}

.site-header {
  border-bottom-color: color-mix(in srgb, var(--border-subtle) 80%, transparent);
}

.header-inner {
  height: 76px;
}

.brand-logo {
  font-size: 1.18rem;
}

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.hero-section {
  padding: 86px 0 52px;
}

.hero-badge {
  margin-bottom: 26px;
  background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
  letter-spacing: 0.01em;
}

.hero-title {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(2.35rem, 5vw, 4rem);
  letter-spacing: -0.055em;
  line-height: 1.07;
}

.hero-subtitle {
  max-width: 650px;
  font-size: 1.02rem;
  line-height: 1.75;
  margin-bottom: 36px;
}

.converter-box {
  max-width: 820px;
  padding: 18px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
}

.url-input-form {
  gap: 10px;
}

.input-shell {
  min-height: 56px;
  padding: 7px 10px;
  border-radius: 12px;
}

.video-url-input {
  font-size: 0.94rem;
}

.btn-primary {
  min-height: 56px;
  padding: 14px 22px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.24);
}

.btn-primary:hover {
  box-shadow: 0 14px 28px rgba(79, 70, 229, 0.32);
}

.result-card {
  margin-top: 22px;
  padding-top: 22px;
}

.thumbnail-wrapper {
  max-width: 216px;
  border-radius: 11px;
}

.format-tabs-wrapper {
  margin-top: 10px;
  padding-bottom: 14px;
}

.tab-btn {
  padding: 9px 15px;
  border-radius: 9px;
}

.format-item-card {
  padding: 14px 15px;
  border-radius: 11px;
}

.features-section,
.seo-section,
.faq-section {
  padding-top: 96px;
  padding-bottom: 96px;
}

.section-heading {
  margin-bottom: 40px;
}

.section-title {
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  letter-spacing: -0.04em;
}

.feature-card,
.seo-card,
.step-card,
.accordion-item {
  border-radius: 16px;
  box-shadow: 0 12px 32px -26px rgba(0, 0, 0, 0.65);
}

.feature-card {
  padding: 26px;
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 20px;
  border: 1px solid color-mix(in srgb, var(--accent-light) 24%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-primary) 14%, transparent);
  color: var(--accent-light);
}

.feature-icon svg {
  width: 21px;
  height: 21px;
}

.feature-card:hover,
.seo-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent-light) 38%, var(--border-subtle));
  box-shadow: 0 20px 36px -28px rgba(99, 102, 241, 0.55);
}

.how-section {
  background: color-mix(in srgb, var(--bg-surface) 64%, transparent);
}

.steps-grid {
  gap: 16px;
}

.step-card {
  padding: 26px;
}

.step-number {
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--accent-light);
  opacity: 1;
}

.seo-card {
  padding: 26px;
}

.seo-card-title {
  font-size: 1.08rem;
  letter-spacing: -0.015em;
}

.accordion {
  gap: 10px;
}

.accordion-trigger {
  padding: 21px 24px;
}

.site-footer {
  padding-top: 52px;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-light) 70%, transparent);
  outline-offset: 3px;
}

@media (max-width: 639px) {
  .container {
    padding-left: 18px;
    padding-right: 18px;
  }

  .header-inner {
    height: 68px;
  }

  .badge-free {
    display: none;
  }

  .hero-section {
    padding-top: 58px;
  }

  .hero-title {
    font-size: clamp(2.2rem, 11vw, 3rem);
  }

  .converter-box {
    padding: 12px;
    border-radius: 16px;
  }

  .btn-primary {
    width: 100%;
  }

  .features-section,
  .seo-section,
  .faq-section {
    padding-top: 72px;
    padding-bottom: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
