/* ==========================================================================
   Woocommerce DB Optimizer — Documentation (white theme)
   Same identity as LP: Inter, Spotify Green, pill geometry
   ========================================================================== */

:root {
  --green: #1ed760;
  --green-dark: #1db954;
  --green-tint: #e8faf0;
  --green-border: #b8efd0;

  --ink: #121212;
  --ink-secondary: #535353;
  --ink-muted: #6b6b6b;
  --ink-faint: #9a9a9a;

  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --bg-muted: #f5f5f5;
  --bg-code: #f3f4f6;

  --line: #e8e8e8;
  --line-strong: #d4d4d4;

  --negative: #d93025;
  --warning: #e37400;
  --info: #2563eb;

  --sidebar-w: 280px;
  --header-h: 64px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: Inter, "Helvetica Neue", helvetica, arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--green-dark);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--green); }

/* ---- Skip link ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 200;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--green);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 700;
}
.skip-link:focus {
  left: 1rem;
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---- Top header --------------------------------------------------------- */
.docs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.docs-header__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9375rem;
}
.docs-header__brand:hover { color: var(--green-dark); }
.docs-header__brand img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.docs-header__brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.docs-header__sep {
  width: 1px;
  height: 20px;
  background: var(--line);
  flex-shrink: 0;
}

.docs-header__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

.docs-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.docs-search {
  position: relative;
  display: none;
}
@media (min-width: 640px) {
  .docs-search { display: block; }
}
.docs-search input {
  width: 220px;
  padding: 0.5rem 0.875rem 0.5rem 2.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  font-size: 0.8125rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.docs-search input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 215, 96, 0.15);
  background: var(--bg);
}
.docs-search input::placeholder { color: var(--ink-faint); }
.docs-search svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-faint);
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn--primary {
  background: var(--green);
  color: var(--ink);
}
.btn--primary:hover {
  filter: brightness(1.05);
  color: var(--ink);
}
.btn--ghost {
  background: transparent;
  color: var(--ink-secondary);
  border: 1px solid var(--line-strong);
}
.btn--ghost:hover {
  background: var(--bg-muted);
  color: var(--ink);
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}
@media (min-width: 1024px) {
  .menu-toggle { display: none; }
}

/* ---- Layout ------------------------------------------------------------- */
.docs-shell {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

.docs-sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  overflow-y: auto;
  padding: 1.5rem 1rem 2rem;
  background: var(--bg-subtle);
  border-right: 1px solid var(--line);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 90;
}
.docs-sidebar.is-open { transform: translateX(0); }
@media (min-width: 1024px) {
  .docs-sidebar {
    transform: none;
  }
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-h);
  background: rgba(18, 18, 18, 0.3);
  z-index: 80;
}
.sidebar-backdrop.is-visible { display: block; }
@media (min-width: 1024px) {
  .sidebar-backdrop { display: none !important; }
}

.nav-group { margin-bottom: 1.5rem; }
.nav-group__title {
  margin: 0 0 0.5rem;
  padding: 0 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.nav-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-group a {
  display: block;
  padding: 0.4375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-group a:hover {
  background: rgba(18, 18, 18, 0.04);
  color: var(--ink);
}
.nav-group a.is-active {
  background: var(--green-tint);
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--green);
}
.nav-group a.is-hidden { display: none; }

.badge-pro {
  display: inline-block;
  margin-left: 0.375rem;
  padding: 0.0625rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--green-tint);
  color: var(--green-dark);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

/* ---- Main content ------------------------------------------------------- */
.docs-main {
  flex: 1;
  min-width: 0;
  margin-left: 0;
}
@media (min-width: 1024px) {
  .docs-main { margin-left: var(--sidebar-w); }
}

.docs-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.docs-content--wide {
  max-width: 960px;
}

/* ---- Typography --------------------------------------------------------- */
.docs-content h1 {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.docs-content h2 {
  margin: 2.5rem 0 0.875rem;
  padding-top: 0.5rem;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.docs-content h3 {
  margin: 1.75rem 0 0.625rem;
  font-size: 1.0625rem;
  font-weight: 700;
}
.docs-content p { margin: 0 0 1rem; color: var(--ink-secondary); }
.docs-content ul, .docs-content ol {
  margin: 0 0 1rem;
  padding-left: 1.375rem;
  color: var(--ink-secondary);
}
.docs-content li { margin-bottom: 0.375rem; }
.docs-content li strong { color: var(--ink); }
.docs-content hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.lead {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-muted);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green-dark);
}

/* ---- Components --------------------------------------------------------- */
.callout {
  padding: 1rem 1.125rem;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  font-size: 0.9375rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout--tip {
  border-color: var(--green-border);
  background: var(--green-tint);
}
.callout--warning {
  border-color: #fcd9a0;
  background: #fff8ed;
}
.callout--info {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.callout__title {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--ink);
}

code, .code-inline {
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  background: var(--bg-code);
  font-size: 0.875em;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color: var(--ink);
}

pre {
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: #e5e5e5;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.55;
}
pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

table {
  width: 100%;
  margin: 1rem 0 1.5rem;
  border-collapse: collapse;
  font-size: 0.875rem;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th {
  font-weight: 700;
  color: var(--ink);
  background: var(--bg-muted);
}
td { color: var(--ink-secondary); }

.card-grid {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
}
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

.doc-card {
  display: block;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  color: inherit;
}
.doc-card:hover {
  border-color: var(--green-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}
.doc-card h3 {
  margin: 0 0 0.375rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.doc-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.5;
}
.doc-card__arrow {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green-dark);
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.steps li {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.25rem;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 700;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.pill-list li {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  border: 1px solid var(--line);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-secondary);
  margin: 0;
}

/* ---- Footer ------------------------------------------------------------- */
.docs-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}
.docs-footer a { color: var(--ink-secondary); font-weight: 600; }
.docs-footer a:hover { color: var(--green-dark); }

.nav-prev-next {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.nav-prev-next a {
  flex: 1;
  max-width: 48%;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  font-size: 0.875rem;
}
.nav-prev-next a:hover {
  border-color: var(--green-border);
  background: var(--green-tint);
}
.nav-prev-next .label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-faint);
  margin-bottom: 0.25rem;
}
.nav-prev-next .title {
  font-weight: 700;
  color: var(--ink);
}
.nav-prev-next .next { text-align: right; margin-left: auto; }
