/* ── Docs Layout ────────────────────────────── */
.docs-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 72px;
}

/* ── Sidebar ───────────────────────────────── */
.docs-sidebar {
  position: fixed;
  top: 72px;
  left: 0;
  bottom: 0;
  width: 280px;
  background: #0d1117;
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
  padding: 24px 0;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: #1e293b #0d1117;
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: #0d1117; }
.docs-sidebar::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 2px; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-group {
  margin-bottom: 8px;
}

.sidebar-group-title {
  padding: 12px 20px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-link {
  display: block;
  padding: 6px 20px 6px 28px;
  font-size: 0.87rem;
  color: #94a3b8;
  transition: color 0.15s, background 0.15s, border-left-color 0.15s;
  border-left: 2px solid transparent;
}

.sidebar-link:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,0.02);
}

.sidebar-link.active {
  color: #c4b5fd;
  border-left-color: #8b5cf6;
  background: rgba(139,92,246,0.06);
}

/* ── Mobile sidebar toggle button ──────────── */
.docs-menu-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 60;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
  gap: 8px;
  align-items: center;
}

.docs-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

/* ── Main Content ──────────────────────────── */
.docs-main {
  margin-left: 280px;
  flex: 1;
  max-width: 860px;
  padding: 48px 48px 100px;
}

/* ── Section Styles ────────────────────────── */
.doc-section {
  scroll-margin-top: 88px;
}

.doc-section h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.doc-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.doc-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-top: 28px;
  margin-bottom: 10px;
}

.doc-lead {
  font-size: 1.1rem;
  color: #94a3b8;
  margin-bottom: 32px;
}

.doc-section p {
  color: #cbd5e1;
  line-height: 1.7;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.doc-section ul, .doc-section ol {
  color: #cbd5e1;
  padding-left: 24px;
  margin-bottom: 16px;
  line-height: 1.8;
  font-size: 0.95rem;
}

.doc-section li {
  margin-bottom: 6px;
}

.doc-section a {
  color: #a5b4fc;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.doc-section a:hover {
  color: #c4b5fd;
}

.doc-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 48px 0;
}

/* ── Code Blocks ───────────────────────────── */
.code-block {
  border-radius: 12px;
  overflow: hidden;
  margin: 14px 0 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #0d1117;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.code-header span {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.copy-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8;
  padding: 3px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.copy-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #e2e8f0;
}

.code-block pre {
  padding: 16px;
  overflow-x: auto;
  margin: 0;
}

.code-block code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.65;
  color: #e2e8f0;
}

/* Inline code */
.doc-section code:not(.code-block code) {
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.15);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84rem;
  color: #c4b5fd;
}

/* ── Tables ────────────────────────────────── */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 20px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 0.9rem;
}

.doc-table th {
  background: rgba(255,255,255,0.04);
  padding: 10px 16px;
  text-align: left;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.doc-table td {
  padding: 10px 16px;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.doc-table tr:last-child td {
  border-bottom: none;
}

.doc-table td strong {
  color: #e2e8f0;
}

.doc-table td code {
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.15);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: #c4b5fd;
}

/* ── Callouts ──────────────────────────────── */
.callout {
  padding: 16px 20px;
  border-radius: 10px;
  margin: 16px 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.callout strong {
  display: inline;
}

.callout-info {
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  color: #c4b5fd;
}

.callout-warning {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  color: #fbbf24;
}

.callout-warning strong {
  color: #fbbf24;
}

.callout-info strong {
  color: #a5b4fc;
}

/* ── Steps ─────────────────────────────────── */
.doc-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 24px 0;
}

.doc-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
}

.doc-step-num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
}

.doc-step-content h3 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.doc-step-content p {
  margin-bottom: 8px;
}

.doc-step-content p:last-child {
  margin-bottom: 0;
}

/* ── Troubleshooting ───────────────────────── */
.troubleshoot-item {
  margin-bottom: 28px;
}

.troubleshoot-item h3 {
  margin-top: 0;
}

/* ── Nav active link ───────────────────────── */
.nav-links a.active {
  color: #c4b5fd;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 300px;
  }

  .docs-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,0.5);
  }

  .sidebar-close {
    display: block;
  }

  .docs-menu-toggle {
    display: flex;
  }

  .docs-main {
    margin-left: 0;
    padding: 32px 24px 120px;
  }
}

@media (max-width: 768px) {
  .docs-main {
    padding: 24px 16px 120px;
  }

  .doc-section h1 {
    font-size: 1.6rem;
  }

  .doc-section h2 {
    font-size: 1.35rem;
  }

  .doc-step {
    flex-direction: column;
    gap: 10px;
  }

  .code-block pre {
    padding: 12px;
  }

  .code-block code {
    font-size: 0.8rem;
  }

  .doc-table {
    font-size: 0.82rem;
  }

  .doc-table th, .doc-table td {
    padding: 8px 10px;
  }
}
