/* ============================================================
   Parimaar Docs — Mintlify-inspired design
   ============================================================ */

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

:root {
  --sidebar-bg: #0f1117;
  --sidebar-width: 280px;
  --sidebar-text: #9ca3af;
  --sidebar-text-hover: #f9fafb;
  --sidebar-active-bg: rgba(59, 130, 246, 0.12);
  --sidebar-active-text: #60a5fa;
  --sidebar-border: #1f2937;
  --sidebar-group-text: #6b7280;

  --content-bg: #ffffff;
  --content-text: #111827;
  --content-muted: #6b7280;
  --content-border: #e5e7eb;

  --accent: #2563eb;
  --accent-light: #eff6ff;
  --accent-hover: #1d4ed8;

  --topbar-bg: #ffffff;
  --topbar-border: #e5e7eb;
  --topbar-height: 60px;

  --code-bg: #1e2533;
  --code-text: #e2e8f0;

  --note-bg: #eff6ff;
  --note-border: #2563eb;
  --tip-bg: #f0fdf4;
  --tip-border: #16a34a;
  --warn-bg: #fffbeb;
  --warn-border: #d97706;

  --radius: 8px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow: 0 4px 16px rgba(0,0,0,.10);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--content-text);
  background: var(--content-bg);
}

/* ── LAYOUT ─────────────────────────────────────────────── */

.layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: transform .3s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-logo img {
  height: 32px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: #f9fafb;
  letter-spacing: -.3px;
}

.sidebar-logo-badge {
  font-size: 10px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  padding: 1px 6px;
  border-radius: 20px;
  letter-spacing: .3px;
}

/* Search */
.sidebar-search {
  padding: 12px 14px 8px;
  flex-shrink: 0;
}

.sidebar-search-input {
  width: 100%;
  background: #1a2030;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  padding: 7px 10px 7px 32px;
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color .2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}

.sidebar-search-input:focus { border-color: var(--accent); }
.sidebar-search-input::placeholder { color: #4b5563; }

/* Nav scroll area */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 24px;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #374151; border-radius: 2px; }

.nav-group {
  margin-bottom: 4px;
}

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sidebar-group-text);
  padding: 12px 18px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  font-size: 13.5px;
  color: var(--sidebar-text);
  text-decoration: none;
  cursor: pointer;
  border-radius: 0;
  transition: color .15s, background .15s;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  color: var(--sidebar-text-hover);
  background: rgba(255,255,255,.04);
}

.nav-item.active {
  color: var(--sidebar-active-text);
  background: var(--sidebar-active-bg);
  font-weight: 500;
}

.nav-item svg, .nav-item .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .7;
}

.nav-item.active .nav-icon { opacity: 1; }

/* Sub-items */
.nav-sub { padding-left: 16px; }
.nav-sub .nav-item { font-size: 13px; padding: 5px 18px 5px 14px; }

/* ── MAIN ─────────────────────────────────────────────────── */

.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 50;
  gap: 16px;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--content-muted);
}

.topbar-breadcrumb a {
  color: var(--content-muted);
  text-decoration: none;
  transition: color .15s;
}
.topbar-breadcrumb a:hover { color: var(--accent); }

.topbar-breadcrumb .sep { color: #d1d5db; }
.topbar-breadcrumb .current { color: var(--content-text); font-weight: 500; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all .15s;
}

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

.btn-ghost {
  background: transparent;
  color: var(--content-muted);
  border: 1px solid var(--content-border);
}
.btn-ghost:hover { background: #f9fafb; color: var(--content-text); }

/* ── CONTENT ──────────────────────────────────────────────── */

.content {
  flex: 1;
  max-width: 860px;
  padding: 48px 48px 80px;
}

/* Pages */
.page { display: none; }
.page.active { display: block; }

/* Hero */
.page-hero {
  margin-bottom: 40px;
}

.page-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 12px;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--content-text);
  line-height: 1.25;
  letter-spacing: -.5px;
  margin-bottom: 12px;
}

.page-desc {
  font-size: 16px;
  color: var(--content-muted);
  line-height: 1.7;
  max-width: 680px;
}

.divider {
  border: none;
  border-top: 1px solid var(--content-border);
  margin: 32px 0;
}

/* Typography */
h1 { font-size: 28px; font-weight: 700; letter-spacing: -.4px; margin: 0 0 12px; line-height: 1.3; }
h2 { font-size: 21px; font-weight: 700; letter-spacing: -.3px; margin: 40px 0 12px; }
h2:first-child { margin-top: 0; }
h3 { font-size: 16px; font-weight: 600; margin: 28px 0 8px; }
h4 { font-size: 14px; font-weight: 600; margin: 20px 0 6px; }

p { margin: 0 0 14px; color: var(--content-text); }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 22px; margin: 12px 0; }
li { margin-bottom: 6px; color: var(--content-text); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

strong { font-weight: 600; }
code {
  font-family: var(--font-mono);
  font-size: .85em;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 1px 5px;
  border-radius: 3px;
  color: #dc2626;
}

/* Code block */
pre {
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid #2d3748;
}

pre code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--code-text);
  background: none;
  border: none;
  padding: 0;
}

/* Callouts */
.callout {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border-left: 3px solid;
  margin: 20px 0;
}

.callout-note { background: var(--note-bg); border-color: var(--note-border); }
.callout-tip  { background: var(--tip-bg);  border-color: var(--tip-border); }
.callout-warn { background: var(--warn-bg); border-color: var(--warn-border); }

.callout-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.callout-body { font-size: 14px; line-height: 1.6; }
.callout-body strong { display: block; margin-bottom: 2px; }
.callout-note .callout-body { color: #1e40af; }
.callout-tip  .callout-body { color: #166534; }
.callout-warn .callout-body { color: #92400e; }

/* Feature cards grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.card {
  border: 1px solid var(--content-border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .1s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(37,99,235,.1);
  transform: translateY(-1px);
  text-decoration: none;
}

.card-icon {
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--content-text);
}

.card-desc {
  font-size: 13px;
  color: var(--content-muted);
  line-height: 1.5;
}

/* Step list */
.steps { margin: 24px 0; }

.step {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  position: relative;
}

.step::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 36px;
  width: 1px;
  height: calc(100% - 4px);
  background: var(--content-border);
}

.step:last-child::before { display: none; }

.step-num {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-body { flex: 1; }
.step-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.step-desc { font-size: 14px; color: var(--content-muted); line-height: 1.6; }

/* Table */
.table-wrap { overflow-x: auto; margin: 20px 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead tr { background: #f9fafb; }
th {
  text-align: left;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--content-muted);
  border-bottom: 1px solid var(--content-border);
  white-space: nowrap;
}

td {
  padding: 10px 16px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

/* Badge */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .03em;
}

.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-gray   { background: #f3f4f6; color: #374151; }

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.section-header-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* Feature list */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #f9fafb;
  font-size: 14px;
}

.feature-list li:last-child { border-bottom: none; }

.feature-check {
  color: #16a34a;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Prev/Next nav */
.page-nav {
  display: flex;
  gap: 16px;
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--content-border);
}

.page-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  border: 1px solid var(--content-border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color .2s, box-shadow .15s;
  cursor: pointer;
  background: none;
}

.page-nav-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.page-nav-btn.next { text-align: right; }

.page-nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--content-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-nav-btn.next .page-nav-label { justify-content: flex-end; }

.page-nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

/* Mobile toggle */
.mobile-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .main {
    margin-left: 0;
  }
  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content {
    padding: 32px 20px 60px;
  }
  .topbar {
    padding: 0 20px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
}

/* ── SCROLLBAR ───────────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f9fafb; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── SEARCH HIGHLIGHT ────────────────────────────────────── */

mark { background: #fef08a; padding: 0 2px; border-radius: 2px; }

/* ── ANCHOR ──────────────────────────────────────────────── */

.anchor {
  scroll-margin-top: 80px;
}

/* ── TOC (right rail) ────────────────────────────────────── */

@media (min-width: 1200px) {
  .content { max-width: 720px; }
}
