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

:root {
  --accent: #6c63ff;
  --accent-dark: #574fd6;
  --danger: #e53e3e;
  --success: #38a169;
  --text: #1a202c;
  --muted: #718096;
  --border: #e2e8f0;
  --bg: #ffffff;
  --card: #f7f8fc;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Layout helpers ── */
.container {
  width: 100%;
  max-width: 680px;
  padding: 0 20px;
}

/* ── Navigation ── */
.site-nav {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 0;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav-logo {
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  margin-right: 8px;
  white-space: nowrap;
  letter-spacing: -.3px;
}
.nav-logo span { color: var(--accent); }
.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 6px;
  flex-shrink: 0;
}
.nav-link {
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 20px;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
}
.nav-link:hover { color: var(--text); background: var(--card); }
.nav-link.active { color: var(--accent); background: #f0eeff; }

/* ── Ad slot base ── */
.ad-slot {
  width: 100%;
  margin: 24px auto;
}

/* Jolanda quote card */
.jolanda-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  max-width: 728px;
  margin: 0 auto;
}
.jolanda-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #cbd5e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #a0aec0;
}
.jolanda-body { flex: 1; }
.jolanda-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.jolanda-quote {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  font-style: italic;
}
.jolanda-tag {
  font-size: 10px;
  color: #b0bec5;
  margin-top: 4px;
}

.ad-leaderboard .jolanda-card { min-height: 80px; }
.ad-rectangle {
  display: flex;
  justify-content: center;
}
.ad-rectangle .jolanda-card {
  max-width: 400px;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  gap: 10px;
}
.ad-rectangle .jolanda-avatar {
  width: 60px;
  height: 60px;
  font-size: 28px;
}

/* ── Header ── */
header {
  width: 100%;
  padding: 40px 20px 0;
  text-align: center;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.logo-text {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.5px;
}
.logo-text span { color: var(--accent); }
.page-title {
  font-size: 22px;
  font-weight: 800;
  margin-top: 16px;
  line-height: 1.3;
  color: var(--text);
}
.tagline {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

/* Platform badges */
.platforms {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: .02em;
}
.badge-yt  { background: #fff0f0; color: #c53030; }
.badge-ig  { background: #fff0f7; color: #b83280; }
.badge-tt  { background: #f0fff4; color: #276749; }
.badge-fb  { background: #ebf4ff; color: #2b6cb0; }
.badge-tw  { background: #e8f8ff; color: #0987a0; }

/* ── Main card ── */
main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 0;
}
.card {
  width: 100%;
  max-width: 640px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 32px;
}

/* URL input row */
.input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.url-wrapper {
  flex: 1;
  position: relative;
}
.url-wrapper .platform-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  pointer-events: none;
  transition: opacity .2s;
}
#url-input {
  width: 100%;
  height: 52px;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0 14px 0 44px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
  color: var(--text);
  background: var(--bg);
}
#url-input:focus { border-color: var(--accent); }
#url-input::placeholder { color: #b0bec5; }

#fetch-btn {
  height: 52px;
  padding: 0 22px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
#fetch-btn:hover  { background: var(--accent-dark); }
#fetch-btn:active { transform: scale(.97); }
#fetch-btn:disabled { background: #a0aec0; cursor: not-allowed; }

/* Video info preview */
#video-info {
  display: none;
  margin-top: 24px;
}
.video-preview {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.video-thumb {
  flex-shrink: 0;
  width: 96px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--border);
}
.video-meta { flex: 1; }
.video-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 4px;
}
.video-sub {
  font-size: 13px;
  color: var(--muted);
}

/* Format selector */
.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.toggle-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.toggle-btn {
  flex: 1;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.toggle-btn.active {
  border-color: var(--accent);
  background: #f0eeff;
  color: var(--accent);
}
.toggle-btn:hover:not(.active) { border-color: #cbd5e0; color: var(--text); }

.quality-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.quality-btn {
  padding: 7px 18px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
}
.quality-btn:hover { border-color: var(--accent); color: var(--accent); }
.quality-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Download button */
#download-btn {
  width: 100%;
  height: 52px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#download-btn:hover  { background: var(--accent-dark); }
#download-btn:active { transform: scale(.98); }
#download-btn:disabled { background: #a0aec0; cursor: not-allowed; }

/* Status / error messages */
.msg {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}
.msg.error   { background: #fff5f5; border: 1px solid #fed7d7; color: var(--danger); display: block; }
.msg.success { background: #f0fff4; border: 1px solid #c6f6d5; color: var(--success); display: block; }
.msg.info    { background: #ebf4ff; border: 1px solid #bee3f8; color: #2b6cb0;       display: block; }

/* Loading spinner */
.spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SEO content section ── */
.seo-section {
  width: 100%;
  max-width: 640px;
  margin: 36px auto 0;
  padding: 0 20px;
}
.seo-section h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.seo-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 20px 0 6px;
  color: var(--text);
}
.seo-section p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 8px;
}
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.steps li {
  counter-increment: step;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.faq { margin-top: 8px; }
.faq-item {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}
.faq-item:last-child { border-bottom: 1px solid var(--border); }
.faq-q {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.faq-a {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Footer ── */
footer {
  width: 100%;
  margin-top: auto;
  padding: 32px 20px 16px;
  text-align: center;
  font-size: 12px;
  color: #b0bec5;
}
footer a { color: #b0bec5; text-decoration: underline; }
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 12px;
  font-size: 13px;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.footer-links a:hover { color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 500px) {
  .card { padding: 20px 16px; }
  .input-row { flex-direction: column; }
  #fetch-btn { width: 100%; }
  .jolanda-card { padding: 12px 14px; gap: 10px; }
  .page-title { font-size: 18px; }
}
