/* ===== DOCS THEME TOKENS ===== */
:root {
  --docs-title-color:     rgba(255,255,255,0.92);  /* group titles */
  --docs-nav-color:       rgba(255,255,255,0.68);  /* nav links */
  --docs-body-text:       rgba(255,255,255,0.82);
  --docs-list-text:       rgba(255,255,255,0.76);
  --docs-muted-text:      rgba(255,255,255,0.42);
  --docs-faint-text:      rgba(255,255,255,0.36);
  --docs-sep-color:       rgba(255,255,255,0.15);
  --docs-hover-bg:        rgba(255,255,255,0.04);
  --docs-row-hover-bg:    rgba(255,255,255,0.025);
  --docs-scrollbar-thumb: rgba(255,255,255,0.10);
}

[data-theme="light"] {
  --docs-title-color:     #212121;   /* dark text for light mode group titles */
  --docs-nav-color:       #333333;   /* dark gray for light mode nav links */
  --docs-body-text:       #333333;
  --docs-list-text:       #333333;
  --docs-muted-text:      #888888;
  --docs-faint-text:      #aaaaaa;
  --docs-sep-color:       rgba(0,0,0,0.14);
  --docs-hover-bg:        rgba(0,0,0,0.04);
  --docs-row-hover-bg:    rgba(0,0,0,0.025);
  --docs-scrollbar-thumb: rgba(0,0,0,0.12);
}

/* ===== DOCS LAYOUT ===== */
.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 900px) 200px;
  gap: 0;
  min-height: calc(100vh - 60px);
  margin-top: 60px;
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== LEFT SIDEBAR ===== */
.docs-sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--docs-scrollbar-thumb); border-radius: 4px; }

.docs-sidebar-inner {
  padding: 24px 0 40px;
}

/* Group */
.docs-group {
  margin-bottom: 4px;
}

.docs-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--docs-title-color);
  text-transform: uppercase;
  padding: 12px 20px 6px;
}

.docs-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.docs-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 20px;
  font-size: 14px;
  color: var(--docs-nav-color);
  border-radius: 0;
  transition: color 0.18s, background 0.18s;
  position: relative;
  text-decoration: none;
}

.docs-nav-link:hover {
  color: var(--text);
  background: var(--docs-hover-bg);
}

.docs-nav-link.active {
  color: #f97316;
  background: rgba(249,115,22,0.08);
  font-weight: 700;
}

.docs-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: #f97316;
}

.docs-nav-orange {
  color: rgba(249,115,22,0.75);
}
.docs-nav-orange:hover { color: #f97316; }
.docs-nav-orange.active { color: #f97316; background: rgba(249,115,22,0.07); }
.docs-nav-orange.active::before { background: #f97316; }

.docs-nav-num {
  font-size: 11px;
  color: var(--docs-faint-text);
  min-width: 26px;
}

.docs-nav-icon {
  font-size: 12px;
  color: var(--docs-faint-text);
  min-width: 16px;
  text-align: center;
}

/* ===== MAIN CONTENT ===== */
.docs-main {
  min-height: calc(100vh - 60px);
  border-right: 1px solid var(--border);
}

.docs-content {
  max-width: 780px;
  padding: 40px 48px 80px;
}

/* Active nav link for current page */
.nav-active {
  color: var(--text) !important;
  background: var(--docs-hover-bg) !important;
}

/* BREADCRUMB */
.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.docs-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.docs-breadcrumb a:hover { color: var(--text); }

.docs-breadcrumb-sep {
  color: var(--docs-sep-color);
  font-size: 12px;
}

.docs-breadcrumb-cur {
  color: var(--text);
}

/* TITLE */
.docs-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
}

.docs-title-icon {
  font-size: 28px;
}

/* META */
.docs-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.docs-meta-sep {
  color: var(--docs-sep-color);
}

/* BODY */
.docs-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--docs-body-text);
}

.docs-body p {
  margin-bottom: 16px;
}

.docs-link {
  color: #06b6d4;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.docs-link:hover { color: #a5f3fc; }

/* SCREENSHOT */
.docs-screenshot-wrap {
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.docs-screenshot {
  width: 100%;
  display: block;
  border-radius: var(--radius);
}

/* HEADINGS */
.docs-h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 80px;
}

.docs-h2-highlight {
  background: linear-gradient(90deg, rgba(249,115,22,0.15), transparent);
  border-left: 3px solid #f97316;
  padding-left: 12px;
  border-bottom: none;
  border-radius: 0 6px 6px 0;
  color: #f97316;
}

.docs-h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 10px;
  scroll-margin-top: 80px;
}

/* LISTS */
.docs-ol {
  padding-left: 24px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.docs-ol li {
  font-size: 15px;
  color: var(--docs-list-text);
  line-height: 1.75;
}

.docs-ol li::marker {
  color: #06b6d4;
  font-weight: 600;
}

.docs-ul {
  padding-left: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: disc;
}

.docs-ul li {
  font-size: 15px;
  color: var(--docs-list-text);
}

.docs-ul li::marker { color: #a855f7; }

.docs-ul-sub {
  margin-top: 8px;
  margin-bottom: 4px;
  padding-left: 16px;
}

/* CODE INLINE */
.docs-code {
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 13px;
  background: rgba(168,85,247,0.1);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: 4px;
  padding: 1px 6px;
  color: #c4b5fd;
}

/* CODE BLOCK */
.docs-code-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
}

.docs-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.docs-code-lang {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'Fira Code', monospace;
}

.docs-code-copy {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.docs-code-copy:hover { color: var(--text); border-color: var(--docs-sep-color); }
.docs-code-copy.copied { color: var(--neon-green); border-color: rgba(74,222,128,0.3); }

.docs-code-block pre {
  margin: 0;
  border-radius: 0;
}

/* ALERT BOXES */
.docs-alert {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.7;
}

.docs-alert-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.docs-alert-warn {
  background: rgba(234,179,8,0.07);
  border: 1px solid rgba(234,179,8,0.25);
  border-left: 3px solid #eab308;
}

.docs-alert-warn .docs-alert-title { color: #fde047; }
.docs-alert-warn .docs-alert-body  { color: rgba(253,224,71,0.75); }

.docs-alert-info {
  background: rgba(6,182,212,0.07);
  border: 1px solid rgba(6,182,212,0.25);
  border-left: 3px solid #06b6d4;
}

.docs-alert-info .docs-alert-title { color: #22d3ee; }
.docs-alert-info .docs-alert-body  { color: rgba(34,211,238,0.75); }

.docs-alert-danger {
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.25);
  border-left: 3px solid #ef4444;
}

.docs-alert-danger .docs-alert-title { color: #fca5a5; }
.docs-alert-danger .docs-alert-body  { color: rgba(252,165,165,0.8); }

.docs-alert-success {
  background: rgba(74,222,128,0.06);
  border: 1px solid rgba(74,222,128,0.2);
  border-left: 3px solid #4ade80;
}

.docs-alert-success .docs-alert-title { color: #86efac; }
.docs-alert-success .docs-alert-body  { color: rgba(134,239,172,0.75); }

/* TABLE */
.docs-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

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

.docs-table th {
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.docs-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--docs-list-text);
  vertical-align: middle;
}

.docs-table tr:last-child td { border-bottom: none; }
.docs-table tr:hover td { background: var(--docs-row-hover-bg); }

/* PAGE NAV */
.docs-page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.docs-page-nav-prev,
.docs-page-nav-next {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
  text-decoration: none;
}

.docs-page-nav-next {
  margin-left: auto;
}

.docs-page-nav-prev:hover,
.docs-page-nav-next:hover { color: #06b6d4; }

.docs-page-nav-prev span,
.docs-page-nav-next span {
  color: var(--text);
  font-weight: 500;
}

/* ===== TABS ===== */
.docs-tabs {
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.docs-tab-bar {
  display: flex;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.docs-tab-btn {
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  margin-bottom: -1px;
}

.docs-tab-btn:hover { color: var(--text); }

.docs-tab-btn.active {
  color: #06b6d4;
  border-bottom-color: #06b6d4;
}

.docs-tab-panel {
  display: none;
  padding: 20px;
}

.docs-tab-panel.active { display: block; }

.docs-tab-panel p {
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--docs-list-text);
}

.docs-tab-panel .docs-code-block {
  margin: 0 0 16px;
}

.docs-tab-panel .docs-screenshot-wrap {
  margin: 12px 0 0;
}

/* CONTACT INFO */
.docs-contact-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.docs-contact-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.docs-contact-label {
  color: var(--text-muted);
  min-width: 64px;
  flex-shrink: 0;
}

.docs-contact-value {
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  color: var(--text);
  font-weight: 600;
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.18);
  border-radius: 4px;
  padding: 2px 10px;
  letter-spacing: 0.04em;
}

/* EDIT META */
.docs-edit-meta {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--docs-faint-text);
  margin-top: 20px;
}

/* ===== RIGHT TOC ===== */
.docs-toc {
  position: sticky;
  top: 80px;
  height: fit-content;
  padding: 24px 16px 24px 20px;
  font-size: 13px;
}

.docs-toc-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--docs-muted-text);
  margin-bottom: 12px;
}

.docs-toc-toggle {
  background: none;
  border: none;
  color: var(--docs-faint-text);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  transition: color 0.2s;
}

.docs-toc-toggle:hover { color: var(--text-muted); }

.docs-toc-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-toc-link {
  display: block;
  padding: 4px 8px;
  font-size: 12.5px;
  color: var(--docs-muted-text);
  border-radius: 4px;
  transition: color 0.18s, background 0.18s;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 2px solid transparent;
}

.docs-toc-link:hover {
  color: var(--text);
  background: var(--docs-hover-bg);
}

.docs-toc-link-active {
  color: #f97316;
  border-left-color: #f97316;
  background: rgba(249,115,22,0.07);
  font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1280px) {
  .docs-layout {
    grid-template-columns: 240px 1fr 0;
  }
  .docs-toc { display: none; }
}

@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    display: none;
  }
  .docs-content {
    padding: 24px 20px 60px;
  }
}
