/* ── Developer Docs – Swagger-style layout ─────────────────────────────── */

/* TOC sidebar */
.docs-toc {
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bs-border-color) transparent;
}
.docs-toc::-webkit-scrollbar { width: 4px; }
.docs-toc::-webkit-scrollbar-thumb { background: var(--bs-border-color); border-radius: 4px; }

.docs-toc .toc-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bs-secondary);
  padding: 1rem 1rem 0.25rem;
  margin: 0;
}
.docs-toc .toc-link {
  display: block;
  padding: 0.28rem 1rem;
  font-size: 0.82rem;
  color: var(--bs-body-color);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: border-color .15s, color .15s;
}
.docs-toc .toc-link:hover,
.docs-toc .toc-link.active {
  color: #4c84ff;
  border-left-color: #4c84ff;
}

/* Section anchor offset for fixed topbar */
.docs-section {
  scroll-margin-top: 90px;
}

/* ── Method badges ─────────────────────────────────────────────────────── */
.method-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  min-width: 52px;
  text-align: center;
  font-family: monospace;
}
.method-get   { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.method-post  { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.method-delete{ background: #fce4ec; color: #c62828; border: 1px solid #ef9a9a; }

/* ── Endpoint cards ────────────────────────────────────────────────────── */
.endpoint-card {
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: box-shadow .2s;
}
.endpoint-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: var(--bs-body-bg);
  cursor: pointer;
  user-select: none;
  border: none;
  width: 100%;
  text-align: left;
}
.endpoint-header:hover { background: var(--bs-tertiary-bg, #f8f9fa); }

.endpoint-path {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
}
.endpoint-summary {
  font-size: 0.8rem;
  color: var(--bs-secondary);
  margin-left: auto;
}
.endpoint-chevron {
  font-size: 0.7rem;
  color: var(--bs-secondary);
  transition: transform .2s;
}
.endpoint-header[aria-expanded="true"] .endpoint-chevron {
  transform: rotate(180deg);
}

.endpoint-body {
  padding: 1.1rem;
  border-top: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
}

/* ── Auth tag ──────────────────────────────────────────────────────────── */
.auth-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #f57f17;
  border-radius: 4px;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
}

/* ── Parameter table ───────────────────────────────────────────────────── */
.param-table { font-size: 0.82rem; margin-bottom: 0; }
.param-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--bs-secondary);
  border-bottom-width: 1px;
}
.param-name {
  font-family: monospace;
  font-weight: 600;
  font-size: 0.85rem;
  color: #4c84ff;
}
.param-required {
  color: #e53935;
  font-size: 0.7rem;
  font-weight: 600;
}
.param-optional {
  color: var(--bs-secondary);
  font-size: 0.7rem;
}
.param-type {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--bs-secondary);
}

/* ── Code blocks ───────────────────────────────────────────────────────── */
.code-block-wrapper {
  border-radius: 6px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.code-block-tabs .nav-link {
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 0;
  color: var(--bs-secondary);
}
.code-block-tabs .nav-link.active {
  color: #4c84ff;
  border-bottom: 2px solid #4c84ff;
  background: transparent;
}
.code-example {
  background: #1e1e2e;
  color: #cdd6f4;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  padding: 1rem 1.2rem;
  margin: 0;
  overflow-x: auto;
  white-space: pre;
  border-radius: 0 0 6px 6px;
}
.code-example .c-method  { color: #89b4fa; }
.code-example .c-url     { color: #a6e3a1; }
.code-example .c-key     { color: #cba6f7; }
.code-example .c-val     { color: #fab387; }
.code-example .c-str     { color: #a6e3a1; }
.code-example .c-comment { color: #6c7086; font-style: italic; }
.code-example .c-num     { color: #fab387; }

/* ── Response box ──────────────────────────────────────────────────────── */
.response-box {
  background: #1e1e2e;
  color: #a6e3a1;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  border-radius: 6px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  white-space: pre;
}
.response-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--bs-secondary);
  margin-bottom: 0.35rem;
}

/* ── Docs page header ──────────────────────────────────────────────────── */
.docs-hero {
  background: linear-gradient(135deg, #1a237e 0%, #1565c0 100%);
  border-radius: 10px;
  color: #fff;
  padding: 2rem 2.5rem;
  margin-bottom: 2rem;
}
.docs-hero .version-badge {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

/* ── Section titles ────────────────────────────────────────────────────── */
.docs-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bs-border-color);
}
.docs-section-desc {
  font-size: 0.85rem;
  color: var(--bs-secondary);
  margin-bottom: 1.25rem;
}

/* ── Copy button ───────────────────────────────────────────────────────── */
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s;
  z-index: 1;
}
.copy-btn:hover { background: rgba(255,255,255,.25); }
.copy-btn.copied { background: rgba(100,220,100,.25); border-color: #a6e3a1; color: #a6e3a1; }

.code-relative { position: relative; }

/* ── Auth bar ──────────────────────────────────────────────────────────── */
.docs-auth-bar {
  background: var(--bs-body-bg);
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
}
.docs-auth-bar.authorized {
  border-color: #2e7d32;
  background: #f1f8e9;
}
.docs-auth-bar .form-control {
  font-size: .82rem;
}

/* ── Test panel ────────────────────────────────────────────────────────── */
.test-panel {
  border-top: 1px dashed var(--bs-border-color);
  padding-top: 1rem;
  margin-top: 0.5rem;
}
.test-param-input .input-group-text {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  min-width: 110px;
  color: #4c84ff;
  background: var(--bs-tertiary-bg, #f8f9fa);
  border-color: var(--bs-border-color);
}
.test-param-input .form-control {
  font-size: 0.82rem;
}
.test-body-input {
  font-family: 'Courier New', monospace !important;
  font-size: 0.78rem !important;
  background: #1e1e2e !important;
  color: #cdd6f4 !important;
  border-color: #313244 !important;
  resize: vertical;
}
.test-body-input:focus {
  box-shadow: 0 0 0 3px rgba(76,132,255,.2) !important;
  border-color: #4c84ff !important;
  outline: none;
}
.test-response-status {
  font-family: monospace;
  font-size: 0.75rem;
  letter-spacing: .03em;
}
.test-response-box {
  background: #1e1e2e;
  color: #cdd6f4;
  font-family: 'Courier New', monospace;
  font-size: 0.77rem;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: #45475a transparent;
}
.test-response-box::-webkit-scrollbar { width: 4px; }
.test-response-box::-webkit-scrollbar-thumb { background: #45475a; border-radius: 4px; }
