/* Better Docs Pro - Frontend CSS — ALL rules scoped to .bdp-wrapper */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono&display=swap');

/* ── Scoped box-sizing — only inside .bdp-wrapper ─────── */
.bdp-wrapper, .bdp-wrapper *, .bdp-wrapper *::before, .bdp-wrapper *::after {
  box-sizing: border-box;
}

/* ── Outer wrapper ─────────────────────────────────────── */
.bdp-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: 600px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: #111827;
  max-width: 1200px;
  margin: 0 auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
  align-items: start;
}

/* ── Nav sidebar — sticky ──────────────────────────────── */
.bdp-wrapper .bdp-nav-sidebar {
  background: #fafafa;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  position: sticky;
  top: 32px;
  max-height: calc(100vh - 48px);
  border-radius: 12px 0 0 12px;
  scroll-behavior: smooth;
}
.bdp-wrapper .bdp-nav-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid #e5e7eb;
}
.bdp-wrapper .bdp-nav-header h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #111;
}
.bdp-wrapper .bdp-search-input {
  width: 100%; padding: 7px 12px;
  border: 1px solid #d1d5db; border-radius: 20px;
  font-size: 13px; outline: none; background: #fff;
  transition: border .2s;
}
.bdp-wrapper .bdp-search-input:focus { border-color: #4f46e5; }

/* ── Nav list ──────────────────────────────────────────── */
.bdp-wrapper .bdp-nav-list { list-style: none; margin: 0; padding: 8px 0; }
.bdp-wrapper .bdp-nav-list .bdp-nav-list { padding: 0 0 4px 16px; display: none; }
.bdp-wrapper .bdp-nav-item.expanded > .bdp-nav-list { display: block; }
.bdp-wrapper .bdp-nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px; color: #374151; text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s, border-left .15s;
  cursor: pointer; border-left: 3px solid transparent;
}
.bdp-wrapper .bdp-nav-link:hover { background: #ede9fe; color: #4f46e5; text-decoration: none; }
.bdp-wrapper .bdp-nav-link.active {
  background: #ede9fe; color: #4f46e5;
  border-left: 3px solid #4f46e5; font-weight: 600;
}
.bdp-wrapper .bdp-nav-arrow {
  font-size: 9px; transition: transform .2s; color: #9ca3af;
  display: inline-block; flex-shrink: 0;
}
.bdp-wrapper .bdp-nav-item.expanded > .bdp-nav-link .bdp-nav-arrow { transform: rotate(90deg); }
.bdp-wrapper .bdp-nav-list .bdp-nav-list .bdp-nav-link { padding-left: 24px; font-size: 13px; font-weight: 400; }
.bdp-wrapper .bdp-nav-list .bdp-nav-list .bdp-nav-list .bdp-nav-link { padding-left: 36px; font-size: 12.5px; }

/* ── Main content ──────────────────────────────────────── */
.bdp-wrapper .bdp-main-content { padding: 40px 48px; min-width: 0; }
.bdp-wrapper .bdp-section { margin-bottom: 56px; scroll-margin-top: 48px; }
.bdp-wrapper .bdp-section-title {
  font-size: 22px; font-weight: 700; margin: 0 0 20px;
  padding-bottom: 12px; border-bottom: 2px solid #e5e7eb; color: #111;
}

/* ── Block elements ────────────────────────────────────── */
.bdp-wrapper .bdp-block-el { margin: 0 0 14px; }
.bdp-wrapper h1.bdp-block-el { font-size: 2em;   font-weight: 800; margin-bottom: 16px; }
.bdp-wrapper h2.bdp-block-el { font-size: 1.5em; font-weight: 700; }
.bdp-wrapper h3.bdp-block-el { font-size: 1.2em; font-weight: 700; }
.bdp-wrapper h4.bdp-block-el { font-size: 1em;   font-weight: 700; }
.bdp-wrapper h5.bdp-block-el { font-size: 0.9em; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.bdp-wrapper h6.bdp-block-el { font-size: 0.8em; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .06em; }
.bdp-wrapper p.bdp-block-el  { line-height: 1.7; color: #374151; }
.bdp-wrapper .bdp-span-block { display: inline-block; }
.bdp-wrapper .bdp-img        { max-width: 100%; height: auto; border-radius: 8px; display: block; }
.bdp-wrapper .bdp-list       { padding-left: 24px; line-height: 1.9; color: #374151; }
.bdp-wrapper .bdp-blockquote {
  border-left: 4px solid #4f46e5; margin: 0 0 14px;
  padding: 10px 20px; background: #f5f3ff;
  border-radius: 0 8px 8px 0; color: #374151; font-style: italic;
}
.bdp-wrapper .bdp-code-block {
  background: #1e1e2e; color: #cdd6f4; border-radius: 8px;
  padding: 18px 20px; overflow-x: auto; margin-bottom: 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.6;
}
.bdp-wrapper .bdp-divider { border: none; border-top: 1px solid #e5e7eb; margin: 24px 0; }

/* ── Note / Callout ────────────────────────────────────── */
.bdp-wrapper .bdp-note {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: 8px; margin-bottom: 14px;
  font-size: 14px; line-height: 1.6;
}
.bdp-wrapper .bdp-note-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 4px; letter-spacing: .05em; margin-top: 2px;
}
.bdp-wrapper .bdp-note-text { flex: 1; }
.bdp-wrapper .bdp-note-info    { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e40af; }
.bdp-wrapper .bdp-note-info    .bdp-note-badge { background: #3b82f6; color: #fff; }
.bdp-wrapper .bdp-note-success { background: #f0fdf4; border-left: 4px solid #22c55e; color: #166534; }
.bdp-wrapper .bdp-note-success .bdp-note-badge { background: #22c55e; color: #fff; }
.bdp-wrapper .bdp-note-warning { background: #fffbeb; border-left: 4px solid #f59e0b; color: #92400e; }
.bdp-wrapper .bdp-note-warning .bdp-note-badge { background: #f59e0b; color: #fff; }
.bdp-wrapper .bdp-note-danger  { background: #fef2f2; border-left: 4px solid #ef4444; color: #991b1b; }
.bdp-wrapper .bdp-note-danger  .bdp-note-badge { background: #ef4444; color: #fff; }

/* ── Table ─────────────────────────────────────────────── */
.bdp-wrapper .bdp-table-wrap { overflow-x: auto; margin-bottom: 14px; }
.bdp-wrapper .bdp-table { width: 100%; border-collapse: collapse; font-size: 14px; border: 1px solid #e5e7eb; }
.bdp-wrapper .bdp-table thead { background: #f3f4f6; }
.bdp-wrapper .bdp-table th {
  padding: 10px 14px; text-align: left; font-weight: 600;
  font-size: 13px; color: #374151; border-bottom: 2px solid #e5e7eb; border-right: 1px solid #e5e7eb;
}
.bdp-wrapper .bdp-table td {
  padding: 9px 14px; border-bottom: 1px solid #f3f4f6;
  border-right: 1px solid #f3f4f6; color: #4b5563; vertical-align: top;
}
.bdp-wrapper .bdp-table tbody tr:hover { background: #fafafa; }
.bdp-wrapper .bdp-table th:last-child,
.bdp-wrapper .bdp-table td:last-child { border-right: none; }

/* ── Prefix label badge ────────────────────────────────── */
.bdp-wrapper .bdp-block-label {
  display: inline-block; padding: 2px 10px; border-radius: 4px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: 6px; vertical-align: middle;
}

/* ── Rich list ─────────────────────────────────────────── */
.bdp-wrapper .bdp-rich-list { list-style: none; padding-left: 0; margin: 0 0 14px; }
.bdp-wrapper .bdp-rich-list .bdp-list-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 4px 0 4px 20px; position: relative; line-height: 1.6;
}
.bdp-wrapper .bdp-rich-list .bdp-list-item::before {
  content: '■'; position: absolute; left: 0; top: 6px; font-size: 7px; color: #6b7280;
}
.bdp-wrapper .bdp-rich-list .bdp-list-heading {
  font-weight: 700; font-size: 15px; color: #111827; padding: 10px 0 4px 0; list-style: none;
}
.bdp-wrapper .bdp-li-badge {
  display: inline-block; flex-shrink: 0; padding: 1px 8px; border-radius: 4px;
  font-size: 12.5px; font-weight: 600; font-family: 'JetBrains Mono', monospace; white-space: nowrap;
}
.bdp-wrapper .bdp-li-text { flex: 1; color: #374151; line-height: 1.65; }

/* ── Nested list ───────────────────────────────────────── */
.bdp-wrapper .bdp-nested-list-wrap { margin-bottom: 14px; }
.bdp-wrapper .bdp-nested-list      { padding-left: 20px; line-height: 1.9; color: #374151; }
.bdp-wrapper .bdp-nl-depth-0       { padding-left: 0; list-style: disc; }
.bdp-wrapper .bdp-nl-depth-1       { list-style: circle; }
.bdp-wrapper .bdp-nl-depth-2       { list-style: square; }
.bdp-wrapper .bdp-nl-depth-3       { list-style: disc; }
.bdp-wrapper .bdp-nlist-item       { display: flex; align-items: baseline; gap: 7px; padding: 2px 0; }

/* ── Inline badge / email / link ───────────────────────── */
.bdp-wrapper .bdp-block-wrap   { display: inline; }
.bdp-wrapper .bdp-inline-badge {
  display: inline-block; padding: 1px 8px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace; white-space: nowrap; margin: 0 4px;
}
.bdp-wrapper .bdp-inline-email,
.bdp-wrapper .bdp-inline-link  { text-decoration: underline; margin: 0 3px; }

/* ── Mobile ────────────────────────────────────────────── */
.bdp-wrapper .bdp-mobile-toggle {
  display: none; background: #4f46e5; color: #fff;
  padding: 10px 16px; cursor: pointer; font-size: 14px; font-weight: 600;
  border-radius: 12px 12px 0 0;
}
@media (max-width: 768px) {
  .bdp-wrapper { grid-template-columns: 1fr; border-radius: 8px; }
  .bdp-wrapper .bdp-mobile-toggle { display: block; }
  .bdp-wrapper .bdp-nav-sidebar {
    position: fixed; top: 0; left: -300px; width: 280px; height: 100vh;
    z-index: 9999; background: #fff; transition: left .3s; border-radius: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,.2);
  }
  .bdp-wrapper .bdp-nav-sidebar.bdp-nav-open { left: 0; }
  .bdp-wrapper .bdp-main-content { padding: 24px 20px; }
}
