/* =============================================
   X-Downloader — Deep Monochrome + Cyan Edge
   =============================================
   Color strategy: Restrained (one accent ≤10%)
   Palette: Deep cool near-black body, cyan accent
   Typography: Outfit (single family, all weights)
   ============================================= */

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

body, button, input, select, textarea {
  font-family: 'Outfit', sans-serif; /* font for text, not for icon fonts */
}

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

/* ---------- Design Tokens ---------- */
:root {
  /* Core backgrounds — deep, cool, near-black */
  --bg-primary: #06060e;
  --bg-secondary: #0a0a16;
  --bg-tertiary: #0e0e1e;
  --bg-elevated: #13132a;
  --card-bg: #0e0e20;
  --card-border: rgba(255, 255, 255, 0.06);
  --card-border-hover: rgba(255, 255, 255, 0.10);

  /* Cyan accent — primary brand color */
  --accent: #06b6d4;
  --accent-hover: #22d3ee;
  --accent-subtle: rgba(6, 182, 212, 0.08);
  --accent-mid: rgba(6, 182, 212, 0.15);
  --accent-strong: rgba(6, 182, 212, 0.25);
  --accent-glow: 0 0 24px rgba(6, 182, 212, 0.12);

  /* Secondary accents — for per-item variety in sections */
  --purple: #8b5cf6;
  --pink: #ec4899;
  --rose: #f43f5e;
  --emerald: #10b981;
  --amber: #f59e0b;

  /* Text — cool slate scale */
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #7a8aa2;

  /* Functional */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.55);

  /* Z-index scale:
     nav-header:    100
     mobile-nav:     99
     modal-backdrop: 1000
     modal        :  1001
     toast        :  2000  */
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { opacity: 0.8; }

/* ---------- Body ---------- */
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ---------- Skip-to-Content Link ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 2000;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  border-radius: 0 0 10px 0;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

/* ---------- Utility ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.max-width-md { max-width: 800px; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* ---------- App Header ---------- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(6, 6, 14, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}

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

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.05rem;
  color: #fff;
  box-shadow: 0 3px 12px rgba(6, 182, 212, 0.35);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s ease;
  position: relative;
  padding: 6px 0;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
  border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- Main Downloader Section ---------- */
.downloader-section {
  padding: 150px 0 80px;
  position: relative;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

.hero-text-area {
  text-align: center;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* ---------- Badge ---------- */
.badge {
  background: var(--accent-subtle);
  border: 1px solid var(--accent-mid);
  color: #67e8f9;
  padding: 5px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  width: fit-content;
  margin-bottom: 6px;
}

/* ---------- Hero Title ---------- */
.hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.2px;
  text-wrap: balance;
}

.accent-underline {
  position: relative;
  display: inline-block;
  color: var(--text-primary);
}

.accent-underline::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.7;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 580px;
  text-wrap: pretty;
}

/* ---------- Downloader Card ---------- */
.downloader-card-wrapper {
  width: 100%;
  max-width: 740px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-md);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.downloader-card-wrapper:has(:focus-within) {
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: var(--shadow-md), var(--accent-glow);
}

.downloader-card {
  width: 100%;
  background: transparent;
  border-radius: 20px;
  padding: 32px;
}

/* ---------- URL Input Form ---------- */
.url-input-form {
  width: 100%;
}

.input-group {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1.5px solid var(--card-border);
  border-radius: 14px;
  padding: 4px 4px 4px 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group:focus-within {
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.08), inset 0 0 12px rgba(6, 182, 212, 0.03);
}

.input-icon {
  font-size: 1.05rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
  margin-right: 12px;
  display: flex;
  align-items: center;
}

.input-group:focus-within .input-icon {
  color: var(--accent);
}

.input-group input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text-primary);
  height: 46px;
}

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

/* ---------- Primary Button ---------- */
.btn-primary {
  background: var(--accent);
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  height: 46px;
  padding: 0 24px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 3px 14px rgba(6, 182, 212, 0.25);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(6, 182, 212, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.2);
}

.btn-primary:disabled,
.btn-primary[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

.btn-icon {
  font-size: 0.85rem;
  transition: transform 0.25s ease;
}

.btn-primary:hover .btn-icon {
  transform: translateX(2px);
}

/* ---------- Loading Spinner ---------- */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 0 10px;
  gap: 18px;
  animation: fadeIn 0.35s ease;
}

.spinner-wrapper {
  position: relative;
  width: 56px;
  height: 56px;
}

.spinner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid rgba(6, 182, 212, 0.1);
  border-top-color: var(--accent);
  animation: spin 0.85s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

.spinner-inner {
  position: absolute;
  top: 7px;
  left: 7px;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  border-radius: 50%;
  border: 3px solid rgba(6, 182, 212, 0.07);
  border-bottom-color: var(--accent);
  animation: spinReverse 1.15s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spinReverse {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

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

/* ---------- Error Container ---------- */
.error-container {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.18);
  padding: 14px 18px;
  border-radius: 12px;
  margin-top: 24px;
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.error-icon {
  font-size: 1.3rem;
  color: var(--error);
  flex-shrink: 0;
  margin-top: 2px;
}

.error-content { flex: 1; }

.error-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn-retry {
  background: transparent;
  border: 1px solid var(--accent-mid);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-retry:hover {
  background: var(--accent-subtle);
  border-color: var(--accent-strong);
}

.btn-retry:active {
  transform: scale(0.97);
}

.error-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fca5a5;
  margin-bottom: 3px;
}

.error-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---------- Result Container ---------- */
.result-container {
  margin-top: 28px;
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.25), transparent);
  margin-bottom: 22px;
}

/* ---------- Tweet Info Card ---------- */
.tweet-info-card {
  background: rgba(6, 6, 14, 0.5);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 22px;
  border-top: 2px solid rgba(6, 182, 212, 0.2);
}

.tweet-author-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
}

.author-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.author-handle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.tweet-badge {
  font-size: 0.72rem;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-mid);
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 600;
  color: #67e8f9;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.tweet-text {
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 14px;
  word-break: break-word;
}

/* Tweet Statistics */
.tweet-stats {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.65rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.tweet-stats span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s ease;
}

.tweet-stats span:hover {
  color: var(--text-secondary);
  cursor: default;
}

.tweet-stats span::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 600;
}

.reply-count::before {
  content: "\f0e5";
  color: var(--accent);
}

.retweet-count::before {
  content: "\f079";
  color: var(--emerald);
}

.favorite-count::before {
  content: "\f004";
  color: var(--rose);
}

/* Media Preview */
.media-preview-container {
  position: relative;
  width: 100%;
  max-height: 360px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-thumbnail {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: cover;
  opacity: 0.88;
  transition: opacity 0.3s ease;
}

.video-thumbnail:hover {
  opacity: 1;
}

.preview-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.play-preview-icon {
  font-size: 3rem;
  color: rgba(6, 182, 212, 0.85);
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.6));
}

/* ---------- Download Options ---------- */
.download-options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.options-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.options-title i {
  color: var(--accent);
}

.options-subtitle {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

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

.fallback-message {
  color: var(--text-secondary);
  font-size: 0.88rem;
  text-align: center;
  padding: 24px 16px;
  line-height: 1.6;
}

/* Download Item */
.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(6, 182, 212, 0.025);
  border: 1px solid rgba(6, 182, 212, 0.1);
  border-radius: 10px;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.download-item:hover {
  background: rgba(6, 182, 212, 0.05);
  border-color: rgba(6, 182, 212, 0.22);
}

.download-quality {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quality-badge {
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(6, 182, 212, 0.12);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.82rem;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.quality-badge.hq {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.quality-badge.mq {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

.quality-badge.lq {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.25);
  color: #fdba74;
}

.file-type {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Download Action Button */
.btn-download-action {
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 8px 16px;
  min-height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 3px 12px rgba(6, 182, 212, 0.2);
}

.btn-download-action:hover {
  background: var(--accent-hover);
  transform: scale(1.03);
  box-shadow: 0 5px 16px rgba(6, 182, 212, 0.3);
}

.btn-download-action:active {
  transform: scale(0.98);
}

/* ---------- Media Group — multiple videos ---------- */
.media-group {
  background: rgba(6, 6, 14, 0.45);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
  animation: slideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(6, 182, 212, 0.035);
  border-bottom: 1px solid var(--card-border);
}

.media-group-thumb {
  width: 72px;
  height: 50px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid var(--card-border);
  background: #000;
  flex-shrink: 0;
}

.media-group-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.media-group-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.media-group-duration {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.media-group-duration i {
  color: var(--accent);
}

.media-group-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 16px 14px;
}

.media-group-items .download-item {
  margin-bottom: 0;
}

.media-group-items .download-item:last-child {
  margin-bottom: 0;
}

/* ---------- Keyframes ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ---------- Section Titles ---------- */
.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
  line-height: 1.2;
  text-wrap: balance;
}

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

/* ---------- How to Use Section ---------- */
.how-to-use-section {
  padding: 90px 0;
  background: linear-gradient(180deg, var(--bg-secondary), transparent);
}

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

.step-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 36px 28px;
  border-radius: 18px;
  text-align: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.step-card:hover {
  border-color: rgba(6, 182, 212, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.step-icon {
  font-size: 2rem;
  margin-bottom: 18px;
  display: inline-block;
}

/* Per-step accent colors */
.step-card:nth-child(1) .step-icon { color: var(--purple); }
.step-card:nth-child(2) .step-icon { color: var(--pink); }
.step-card:nth-child(3) .step-icon { color: var(--accent); }

.step-card:nth-child(1):hover { border-color: rgba(139, 92, 246, 0.25); }
.step-card:nth-child(2):hover { border-color: rgba(236, 72, 153, 0.25); }
.step-card:nth-child(3):hover { border-color: rgba(6, 182, 212, 0.25); }

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

.step-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  text-wrap: pretty;
}

/* ---------- Features Section ---------- */
.features-section {
  padding: 90px 0;
}

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

.feature-item {
  display: flex;
  gap: 18px;
  background: var(--card-bg);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.feature-item:hover {
  border-color: rgba(6, 182, 212, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.feature-icon {
  font-size: 1.4rem;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

/* Per-feature accent colors */
.feature-item:nth-child(1) .feature-icon {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.22);
  color: var(--purple);
}
.feature-item:nth-child(2) .feature-icon {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: var(--emerald);
}
.feature-item:nth-child(3) .feature-icon {
  background: var(--accent-subtle);
  border: 1px solid var(--accent-mid);
  color: var(--accent);
}
.feature-item:nth-child(4) .feature-icon {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: var(--amber);
}

.feature-item:hover .feature-icon {
  transform: scale(1.08);
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

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

/* ---------- FAQ Section ---------- */
.faq-section {
  padding: 90px 0;
  background: linear-gradient(0deg, var(--bg-secondary), transparent);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.faq-item:hover {
  border-color: rgba(6, 182, 212, 0.12);
}

.faq-question {
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: color 0.2s ease, background-color 0.2s ease;
  user-select: none;
  gap: 14px;
}

.faq-question:hover {
  background: rgba(255, 255, 255, 0.015);
}

.faq-item.active .faq-question {
  color: #67e8f9;
}

.faq-icon {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
  flex-shrink: 0;
}

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

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

.faq-answer > p {
  overflow: hidden;
  padding: 0 22px;
}

.faq-item.active .faq-answer {
  grid-template-rows: 1fr;
}

.faq-item.active .faq-answer > p {
  padding-bottom: 18px;
}

/* ---------- Footer ---------- */
.app-footer {
  border-top: 1px solid var(--card-border);
  padding: 36px 0;
  background: rgba(3, 3, 10, 0.8);
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Mobile Nav ---------- */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
  width: 42px;
  height: 42px;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.hamburger-btn.open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
  display: none;
  position: absolute;
  top: 68px;
  left: 0;
  width: 100%;
  background: rgba(6, 6, 14, 0.98);
  border-bottom: 1px solid var(--card-border);
  padding: 10px 20px;
  flex-direction: column;
  gap: 2px;
  z-index: 99;
}

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

.mobile-nav .nav-link {
  display: block;
  padding: 13px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  transition: background 0.2s ease;
}

.mobile-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.03);
}

.mobile-nav .nav-link::after {
  display: none;
}

/* ---------- Focus Visible ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Override for URL input inside focused group */
.input-group:focus-within {
  outline: none;
}

.input-group input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Download item focus ring */
.download-item:has(:focus-visible) {
  border-color: rgba(6, 182, 212, 0.4);
}

/* Retry button focus */
.btn-retry:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: var(--accent-subtle);
}

/* FAQ question keyboard focus */
.faq-question:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 14px;
}

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

  html {
    scroll-behavior: auto !important;
  }

  .spinner,
  .spinner-inner {
    animation-duration: 0.01ms !important;
  }

  .loader-container,
  .result-container,
  .error-container {
    animation: none;
  }

  .input-group,
  .btn-primary,
  .btn-download-action,
  .btn-retry,
  .step-card,
  .feature-item,
  .faq-item,
  .faq-answer,
  .download-item,
  .faq-icon,
  .btn-icon,
  .footer-links a,
  .hamburger-btn,
  .hamburger-line,
  .badge,
  .downloader-card-wrapper {
    transition: none;
  }

  .btn-primary:hover,
  .btn-download-action:hover,
  .step-card:hover,
  .feature-item:hover {
    transform: none !important;
  }

  .feature-item:hover .feature-icon {
    transform: none !important;
  }

  .btn-primary:hover .btn-icon {
    transform: none;
  }

  .download-item:hover {
    transform: none !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .hero-title {
    font-size: 2.4rem;
  }

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

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

  .section-title {
    font-size: 1.8rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }

  .downloader-section {
    padding: 120px 0 60px;
  }

  .downloader-card {
    padding: 22px;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .input-group {
    padding: 3px 3px 3px 12px;
  }

  .input-group input {
    font-size: 0.92rem;
    height: 40px;
  }

  .btn-primary {
    height: 40px;
    padding: 0 14px;
    font-size: 0.88rem;
  }

  .download-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .btn-download-action {
    justify-content: center;
  }

  .section-title {
    font-size: 1.55rem;
  }

  .faq-question {
    font-size: 0.92rem;
    padding: 14px 16px;
  }
}

@media (max-width: 500px) {
  .hero-title {
    font-size: 1.55rem;
    letter-spacing: -0.8px;
  }

  .downloader-card {
    padding: 16px;
  }

  .step-card {
    padding: 28px 18px;
  }

  .feature-item {
    padding: 18px;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  /* Stack input and button vertically on mobile */
  .input-group {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
  }

  .input-group .input-icon {
    display: none;
  }

  .input-group input {
    width: 100%;
    height: 44px;
    font-size: 0.92rem;
    padding: 0 4px;
    border-bottom: 1px solid var(--card-border);
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
    height: 44px;
    font-size: 0.95rem;
  }
}
