/* ===================================================================
   TubeSwift - Ultra-Modern Video & Audio Downloader Design System
   Aesthetics: Glassmorphism, Neon Gradients, Polished Micro-Interactions
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Dark Theme Tokens (Default) */
  --bg-primary: #090c14;
  --bg-secondary: #0f1422;
  --bg-card: rgba(18, 24, 38, 0.78);
  --bg-card-hover: rgba(26, 34, 52, 0.88);
  --bg-input: rgba(13, 17, 28, 0.85);
  
  --primary: #ff0055;
  --primary-hover: #ff2a70;
  --primary-glow: rgba(255, 0, 85, 0.35);
  --accent: #6366f1;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  
  --gradient-main: linear-gradient(135deg, #ff0055 0%, #7928ca 50%, #4338ca 100%);
  --gradient-btn: linear-gradient(135deg, #ff0055 0%, #e11d48 100%);
  --gradient-audio: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --gradient-text: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
  --gradient-hero-title: linear-gradient(135deg, #ffffff 20%, #ff80aa 60%, #a78bfa 100%);

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 0, 85, 0.5);
  --card-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.07);
  --glow-shadow: 0 0 35px -5px var(--primary-glow);
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-input: #ffffff;
  
  --primary: #e11d48;
  --primary-hover: #be123c;
  --primary-glow: rgba(225, 29, 72, 0.25);
  
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --border-subtle: rgba(0, 0, 0, 0.09);
  --border-focus: rgba(225, 29, 72, 0.4);
  --card-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --gradient-hero-title: linear-gradient(135deg, #0f172a 20%, #e11d48 70%, #6366f1 100%);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.text-center {
  text-align: center !important;
}

/* Background Atmosphere Glows */
.ambient-glow-1 {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 0, 85, 0.12) 0%, rgba(99, 102, 241, 0.08) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}

.ambient-glow-2 {
  position: absolute;
  top: 800px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.07) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  filter: blur(90px);
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

@media (min-width: 1920px) {
  .container {
    max-width: 1380px;
  }
}

/* Sticky Skyscraper Desktop Gutter Ads (Left & Right) */
.skyscraper-ad {
  position: fixed;
  top: 90px;
  z-index: 90;
  display: none;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.3s ease;
}

.skyscraper-left {
  left: max(18px, calc((100vw - 1280px) / 2 - 185px));
}

.skyscraper-right {
  right: max(18px, calc((100vw - 1280px) / 2 - 185px));
}

@media (min-width: 1920px) {
  .skyscraper-left {
    left: max(24px, calc((100vw - 1400px) / 2 - 200px));
  }
  .skyscraper-right {
    right: max(24px, calc((100vw - 1400px) / 2 - 200px));
  }
}

@media (min-width: 2400px) {
  .skyscraper-left {
    left: max(40px, calc((100vw - 1420px) / 2 - 320px));
  }
  .skyscraper-right {
    right: max(40px, calc((100vw - 1420px) / 2 - 320px));
  }
  .ad-box.skyscraper {
    width: 280px;
    min-height: 600px;
  }
}

@media (min-width: 1440px) {
  .skyscraper-ad {
    display: flex;
  }
}

.ad-box.skyscraper {
  width: 160px;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 12px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.ad-box.skyscraper:hover {
  border-color: var(--border-focus);
}

/* Navigation Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 12, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.3s ease;
}

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

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

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.5px;
}

.logo-badge {
  background: var(--gradient-btn);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px var(--primary-glow);
  color: #fff;
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  border-bottom: 2px solid var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

/* Advertisement Slot (IAB Standard - Google AdSense Ready) */
.ad-slot-wrapper {
  margin: 24px auto;
  text-align: center;
  position: relative;
  z-index: 2;
}

.ad-label {
  font-size: 0.68rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

.ad-box {
  margin: 0 auto;
  background: rgba(18, 24, 38, 0.4);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: var(--transition);
}

.ad-box.leaderboard {
  max-width: 728px;
  min-height: 90px;
}

.ad-box.rectangle {
  max-width: 300px;
  min-height: 250px;
}

.ad-box.mobile-banner {
  max-width: 320px;
  min-height: 50px;
}

/* Hero Section */
.hero-section {
  padding: 48px 0 32px 0;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 0, 85, 0.1);
  border: 1px solid rgba(255, 0, 85, 0.25);
  color: #ff3377;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}

[data-theme="light"] .hero-pill {
  background: rgba(225, 29, 72, 0.08);
  color: #e11d48;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.15;
  background: var(--gradient-hero-title);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 36px auto;
  line-height: 1.55;
}

/* Downloader Card Box */
.downloader-box {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--card-shadow), var(--glow-shadow);
  border: 1px solid var(--border-subtle);
  max-width: 820px;
  margin: 0 auto 24px auto;
  position: relative;
  transition: var(--transition);
}

.input-group-wrapper {
  display: flex;
  gap: 12px;
  position: relative;
}

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

.input-icon {
  position: absolute;
  left: 18px;
  color: var(--text-muted);
  font-size: 1.25rem;
  pointer-events: none;
}

.url-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 110px 18px 52px;
  font-size: 1.05rem;
  color: var(--text-main);
  outline: none;
  font-family: var(--font-body);
  transition: var(--transition);
}

.url-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 0, 85, 0.18);
}

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

/* Quick Paste Button inside input */
.btn-paste {
  position: absolute;
  right: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-paste:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* Main Action Download Button */
.btn-download-main {
  background: var(--gradient-btn);
  color: #fff;
  border: none;
  padding: 0 32px;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: -0.2px;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--primary-glow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  min-width: 160px;
}

.btn-download-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 0, 85, 0.5);
}

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

/* Helper tips under input */
.downloader-tips {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.downloader-tips a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.downloader-tips a:hover {
  text-decoration: underline;
}

/* Micro badges row */
.micro-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 28px;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.badge-item svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* Status & Loading Spinner */
.status-container {
  display: none;
  margin: 24px auto 0 auto;
  text-align: center;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3.5px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px auto;
}

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

.status-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Error Alert Box */
.alert-box {
  display: none;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 20px;
  font-size: 0.92rem;
  text-align: left;
  align-items: flex-start;
  gap: 12px;
}

/* Result Card Container */
.result-card {
  display: none;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--card-shadow);
  max-width: 820px;
  margin: 24px auto 0 auto;
  text-align: left;
  animation: fadeIn 0.4s ease;
}

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

.result-header {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.thumbnail-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  aspect-ratio: 16/9;
  background: #000;
}

.thumbnail-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.duration-pill {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

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

.video-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.video-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.meta-tag a {
  color: inherit;
  text-decoration: none;
}

.meta-tag a:hover {
  color: var(--primary);
}

/* Quick Tools Row (QR Code, Copy, Audio Preview) */
.quick-tools-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.btn-tool {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-tool:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary);
}

/* Quality Dropdown Selector Box (SnapYT Competitor Match) */
.quality-selector-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin: 20px 0 24px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.selector-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.selector-label svg {
  color: var(--primary);
}

.options-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

.selector-controls {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.select-dropdown-wrapper {
  position: relative;
  flex: 1;
}

.quality-dropdown {
  width: 100%;
  height: 52px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 44px 0 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.quality-dropdown:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 0, 85, 0.18);
}

.quality-dropdown optgroup {
  background: var(--bg-card);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 8px 0;
}

.quality-dropdown option {
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 10px 14px;
}

.select-arrow-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.btn-download-selected {
  background: var(--gradient-btn);
  color: #fff;
  border: none;
  height: 52px;
  padding: 0 28px;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: -0.2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px var(--primary-glow);
  transition: var(--transition);
  white-space: nowrap;
}

.btn-download-selected:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 8px 24px rgba(255, 0, 85, 0.5);
}

.btn-download-selected:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.selected-summary-tip {
  margin-top: 12px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  flex-shrink: 0;
}

/* Format Switch Tabs */
.format-tabs-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0 16px 0;
  padding-bottom: 2px;
}

.format-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
  min-width: max-content;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.tab-btn.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border-bottom: 2px solid var(--primary);
}

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

.tab-count {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 4px;
}

/* Format Table / Grid */
.format-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.format-row {
  display: grid;
  grid-template-columns: 1fr 140px 140px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  transition: var(--transition);
}

.format-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.format-detail {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.quality-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  letter-spacing: 0.2px;
}

.quality-badge.badge-4k {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.quality-badge.badge-2k {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.08);
}

.quality-badge.fhd,
.quality-badge.badge-1080p {
  color: #ff3377;
  border-color: rgba(255, 0, 85, 0.35);
  background: rgba(255, 0, 85, 0.08);
}

.quality-badge.badge-720p {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

.quality-badge.audio,
.quality-badge.badge-mp3 {
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.quality-badge.badge-native-audio {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

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

.btn-download-stream {
  background: var(--gradient-btn);
  color: #fff;
  border: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-download-stream:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-download-stream.audio-btn {
  background: var(--gradient-audio);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

@media (max-width: 640px) {
  .selector-controls {
    flex-direction: column;
  }
  .btn-download-selected {
    width: 100%;
  }
  .format-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .format-size {
    display: none;
  }
}

/* History Section */
.history-section {
  max-width: 820px;
  margin: 32px auto 0 auto;
  display: none;
}

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

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

.btn-clear-history {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
}

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

.history-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.history-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.history-thumb {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.history-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Features Section (SEO & Conversion) */
.features-section {
  padding: 70px 0;
  text-align: center;
}

.section-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 14px;
  letter-spacing: -0.8px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 48px auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: left;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.feature-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(255, 0, 85, 0.12);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.feature-icon-wrapper.cyan {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
}

.feature-icon-wrapper.purple {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent);
}

.feature-icon-wrapper.green {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
}

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

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

/* How It Works (Google HowTo Schema Ready) */
.how-section {
  padding: 56px 48px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  margin: 50px auto;
  text-align: center;
}

@media (max-width: 768px) {
  .how-section {
    padding: 32px 20px;
    margin: 32px auto;
  }
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  position: relative;
  text-align: left;
}

.step-number {
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.08);
  line-height: 1;
}

[data-theme="light"] .step-number {
  color: rgba(0, 0, 0, 0.08);
}

.step-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

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

/* Rich Content & Devices Guide (SEO Dominance) */
.content-guide-section {
  padding: 70px 0;
}

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

.guide-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.guide-box h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-box p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  margin-bottom: 14px;
}

.guide-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.guide-list li svg {
  color: var(--accent-green);
  flex-shrink: 0;
  margin-top: 3px;
}

/* FAQ Accordion Section (FAQPage Schema Ready) */
.faq-section {
  padding: 70px 0;
  text-align: center;
}

.faq-section .section-label,
.faq-section .section-title,
.faq-section .section-subtitle {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.faq-container {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

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

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

.faq-chevron {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

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

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 24px;
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  padding: 0 24px 20px 24px;
  max-height: 400px;
}

/* Compliance & Legal Notice Bar */
.compliance-banner {
  background: rgba(255, 0, 85, 0.05);
  border: 1px solid rgba(255, 0, 85, 0.18);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 40px auto;
  max-width: 880px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  text-align: left;
}

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

.compliance-text h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

.compliance-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Modal: QR Code to Mobile */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  padding: 32px;
  text-align: center;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.3s ease;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.qr-display-box {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  display: inline-block;
  margin: 20px auto;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}

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

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

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

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 14px;
  max-width: 320px;
}

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

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: var(--transition);
}

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

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

/* Responsive Media Queries */
@media (max-width: 900px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

/* Competitor Comparison Section & Matrix */
.comparison-section {
  max-width: 980px;
  margin: 56px auto;
  padding: 0 16px;
  text-align: center;
}

.table-responsive-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  box-shadow: var(--card-shadow);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.comparison-table th {
  padding: 18px 20px;
  background: var(--bg-secondary);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 700;
  border-bottom: 2px solid var(--border-subtle);
  white-space: nowrap;
}

.comparison-table th.featured-col {
  background: rgba(255, 0, 85, 0.12);
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.comparison-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

.comparison-table td.featured-col {
  background: rgba(255, 0, 85, 0.04);
  font-weight: 700;
  color: var(--text-main);
}

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

.check-icon {
  color: #10b981;
  font-weight: 800;
  margin-right: 6px;
}

.cross-icon {
  color: #ef4444;
  font-weight: 800;
  margin-right: 6px;
}

/* Deep Keyword SEO Content Grid */
.seo-keyword-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 24px;
  max-width: 1100px;
  margin: 48px auto;
  padding: 0 16px;
}

.seo-card {
  flex: 1 1 300px;
  max-width: 340px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  text-align: left;
}

.seo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.seo-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.35;
}

.seo-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .header-inner {
    height: 64px;
  }
  .nav-links {
    display: none; /* Mobile menu can be toggled */
  }
  .downloader-box {
    padding: 20px 16px;
  }
  .input-group-wrapper {
    flex-direction: column;
  }
  .btn-download-main {
    width: 100%;
    padding: 16px;
  }
  .result-header {
    grid-template-columns: 1fr;
  }
  .format-row {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: center;
  }
  .format-detail {
    justify-content: center;
  }
  .btn-download-stream {
    width: 100%;
  }
  .footer-top {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
