/* ==================== Docs Pages (API Documentation) ==================== */

/* ---- Field table image cells & lightbox ---- */
.img-cell {
  width: 130px;
  min-width: 130px;
  max-width: 130px;
}
.img-thumb {
  display: block;
  width: 120px;
  height: 80px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: zoom-in;
  padding: 0;
  transition: all 0.15s;
}
.img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.img-thumb:hover {
  border-color: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.fields-table td code {
  white-space: normal;
  word-break: break-word;
}
.fields-table th:first-child,
.fields-table td:first-child {
  min-width: 170px;
  white-space: nowrap;
}
.fields-table td:first-child code {
  white-space: nowrap;
  word-break: normal;
}
.img-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 300;
  background: rgba(15, 23, 42, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  cursor: zoom-out;
  overflow: hidden;
}
.img-lightbox.show {
  display: flex;
}
.img-lightbox img {
  max-width: 92vw;
  max-height: 82vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.img-lightbox-caption {
  margin-top: 12px;
  color: #cbd5e1;
  font-size: 0.875rem;
}

/* ---- Anchors below fixed navbar ---- */
.docs-section {
  scroll-margin-top: 5.5rem;
}

/* ---- Page header chips ---- */
.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.375rem 0.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #475569;
  white-space: nowrap;
}
.info-chip strong {
  color: #0f172a;
  font-weight: 600;
}

/* ---- Sidebar ---- */
.sidebar-group-title {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  padding: 0 0.75rem;
}
.sidebar-link {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #64748b;
  border-radius: 0.5rem;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}
.sidebar-link:hover {
  color: #111827;
  background: #f8fafc;
}
.sidebar-link.active {
  color: #059669;
  background: #ecfdf5;
  border-left-color: #10b981;
  font-weight: 600;
}

/* ---- Mobile section chips ---- */
.chip-nav {
  display: flex;
  gap: 0.5rem;
  width: max-content;
  white-space: nowrap;
}
.chip-link {
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  color: #475569;
  background: #f1f5f9;
  border-radius: 9999px;
  transition: all 0.15s;
}
.chip-link:hover {
  background: #ecfdf5;
  color: #059669;
}

/* ---- Content headings ---- */
.docs-content h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: #111827;
  margin: 3rem 0 0.5rem;
  letter-spacing: -0.01em;
}
.docs-content h2:first-child {
  margin-top: 0;
}
.section-desc {
  color: #64748b;
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  max-width: 46rem;
}

/* ---- Endpoint card ---- */
.endpoint-card {
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #fff;
  padding: 1.25rem;
  margin: 1.25rem 0 2.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.endpoint-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 1rem;
}
.method-badge {
  background: #10b981;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  flex-shrink: 0;
}
.endpoint-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.3rem 0.75rem;
  border-radius: 0.5rem;
  color: #334155;
  overflow-wrap: anywhere;
}
.endpoint-head .copy-btn {
  margin-left: auto;
}
.sub-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
  margin: 1.5rem 0 0.5rem;
}
.sub-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: -0.25rem 0 0.625rem;
}

/* ---- Tables ---- */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin: 0.75rem 0;
}
.docs-table th {
  background: #f8fafc;
  text-align: left;
  padding: 0.625rem 0.875rem;
  border: 1px solid #e5e7eb;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}
.docs-table td {
  padding: 0.625rem 0.875rem;
  border: 1px solid #e5e7eb;
  color: #475569;
  vertical-align: top;
  line-height: 1.6;
}
.docs-table code,
.docs-content p code,
.docs-content li code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.25rem;
  padding: 0.1rem 0.35rem;
  color: #0f172a;
  white-space: nowrap;
}
.td-required {
  color: #059669;
  font-weight: 600;
}
.td-optional {
  color: #94a3b8;
}

/* ---- Code blocks ---- */
.code-block {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 0.75rem 0;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}
.code-block-header .code-lang {
  font-size: 0.6875rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.code-block pre {
  margin: 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
}
.code-block pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #e2e8f0;
  background: transparent;
  padding: 0;
}
/* neutralize highlight.js default background/padding */
.code-block pre code.hljs {
  background: transparent;
  padding: 0;
  display: block;
}

/* ---- Collapsible code sections (curl & data samples) ---- */
.code-details {
  margin: 1rem 0;
}
.code-details summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
  padding: 0.4rem 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
  user-select: none;
  transition: all 0.15s;
}
.code-details summary:hover {
  color: #059669;
  border-color: #a7f3d0;
  background: #ecfdf5;
}
.code-details summary::-webkit-details-marker {
  display: none;
}
.code-details summary::after {
  content: '▸';
  margin-left: auto;
  font-size: 0.75rem;
  color: #94a3b8;
  transition: transform 0.15s;
}
.code-details[open] summary::after {
  transform: rotate(90deg);
}
.code-details .details-hint {
  font-weight: 400;
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
}
.code-details .code-block {
  margin-top: 0.75rem;
}

/* ---- Scrollable code block (long data samples) ---- */
.code-block-scroll pre {
  max-height: 480px;
  overflow-y: auto;
}

/* ---- Copy button ---- */
.copy-btn {
  font-size: 0.75rem;
  color: #94a3b8;
  background: transparent;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
  flex-shrink: 0;
}
.copy-btn:hover {
  color: #e2e8f0;
  border-color: #475569;
}
.copy-btn.copied {
  color: #34d399;
  border-color: #059669;
}

/* ---- Callout ---- */
.callout {
  border-left: 4px solid #10b981;
  background: #ecfdf5;
  padding: 0.875rem 1.125rem;
  border-radius: 0 0.5rem 0.5rem 0;
  color: #065f46;
  font-size: 0.875rem;
  line-height: 1.7;
  margin: 1rem 0;
}
.callout.warn {
  border-left-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

/* ---- Prose lists ---- */
.docs-content ul.prose-list {
  list-style: disc;
  padding-left: 1.25rem;
  color: #475569;
  font-size: 0.875rem;
  line-height: 1.8;
}
.docs-content p {
  color: #475569;
  font-size: 0.9375rem;
  line-height: 1.8;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .endpoint-head .copy-btn {
    margin-left: 0;
  }
}
