/* ===== VidsSave-inspired light theme ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #ef4444;
  --primary-dark: #dc2626;
  --primary-light: #fef2f2;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-muted: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --accent: var(--primary);
  --max-width: 960px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ===== Top Navigation ===== */
.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  width: 210px;
  height: 52px;
  object-fit: contain;
  object-position: left center;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

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

.nav-dropdown { position: relative; }

.nav-link-drop svg { transition: transform 0.2s; }

.nav-dropdown:hover .nav-link-drop svg { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s;
  z-index: 50;
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.dropdown-menu a {
  display: block;
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  color: var(--text);
  border-radius: 8px;
  transition: background 0.15s;
}

.dropdown-menu a:hover {
  background: var(--bg-muted);
  color: var(--primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ===== Main Content ===== */
.main-content { min-height: calc(100vh - 200px); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 100%);
  padding: 3.5rem 1.25rem 2.5rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* ===== Download Box ===== */
.download-box {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 0.5rem;
}

.download-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 1rem 1.15rem;
  font-size: 0.95rem;
  color: var(--text);
  background: transparent;
  min-width: 0;
}

.download-box input::placeholder { color: #94a3b8; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.75rem;
  min-height: 52px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ===== Platform Pills ===== */
.platform-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.platform-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.platform-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.platform-pill .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-youtube { background: #ff0000; }
.dot-instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.dot-facebook { background: #1877f2; }
.dot-tiktok { background: #000; }

/* ===== Page Header (platform pages) ===== */
.page-hero {
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 100%);
  padding: 2.5rem 1.25rem 2rem;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.page-hero p {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
}

/* ===== Mode Tabs ===== */
.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.5rem auto 0;
  max-width: 720px;
}

.mode-tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  transition: all 0.2s;
}

.mode-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.mode-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ===== Download Card ===== */
.download-section {
  padding: 2rem 1.25rem 3rem;
}

.download-card {
  max-width: 720px;
  margin: 0 auto;
}

/* ===== Results ===== */
.result-area {
  max-width: 720px;
  margin: 1.5rem auto 0;
  display: none;
}

.result-area.visible { display: block; }

.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.result-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.video-preview img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
  background: var(--bg-muted);
}

.video-info {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.video-info h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 0.25rem;
}

.video-info p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.format-list { padding: 0.75rem; }

.format-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  transition: background 0.15s;
}

.format-row:hover { background: var(--bg-soft); }

.format-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.format-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.btn-download-file {
  padding: 0.55rem 1.35rem;
  background: #ef4444;
  color: #fff !important;
  border: none;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  display: inline-block;
  text-decoration: none;
}

.btn-download-file:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* ===== Features Section ===== */
.section {
  padding: 3.5rem 1.25rem;
}

.section-alt { background: var(--bg-soft); }

.section-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.section-alt .feature-card { box-shadow: var(--shadow-sm); }

.feature-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

/* ===== Steps ===== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.step-item { text-align: center; }

.step-num {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto 0.75rem;
}

.step-item h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.step-item p {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* ===== FAQ ===== */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  background: var(--bg);
}

.faq-item summary {
  padding: 1rem 1.15rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 400;
}

.faq-item[open] summary::after { content: '−'; }

.faq-item p {
  padding: 0 1.15rem 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ===== Platform Cards Grid ===== */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  max-width: 900px;
  margin: 0 auto;
}

.platform-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.25rem;
  text-align: center;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.platform-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.platform-card-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.platform-card.youtube .platform-card-icon { background: #fee2e2; color: #ff0000; }
.platform-card.instagram .platform-card-icon { background: #fce7f3; color: #e1306c; }
.platform-card.facebook .platform-card-icon { background: #dbeafe; color: #1877f2; }
.platform-card.tiktok .platform-card-icon { background: #f1f5f9; color: #000; }

.platform-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.platform-card p {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.platform-card-link {
  display: inline-block;
  padding: 0.45rem 1rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 8px;
  font-size: 0.825rem;
  font-weight: 600;
}

/* ===== Spinner ===== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.25rem;
  margin-top: 2rem;
}

.footer-inner { max-width: 1100px; margin: 0 auto; }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  transition: color 0.15s;
}

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

.footer-copy {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ===== Platform accent overrides ===== */
.page-youtube { --accent: #ff0000; --primary: #ff0000; --primary-dark: #cc0000; --primary-light: #fef2f2; }
.page-instagram { --accent: #e1306c; --primary: #e1306c; --primary-dark: #be185d; --primary-light: #fdf2f8; }
.page-facebook { --accent: #1877f2; --primary: #1877f2; --primary-dark: #1565c0; --primary-light: #eff6ff; }
.page-tiktok { --accent: #000; --primary: #000; --primary-dark: #333; --primary-light: #f8fafc; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }

  .main-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 0.25rem;
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

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

  .nav-dropdown .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0 0 0 1rem;
    display: none;
  }

  .nav-dropdown.open .dropdown-menu { display: block; }

  .nav-link-drop { width: 100%; justify-content: space-between; }
}

@media (max-width: 600px) {
  .download-box { flex-direction: column; padding: 0.75rem; }
  .download-box input { padding: 0.75rem; }
  .btn-primary { width: 100%; min-height: 48px; }
  .format-row { flex-wrap: wrap; }
}

body.embed {
  min-height: 0;
  background: transparent;
}
body.embed .main-content {
  padding-top: 0;
}

.dot-x { background: #111; }
.platform-card.x { color: #111; }
.platform-card.x .platform-card-icon { font-size: 36px; font-weight: 700; }
