/* ════════════════════════════════════════════════════════
   SONICSNAP – YOUTUBE CONVERTER STYLESHEET
   Author: SonicSnap
   ════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────
   1. CSS VARIABLES & THEMING
────────────────────────────────────── */
:root {
  /* Brand Colors */
  --red:          #FF0000;
  --red-dark:     #CC0000;
  --red-light:    #FF3333;
  --red-glow:     rgba(255, 0, 0, 0.25);
  --red-glow-sm:  rgba(255, 0, 0, 0.12);

  /* Dark Theme (Default) */
  --bg-primary:   #0A0A0A;
  --bg-secondary: #111111;
  --bg-card:      #181818;
  --bg-card-2:    #1E1E1E;
  --bg-input:     #242424;
  --border:       rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.18);
  --text-1:       #FFFFFF;
  --text-2:       #B0B0B0;
  --text-3:       #6B6B6B;
  --shadow:       0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg:    0 8px 48px rgba(0,0,0,0.6);
  --shadow-red:   0 4px 24px rgba(255,0,0,0.3);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --max-w: 1200px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.15s;
  --t-mid:  0.3s;
  --t-slow: 0.6s;
}

[data-theme="light"] {
  --bg-primary:   #F4F4F5;
  --bg-secondary: #FFFFFF;
  --bg-card:      #FFFFFF;
  --bg-card-2:    #F9F9F9;
  --bg-input:     #FFFFFF;
  --border:       rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.2);
  --text-1:       #0A0A0A;
  --text-2:       #444444;
  --text-3:       #888888;
  --shadow:       0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 48px rgba(0,0,0,0.12);
  --shadow-red:   0 4px 24px rgba(255,0,0,0.2);
}

/* ──────────────────────────────────────
   2. RESET & BASE
────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--t-mid) var(--ease), color var(--t-mid) var(--ease);
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

img {
  max-width: 100%;
  display: block;
}

ul { list-style: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

/* ──────────────────────────────────────
   3. PARTICLES CANVAS
────────────────────────────────────── */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.35;
}

/* ──────────────────────────────────────
   4. LAYOUT
────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ──────────────────────────────────────
   5. HEADER
────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-mid);
}

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

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  transition: opacity var(--t-fast);
}

.logo:hover { opacity: 0.85; }

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 8px var(--red-glow));
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-1);
  display: flex;
  align-items: baseline;
  gap: 1px;
}

.logo-rapid {
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}

.logo-accent {
  color: var(--red);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -1.5px;
}

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 8px;
  transition: color var(--t-fast), background var(--t-fast);
}

.nav-link:hover {
  color: var(--text-1);
  background: var(--border);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
}

/* Language Selector */
.lang-select-wrap {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all var(--t-fast);
}

.lang-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-1);
}

.lang-btn .fa-globe { font-size: 0.85rem; }
.lang-btn .fa-chevron-down { font-size: 0.65rem; }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 160px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--t-fast) var(--ease);
  z-index: 200;
}

.lang-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  width: 100%;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  text-align: left;
  transition: background var(--t-fast), color var(--t-fast);
}

.lang-option:hover, .lang-option.active {
  background: var(--red-glow-sm);
  color: var(--red);
}

/* Theme Toggle */
.theme-toggle {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 0.9rem;
  transition: all var(--t-fast);
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-1);
  background: var(--bg-card-2);
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mobile-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: all var(--t-fast);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  gap: 4px;
}

.mobile-nav-link {
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 8px;
}

.mobile-nav-link:hover {
  color: var(--text-1);
  background: var(--border);
}

/* ──────────────────────────────────────
   6. HERO SECTION
────────────────────────────────────── */
.hero {
  position: relative;
  padding: 80px 0 100px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(255,0,0,0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

/* Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255,0,0,0.1);
  border: 1px solid rgba(255,0,0,0.25);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--red-light);
  margin-bottom: 24px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero-badge .fa-bolt {
  color: #FFD700;
}

/* Title */
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, #FF0000 0%, #FF4444 40%, #FF8800 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Subtitle */
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-2);
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ──────────────────────────────────────
   7. CONVERTER CARD
────────────────────────────────────── */
.converter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-mid);
}

.converter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: 0.6;
}

.converter-card:focus-within {
  border-color: rgba(255,0,0,0.3);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Form */
.converter-form {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--red);
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 1;
}

.url-input {
  width: 100%;
  padding: 16px 80px 16px 48px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-1);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: all var(--t-fast);
  -webkit-appearance: none;
}

.url-input::placeholder { color: var(--text-3); }

.url-input:focus {
  border-color: rgba(255,0,0,0.4);
  background: var(--bg-input);
  box-shadow: 0 0 0 3px var(--red-glow-sm);
}

.paste-btn,
.clear-btn {
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--text-3);
  transition: all var(--t-fast);
  font-size: 0.85rem;
}

.paste-btn:hover { color: var(--red); background: var(--red-glow-sm); }
.clear-btn { right: 48px; }
.clear-btn:hover { color: var(--red); background: var(--red-glow-sm); }

/* Convert Button */
.convert-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  border-radius: var(--radius);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--t-fast);
  position: relative;
  overflow: hidden;
}

.convert-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
}

.convert-btn:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-red);
}

.convert-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.convert-btn.loading .btn-text::after {
  content: '...';
}

.btn-icon { font-size: 0.85rem; transition: transform var(--t-fast); }
.convert-btn:hover .btn-icon { transform: translateX(4px); }

/* Formats Hint */
.formats-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--text-3);
}

.formats-hint code {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--text-2);
}

/* ──────────────────────────────────────
   8. RESULT PANEL
────────────────────────────────────── */
.result-panel {
  margin-top: 20px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: slideDown 0.4s var(--ease);
}

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

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px;
  gap: 16px;
}

.spinner {
  position: relative;
  width: 52px;
  height: 52px;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--red);
  animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
  inset: 8px;
  border-top-color: var(--red-light);
  animation-delay: -0.3s;
}

.spinner-ring:nth-child(3) {
  inset: 16px;
  border-top-color: rgba(255,100,0,0.6);
  animation-delay: -0.6s;
}

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

.loading-text {
  font-size: 0.9rem;
  color: var(--text-2);
  font-weight: 500;
}

.loading-bar {
  width: 200px;
  height: 3px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), #FF8800);
  border-radius: 3px;
  transition: width 0.5s var(--ease);
  animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Error State */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px;
  gap: 12px;
}

.error-icon {
  width: 56px;
  height: 56px;
  background: rgba(255,60,60,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #FF4444;
}

.error-msg {
  color: var(--text-2);
  font-size: 0.9rem;
}

.retry-btn {
  padding: 8px 20px;
  background: var(--red);
  color: #fff;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--t-fast);
}

.retry-btn:hover { background: var(--red-dark); }

/* Video Info */
.video-info {
  padding: 24px;
}

.video-preview {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.thumbnail-wrap {
  position: relative;
  flex-shrink: 0;
  width: 180px;
  height: 101px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.video-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-mid);
}

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

.thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  transition: opacity var(--t-fast);
  opacity: 0;
}

.thumbnail-wrap:hover .thumb-play {
  opacity: 1;
}

.thumb-play i {
  font-size: 1.5rem;
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.thumb-duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

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

.video-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-2);
}

.stat-item i {
  color: var(--red);
  font-size: 0.75rem;
}

/* Format Tabs */
.format-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 16px;
  width: fit-content;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
  border-radius: 7px;
  transition: all var(--t-fast);
}

.tab-btn i { font-size: 0.8rem; }

.tab-btn.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 8px var(--red-glow);
}

.tab-btn:not(.active):hover {
  color: var(--text-1);
  background: var(--border);
}

/* Quality Grid */
.format-options {
  animation: fadeIn 0.2s ease;
}

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

.quality-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quality-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--t-fast);
  min-width: 100px;
  gap: 2px;
}

.quality-btn:hover {
  border-color: var(--red);
  background: var(--red-glow-sm);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255,0,0,0.15);
}

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

.quality-btn.recommended {
  border-color: rgba(255,0,0,0.3);
  background: linear-gradient(135deg, rgba(255,0,0,0.05), rgba(255,100,0,0.05));
}

.quality-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.quality-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quality-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-1);
}

.quality-desc {
  font-size: 0.7rem;
  color: var(--text-3);
}

/* Download Progress */
.download-progress {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: fadeIn 0.3s ease;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), #FF8800);
  border-radius: 6px;
  transition: width 0.5s var(--ease);
}

.progress-text {
  font-size: 0.82rem;
  color: var(--text-2);
  text-align: center;
  font-weight: 500;
}

/* ──────────────────────────────────────
   9. STATS BAR
────────────────────────────────────── */
.stats-bar {
  padding: 40px 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
  isolation: isolate;
}

.stats-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.stat-block {
  text-align: center;
  padding: 0 40px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--red), #FF8800);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-2);
  margin-top: 2px;
  font-weight: 500;
}

.stat-sep {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ──────────────────────────────────────
   10. SECTION BASE STYLES
────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-tag {
  display: inline-block;
  padding: 4px 14px;
  background: var(--red-glow-sm);
  border: 1px solid rgba(255,0,0,0.2);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--red-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 14px;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto;
}

/* ──────────────────────────────────────
   11. HOW IT WORKS
────────────────────────────────────── */
.how-it-works {
  padding: 100px 0;
  position: relative;
  background: var(--bg-primary);
  isolation: isolate;
}

.steps-grid {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.step-card {
  flex: 1;
  padding: 36px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  transition: all var(--t-mid) var(--ease);
}

.step-card:hover {
  border-color: rgba(255,0,0,0.25);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(255,0,0,0.1);
}

.step-number {
  position: absolute;
  top: -14px;
  left: 24px;
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--red);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 100px;
  letter-spacing: 1px;
}

.step-icon {
  width: 64px;
  height: 64px;
  background: var(--red-glow-sm);
  border: 1px solid rgba(255,0,0,0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--red);
  margin: 0 auto 18px;
}

.step-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

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

.step-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: var(--red);
  font-size: 1rem;
  flex-shrink: 0;
  padding-top: 80px;
}

/* ──────────────────────────────────────
   12. FEATURES
────────────────────────────────────── */
.features {
  padding: 100px 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  isolation: isolate;
}

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

.feature-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--t-mid) var(--ease);
}

.feature-card:hover {
  border-color: rgba(255,0,0,0.2);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.feature-icon.red    { background: rgba(255,0,0,0.1);     color: #FF4444; }
.feature-icon.blue   { background: rgba(0,120,255,0.1);   color: #4488FF; }
.feature-icon.green  { background: rgba(0,200,100,0.1);   color: #00C864; }
.feature-icon.purple { background: rgba(150,0,255,0.1);   color: #AA44FF; }
.feature-icon.orange { background: rgba(255,140,0,0.1);   color: #FF8C00; }
.feature-icon.teal   { background: rgba(0,180,200,0.1);   color: #00B4C8; }

.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.65;
}

/* ──────────────────────────────────────
   13. FORMATS TABLE
────────────────────────────────────── */
.formats-section {
  padding: 100px 0;
  position: relative;
  background: var(--bg-primary);
  isolation: isolate;
}

.formats-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.formats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.formats-table th {
  padding: 14px 20px;
  background: var(--bg-card-2);
  font-weight: 700;
  color: var(--text-2);
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.formats-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

.formats-table tr:last-child td { border-bottom: none; }

.formats-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.highlight-row td {
  background: rgba(255,0,0,0.04);
}

.format-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.format-badge.mp3 {
  background: rgba(255,0,0,0.12);
  color: #FF4444;
  border: 1px solid rgba(255,0,0,0.2);
}

.format-badge.mp4 {
  background: rgba(0,120,255,0.1);
  color: #4488FF;
  border: 1px solid rgba(0,120,255,0.2);
}

/* ──────────────────────────────────────
   14. MULTILINGUAL SECTION
────────────────────────────────────── */
.multilingual-section {
  padding: 100px 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  isolation: isolate;
}

.lang-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.lang-card {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--t-mid) var(--ease);
}

.lang-card:hover {
  border-color: rgba(255,0,0,0.2);
  transform: translateY(-2px);
}

.lang-flag {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.lang-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}

.lang-card p {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 12px;
}

.lang-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--red);
  transition: color var(--t-fast);
}

.lang-link:hover { color: var(--red-light); }

/* ──────────────────────────────────────
   15. FAQ
────────────────────────────────────── */
.faq {
  padding: 100px 0;
  position: relative;
  background: var(--bg-primary);
  isolation: isolate;
}

.faq-grid {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.faq-item.open {
  border-color: rgba(255,0,0,0.25);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 20px;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-1);
  transition: color var(--t-fast);
}

.faq-question:hover { color: var(--red); }

.faq-icon {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--red);
  transition: transform var(--t-fast);
}

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

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
}

.faq-item.open .faq-answer {
  max-height: 400px;
}

.faq-answer > div {
  padding: 0 20px 18px;
}

.faq-answer p {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.7;
}

.faq-answer strong {
  color: var(--text-1);
  font-weight: 600;
}

/* ──────────────────────────────────────
   16. SEO CONTENT SECTION
────────────────────────────────────── */
.seo-content {
  padding: 80px 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  position: relative;
  isolation: isolate;
}

.seo-title {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  text-align: center;
  margin-bottom: 48px;
}

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

.seo-col h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  margin-top: 24px;
  color: var(--text-1);
}

.seo-col h3:first-child { margin-top: 0; }

.seo-col p {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 0;
}

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

/* ──────────────────────────────────────
   17. FOOTER
────────────────────────────────────── */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  position: relative;
  isolation: isolate;
}

.footer-top {
  padding: 60px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}

.footer-logo { margin-bottom: 14px; }

.footer-tagline {
  font-size: 0.83rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 20px;
  max-width: 280px;
}

.footer-social {
  display: flex;
  gap: 8px;
}

.social-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 0.85rem;
  transition: all var(--t-fast);
}

.social-link:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  transform: translateY(-2px);
}

.footer-col-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-2);
  transition: color var(--t-fast);
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.copyright {
  font-size: 0.8rem;
  color: var(--text-3);
}

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

.legal-links a {
  font-size: 0.78rem;
  color: var(--text-3);
  transition: color var(--t-fast);
}

.legal-links a:hover { color: var(--text-1); }

.disclaimer {
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-3);
  text-align: center;
}

/* ──────────────────────────────────────
   18. TOAST NOTIFICATION
────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-1);
  z-index: 1000;
  transition: transform 0.4s var(--ease), opacity 0.4s;
  opacity: 0;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-icon { color: #00C864; }

/* ──────────────────────────────────────
   19. RESPONSIVE – TABLET (768px)
────────────────────────────────────── */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lang-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .steps-grid {
    flex-direction: column;
    gap: 20px;
  }

  .step-connector {
    display: none;
  }

  .seo-text-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }

  /* Push lang + theme + hamburger to the right when nav is hidden */
  .header-actions { margin-left: auto; }

  .mobile-nav.open {
    display: flex;
  }

  /* ── iOS input zoom fix: font-size must be ≥ 16px ── */
  .url-input {
    font-size: 16px;
  }

  .converter-form {
    flex-direction: column;
    gap: 10px;
  }

  .convert-btn {
    padding: 14px;
    height: 52px;
    justify-content: center;
  }

  .hero {
    padding: 60px 0 80px;
  }

  .hero-title {
    letter-spacing: -1px;
  }

  .video-preview {
    flex-direction: column;
  }

  .thumbnail-wrap {
    width: 100%;
    height: 180px;
  }

  /* ── Touch-friendly quality buttons ── */
  .quality-btn {
    min-height: 54px;
    padding: 10px 8px;
  }

  /* ── Tab buttons easier to tap ── */
  .tab-btn {
    padding: 10px 18px;
    min-height: 44px;
  }

  .stats-bar .stat-sep { display: none; }
  .stats-grid { gap: 20px; }
  .stat-block { padding: 0 16px; }

  .how-it-works,
  .features,
  .formats-section,
  .faq,
  .multilingual-section,
  .seo-content { padding: 64px 0; }

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

  .features-grid {
    grid-template-columns: 1fr;
  }

  .lang-cards-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .legal-links {
    flex-wrap: wrap;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 14px; }

  .hero-badge { font-size: 0.72rem; }

  /* Larger input padding on small phones */
  .url-input {
    font-size: 16px;
    padding: 14px 72px 14px 40px;
  }

  /* Full-width quality grid: 2 cols */
  .quality-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .quality-btn {
    min-height: 58px;
  }

  .format-tabs { width: 100%; }
  .tab-btn { flex: 1; justify-content: center; }

  .formats-hint { display: none; }

  .stat-number { font-size: 1.5rem; }

  /* Tighter converter card on small phones */
  .converter-card {
    padding: 20px 16px;
  }

  /* Hero title smaller on tiny screens */
  .hero-title {
    font-size: clamp(1.6rem, 6vw, 2.5rem);
  }

  /* Download progress bar easier to read */
  .download-progress {
    margin-top: 12px;
  }
}

/* ──────────────────────────────────────
   20. ANIMATIONS & UTILITIES
────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.pulse { animation: pulse 2s ease-in-out infinite; }

/* Smooth scroll offset for sticky header */
:target { scroll-margin-top: 80px; }

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Selection color */
::selection {
  background: var(--red-glow);
  color: var(--text-1);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--red); }
