/* ═══════════════════════════════════════════════════════════════
   SEODiff — Unified Site Header
   Single source of truth for navigation across all pages.
   Include: <link rel="stylesheet" href="/site-header.css">
   ═══════════════════════════════════════════════════════════════ */

/* ── Base variables (also usable by page content) ── */
:root {
  --sd-bg: #f8fafc;
  --sd-panel: #fff;
  --sd-text: #0f172a;
  --sd-muted: #64748b;
  --sd-border: #e2e8f0;
  --sd-primary: #2563eb;
  --sd-primary-strong: #1d4ed8;
  --sd-font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --sd-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, Monaco, 'Liberation Mono', monospace;
}

/* ── Header bar ── */
.sd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 14px;
  flex-wrap: wrap;
  font-family: var(--sd-font);
}

/* ── Brand / logo ── */
.sd-header-brand {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: #020617;
  text-decoration: none !important;
  flex-shrink: 0;
}
.sd-header-brand:hover {
  text-decoration: none !important;
  color: #020617;
}

/* ── Primary nav links ── */
.sd-header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sd-header-nav a {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sd-muted);
  text-decoration: none !important;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.sd-header-nav a:hover {
  color: var(--sd-text);
  background: rgba(15, 23, 42, 0.04);
  text-decoration: none !important;
}
.sd-header-nav a.active {
  color: var(--sd-primary);
  background: #eff6ff;
  font-weight: 600;
}

/* ── Right-side controls ── */
.sd-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Anonymous: Log in ── */
.sd-header-login {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sd-text);
  text-decoration: none !important;
  transition: background 0.15s ease;
}
.sd-header-login:hover {
  background: rgba(15, 23, 42, 0.04);
  text-decoration: none !important;
}

/* ── Anonymous: Get Started CTA ── */
.sd-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: #020617;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.sd-header-cta:hover {
  background: #1e293b;
  text-decoration: none !important;
  transform: translateY(-0.5px);
}

/* ── Auth: Workspace link ── */
.sd-header-workspace {
  display: none; /* shown by JS when logged in */
}

/* ── Auth: alert bell ── */
.sd-header-bell {
  position: relative;
  display: none; /* shown by JS when logged in */
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--sd-muted);
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
}
.sd-header-bell:hover {
  background: #f1f5f9;
  color: #334155;
}
.sd-header-bell svg {
  width: 18px;
  height: 18px;
}
.sd-header-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Auth: plan pill ── */
.sd-header-plan {
  display: none; /* shown by JS */
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--sd-border);
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.sd-header-plan.pro {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}

/* ── Auth: Account dropdown ── */
.sd-header-account {
  position: relative;
  display: none; /* shown by JS when logged in */
}
.sd-header-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--sd-border);
  background: #fff;
  color: var(--sd-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sd-font);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.sd-header-account-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.sd-header-account-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--sd-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  padding: 6px;
  display: none;
  z-index: 50;
}
.sd-header-account-dropdown.show {
  display: block;
}
.sd-header-account-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  padding: 8px 12px;
  color: #334155;
  font-size: 13px;
  font-family: var(--sd-font);
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.1s ease;
}
.sd-header-account-item:hover {
  background: #f1f5f9;
  color: var(--sd-text);
  text-decoration: none !important;
}
.sd-header-account-item.muted {
  color: var(--sd-muted);
  cursor: default;
  font-size: 12px;
}
.sd-header-account-item.muted:hover {
  background: transparent;
}
.sd-header-account-sep {
  height: 1px;
  margin: 4px 8px;
  background: var(--sd-border);
}
.sd-header-account-item.danger {
  color: #dc2626;
}
.sd-header-account-item.danger:hover {
  background: #fef2f2;
}

/* ── Separator between nav and auth buttons ── */
.sd-header-sep {
  width: 1px;
  height: 20px;
  background: var(--sd-border);
  margin: 0 4px;
  flex-shrink: 0;
}

/* ── Mobile responsive ── */
@media (max-width: 768px) {
  .sd-header {
    padding: 14px 16px 10px;
    gap: 8px;
  }
  .sd-header-nav {
    order: 3;
    width: 100%;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sd-header-nav::-webkit-scrollbar {
    display: none;
  }
  .sd-header-right {
    margin-left: auto;
  }
  .sd-header-sep {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Standard page background — light gradient matching landing
   Apply to <body> or override in page-specific styles.
   ═══════════════════════════════════════════════════════════════ */
.sd-page-bg {
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(14, 165, 233, 0.12), transparent 60%),
    radial-gradient(800px 500px at 85% 120px, rgba(37, 99, 235, 0.10), transparent 70%),
    var(--sd-bg);
}

/* Simpler background for content-heavy pages (docs, whitepapers) */
.sd-page-bg-subtle {
  background: var(--sd-bg);
}
