/*
 * Product of Scalovate Systems Solutions
 * Web: www.scalovate.com
 * Email: support@scalovate.com
 */

:root {
  --docs-sidebar-w: 280px;
  --docs-header-h: 64px;
}

.docs-body {
  background: #fff;
}

/* ── Docs header ── */
.docs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--docs-header-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.docs-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 20px;
}

.docs-header .brand-lockup {
  flex-shrink: 0;
}

.docs-header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.docs-header-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color 0.2s;
}

.docs-header-nav a:hover,
.docs-header-nav a.is-active {
  color: var(--primary);
}

.docs-search-wrap {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.docs-search {
  width: 100%;
  padding: 10px 14px 10px 38px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.docs-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.docs-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.docs-sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.docs-sidebar-toggle:hover {
  background: var(--surface-tint);
  border-color: var(--border-strong);
}

.docs-sidebar-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Layout ── */
.docs-shell {
  display: flex;
  padding-top: var(--docs-header-h);
  min-height: 100vh;
}

.docs-sidebar {
  position: fixed;
  top: var(--docs-header-h);
  left: 0;
  width: var(--docs-sidebar-w);
  height: calc(100vh - var(--docs-header-h));
  overflow-y: auto;
  padding: 24px 16px 48px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  z-index: 50;
}

.docs-sidebar-group {
  margin-bottom: 24px;
}

.docs-sidebar-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0 12px;
  margin-bottom: 8px;
}

.docs-sidebar a {
  display: block;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}

.docs-sidebar a:hover {
  background: var(--surface-tint);
  color: var(--primary);
}

.docs-sidebar a.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.docs-sidebar a.is-hidden-by-search {
  display: none;
}

.docs-main {
  flex: 1;
  margin-left: var(--docs-sidebar-w);
  min-width: 0;
}

.docs-content {
  max-width: 820px;
  padding: 48px 48px 96px;
}

/* ── Typography ── */
.docs-content h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  line-height: 1.15;
}

.docs-lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--ink-muted);
  margin-bottom: 40px;
  max-width: 62ch;
}

.docs-content h2 {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 48px 0 20px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--docs-header-h) + 24px);
}

.docs-content h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.docs-section-intro {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  line-height: 1.65;
  margin-bottom: 24px;
  max-width: 62ch;
}

/* ── Feature cards ── */
.doc-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.doc-feature {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  transition: border-color 0.2s, box-shadow 0.2s;
  scroll-margin-top: calc(var(--docs-header-h) + 24px);
}

.doc-feature:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.doc-feature.is-hidden-by-search {
  display: none;
}

.doc-feature h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}

.doc-feature h3 a {
  color: inherit;
  text-decoration: none;
}

.doc-feature h3 a:hover {
  color: var(--primary);
}

.doc-feature > p {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.doc-benefit {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-soft);
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-teal);
  margin: 0;
}

.doc-benefit strong {
  color: var(--accent-teal);
  font-weight: 600;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.8125rem;
}

.doc-meta dt {
  font-weight: 600;
  color: var(--ink-soft);
}

.doc-meta dd {
  margin: 0;
  color: var(--ink-muted);
}

.doc-meta dd code,
.doc-feature code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.85em;
  background: var(--surface-tint);
  padding: 0.1em 0.45em;
  border-radius: 4px;
  color: var(--primary);
}

.doc-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-left: 8px;
  vertical-align: middle;
}

.doc-tag--admin { background: rgba(11, 28, 48, 0.08); color: var(--ink-soft); }
.doc-tag--ai { background: var(--accent-teal-soft); color: var(--accent-teal); }
.doc-tag--api { background: rgba(245, 158, 11, 0.12); color: #b45309; }

/* ── Overview cards ── */
.doc-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 32px 0;
}

.doc-overview-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}

.doc-overview-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.doc-overview-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.doc-overview-card p {
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.55;
  margin-bottom: 12px;
}

.doc-overview-card .doc-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
}

/* ── Tables ── */
.doc-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.doc-table th,
.doc-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.doc-table th {
  font-weight: 600;
  background: var(--surface);
  color: var(--ink-soft);
}

.doc-table tr:last-child td {
  border-bottom: none;
}

.doc-table code {
  font-size: 0.8125rem;
}

/* ── Callout ── */
.doc-callout {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
  margin: 24px 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.doc-callout strong {
  color: var(--ink);
}

/* ── CTA blocks ── */
.doc-cta {
  margin-top: 48px;
  padding: 32px;
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--surface-tint) 100%);
  border: 1px solid rgba(70, 72, 212, 0.15);
  border-radius: var(--radius-lg);
  text-align: center;
}

.doc-cta h3 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  margin-bottom: 8px;
}

.doc-cta p {
  color: var(--ink-muted);
  margin-bottom: 20px;
  font-size: 0.9375rem;
}

.doc-cta .btn {
  min-width: 200px;
}

.doc-cta--inline {
  margin-top: 40px;
  padding: 20px 24px;
  text-align: left;
  background: var(--surface);
}

.doc-cta--inline p {
  margin: 0;
  font-size: 0.875rem;
}

.doc-cta--inline a {
  color: var(--primary);
  font-weight: 600;
}

/* ── Footer ── */
.docs-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--ink-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.docs-footer a {
  color: var(--primary);
  font-weight: 500;
}

/* ── Search no results ── */
.docs-no-results {
  display: none;
  padding: 32px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.docs-no-results.is-visible {
  display: block;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-out);
    box-shadow: var(--shadow-lg);
  }

  .docs-sidebar.is-open {
    transform: translateX(0);
  }

  .docs-main {
    margin-left: 0;
  }

  .docs-sidebar-toggle {
    display: flex;
  }

  .docs-header-nav {
    display: none;
  }

  .docs-content {
    padding: 32px 24px 64px;
  }

  .doc-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .docs-search-wrap {
    display: none;
  }
}
