/* ═══════════════════════════════════════════
   docs.css  –  BK SOFTWARE CO. Documentation
   ═══════════════════════════════════════════ */

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

body {
  font-family: 'Inter', sans-serif;
  background: #0a0d12;
  color: #e2e8f0;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════ */
.docs-layout {
  display: flex;
  min-height: calc(100vh - 72px);
  padding-top: 72px;
}

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.docs-sidebar {
  width: 272px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  background: #0c0f16;
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
  transition: transform .28s ease;
}
.docs-sidebar::-webkit-scrollbar { width: 3px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

/* ── Search ── */
.docs-search {
  position: relative;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  flex-shrink: 0;
}
.docs-search svg {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: #475569;
  pointer-events: none;
}
.docs-search input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 9px 12px 9px 36px;
  font-size: 13px;
  color: #e2e8f0;
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: border-color .2s, background .2s;
}
.docs-search input::placeholder { color: #475569; }
.docs-search input:focus {
  border-color: rgba(0,217,255,.3);
  background: rgba(0,217,255,.04);
}

/* ── Nav groups ── */
.docs-nav {
  padding: 10px 0 20px;
  flex: 1;
}

.docs-nav__group { }

.docs-nav__group-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
  border-radius: 0;
}
.docs-nav__group-btn:hover { background: rgba(255,255,255,.03); }

.docs-nav__group-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--gc, #00d9ff) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--gc, #00d9ff) 20%, transparent);
  color: var(--gc, #00d9ff);
  flex-shrink: 0;
}
.docs-nav__group-icon svg {
  width: 13px;
  height: 13px;
  display: block;
}

.docs-nav__group-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  flex: 1;
  transition: color .15s;
}
.docs-nav__group-btn:hover .docs-nav__group-label { color: #e2e8f0; }
.docs-nav__group--open .docs-nav__group-label { color: var(--gc, #00d9ff); }

.docs-nav__chevron {
  width: 14px;
  height: 14px;
  color: #334155;
  flex-shrink: 0;
  transition: transform .2s;
}
.docs-nav__group--open .docs-nav__chevron { transform: rotate(180deg); }

/* Items list */
.docs-nav__items {
  list-style: none;
  display: none;
  padding: 2px 0 6px;
}
.docs-nav__group--open .docs-nav__items { display: block; }

.docs-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 16px 6px 52px;
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
  line-height: 1.5;
}
.docs-nav__link:hover {
  color: #cbd5e1;
  background: rgba(255,255,255,.03);
}
.docs-nav__link--active {
  color: var(--gc, #00d9ff);
  border-left-color: var(--gc, #00d9ff);
  background: color-mix(in srgb, var(--gc, #00d9ff) 6%, transparent);
}

.docs-nav__badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--gc, #00d9ff) 14%, transparent);
  color: var(--gc, #00d9ff);
  border: 1px solid color-mix(in srgb, var(--gc, #00d9ff) 25%, transparent);
}

/* No results */
.docs-search-empty {
  padding: 20px 16px;
  font-size: 13px;
  color: #475569;
  text-align: center;
}

/* ══════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════ */
.docs-content {
  flex: 1;
  min-width: 0;
  padding: 36px 52px 80px;
  max-width: 820px;
}

/* Mobile toggle */
.docs-mob-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-bottom: 24px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.docs-mob-toggle svg { width: 16px; height: 16px; }
.docs-mob-toggle:hover { color: #e2e8f0; background: rgba(255,255,255,.07); }

/* Breadcrumb */
.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  font-size: 13px;
  color: #475569;
  flex-wrap: wrap;
}
.docs-breadcrumb a {
  color: #475569;
  text-decoration: none;
  transition: color .15s;
}
.docs-breadcrumb a:hover { color: #94a3b8; }
.docs-breadcrumb span:last-child { color: #64748b; }

/* ── Article ── */
.docs-article h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.15;
  margin-bottom: 24px;
}
.docs-article h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 44px 0 14px;
  padding-top: 44px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.docs-article h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
  margin: 28px 0 10px;
}
.docs-article p {
  font-size: 15px;
  line-height: 1.8;
  color: #94a3b8;
  margin-bottom: 16px;
}
.docs-article ul, .docs-article ol {
  padding-left: 20px;
  margin-bottom: 16px;
}
.docs-article li {
  font-size: 15px;
  line-height: 1.75;
  color: #94a3b8;
  margin-bottom: 6px;
}
.docs-article a {
  color: #00d9ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,217,255,.2);
  transition: border-color .15s;
}
.docs-article a:hover { border-bottom-color: #00d9ff; }
.docs-article strong { color: #e2e8f0; font-weight: 600; }
.docs-article code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 5px;
  padding: 2px 6px;
  color: #f8fafc;
}

/* ── Code blocks ── */
.docs-code {
  margin: 20px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.07);
  background: #0d1117;
}
.docs-code pre {
  overflow-x: auto;
  padding: 20px;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}
.docs-code pre::-webkit-scrollbar { height: 4px; }
.docs-code pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }
.docs-code pre code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 13.5px;
  line-height: 1.7;
  color: #e2e8f0;
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
  tab-size: 2;
  white-space: pre;
}

/* ── Callouts ── */
.docs-callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.7;
}
.docs-callout--info {
  background: rgba(0,217,255,.06);
  border: 1px solid rgba(0,217,255,.18);
  color: #7dd3fc;
}
.docs-callout--warn {
  background: rgba(251,191,36,.06);
  border: 1px solid rgba(251,191,36,.2);
  color: #fcd34d;
}
.docs-callout--danger {
  background: rgba(239,68,68,.06);
  border: 1px solid rgba(239,68,68,.2);
  color: #fca5a5;
}
.docs-callout p { margin: 0; color: inherit; font-size: 14px; }

/* ── Tables ── */
.docs-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.07);
}
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.docs-table th {
  background: rgba(255,255,255,.04);
  color: #64748b;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.docs-table td {
  padding: 11px 16px;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: top;
}
.docs-table tr:last-child td { border-bottom: none; }
.docs-table tr:hover td { background: rgba(255,255,255,.02); }
.docs-table td code { font-size: 12px; }

/* ── Prev / Next ── */
.docs-prevnext {
  display: flex;
  gap: 12px;
  margin-top: 52px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.docs-prevnext__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 20px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color .2s, background .2s;
}
.docs-prevnext__item:hover {
  border-color: rgba(0,217,255,.22);
  background: rgba(0,217,255,.04);
}
.docs-prevnext__item--next { text-align: right; }
.docs-prevnext__label {
  font-size: 11px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #475569;
}
.docs-prevnext__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
}

/* ── Feedback ── */
.docs-feedback {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
  padding: 14px 18px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  flex-wrap: wrap;
}
.docs-feedback p {
  font-size: 14px;
  color: #64748b;
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
}
.docs-feedback__btns {
  display: flex;
  gap: 8px;
}
.docs-feedback__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  transition: all .2s;
}
.docs-feedback__btn svg { width: 14px; height: 14px; }
.docs-feedback__btn:hover { color: #e2e8f0; border-color: rgba(255,255,255,.2); }
.docs-feedback__btn:first-child:hover { color: #4ade80; border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.08); }
.docs-feedback__btn:last-child:hover  { color: #fca5a5; border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.08); }
.docs-feedback__thanks {
  font-size: 13px;
  color: #22c55e;
  font-family: 'Space Grotesk', sans-serif;
}

/* ══════════════════════════════════════════
   RIGHT TOC
══════════════════════════════════════════ */
.docs-toc {
  width: 216px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 40px 20px 40px 4px;
  scrollbar-width: none;
}
.docs-toc::-webkit-scrollbar { display: none; }

.docs-toc__label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #334155;
  margin-bottom: 12px;
}
#docsTocList {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.docs-toc__link {
  display: block;
  font-size: 12.5px;
  color: #475569;
  text-decoration: none;
  padding: 5px 0 5px 12px;
  border-left: 2px solid rgba(255,255,255,.06);
  line-height: 1.5;
  transition: color .15s, border-color .15s;
}
.docs-toc__link:hover { color: #cbd5e1; border-left-color: rgba(255,255,255,.2); }
.docs-toc__link.active { color: #00d9ff; border-left-color: #00d9ff; }

.docs-toc__help {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.docs-toc__help a {
  font-size: 12px;
  color: #475569;
  text-decoration: none;
  transition: color .15s;
}
.docs-toc__help a:hover { color: #00d9ff; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1200px) {
  .docs-toc { display: none; }
  .docs-content { max-width: 100%; }
}

@media (max-width: 900px) {
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 150;
    transform: translateX(-100%);
    padding-top: 72px;
  }
  .docs-sidebar--open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.6);
  }
  .docs-mob-toggle { display: flex; }
  .docs-content { padding: 24px 24px 80px; }
}

@media (max-width: 640px) {
  .docs-content { padding: 20px 16px 80px; }
  .docs-article h1 { font-size: 24px; }
  .docs-prevnext { flex-direction: column; }
  .docs-prevnext__item--next { text-align: left; }
}
