/* =============================================================
   BizCity API Docs — Styles
   Two-column layout: sidebar nav + content
   ============================================================= */

/* ── Layout ── */
.apd-wrap {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  min-height: 80vh;
  font-family: "Inter", sans-serif;
  color: #1a1a2e;
}

/* Flatsome reset */
#content.content-area:has(.apd-wrap) {
  padding: 0;
  max-width: none;
  width: 100%;
}

/* ── Sidebar ── */
.apd-sidebar {
  width: 260px;
  min-width: 260px;
  background: #fafafa;
  border-right: 1px solid #e5e7eb;
  padding: 24px 0 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
}
.apd-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 15px;
  color: #111;
  text-decoration: none;
}
.apd-sidebar-logo svg { flex-shrink: 0; }
.apd-sidebar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
  padding: 8px 20px 4px;
}
.apd-nav { list-style: none; margin: 0; padding: 0; }
.apd-nav li { margin: 0; }
.apd-nav a {
  display: block;
  padding: 7px 20px 7px 20px;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.apd-nav a:hover {
  background: #f3f4f6;
  color: #111;
}
.apd-nav a.active {
  background: #eff6ff;
  color: #2563eb;
  border-left-color: #2563eb;
  font-weight: 600;
}

/* ── Main content ── */
.apd-main {
  flex: 1;
  min-width: 0;
  padding: 32px 40px 60px;
  max-width: 900px;
}
.apd-main h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #111 !important;
}
.apd-main h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 40px 0 12px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  color: #111 !important;
}
.apd-main h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 8px;
  color: #111 !important;
}
.apd-main p {
  line-height: 1.7;
  margin: 0 0 16px;
  color: #374151;
  font-size: 15px;
}
.apd-main a { color: #2563eb; }
.apd-main a:hover { text-decoration: underline; }

/* ── Subtitle ── */
.apd-subtitle {
  font-size: 16px;
  color: #6b7280;
  margin: 0 0 28px;
}

/* ── Code blocks ── */
.apd-code-wrap {
  margin: 0 0 20px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}
.apd-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1e293b;
  padding: 8px 14px;
  font-size: 12px;
  color: #94a3b8;
}
.apd-code-header .apd-lang {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.apd-copy-btn {
  background: none;
  border: 1px solid #475569;
  border-radius: 4px;
  color: #94a3b8;
  cursor: pointer;
  font-size: 12px;
  padding: 3px 10px;
  transition: all .15s;
}
.apd-copy-btn:hover { background: #334155; color: #e2e8f0; }
pre.apd-code {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px 18px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
}
pre.apd-code .hl-key   { color: #7dd3fc; }
pre.apd-code .hl-str   { color: #86efac; }
pre.apd-code .hl-num   { color: #fdba74; }
pre.apd-code .hl-cmt   { color: #64748b; font-style: italic; }
pre.apd-code .hl-kw    { color: #c4b5fd; }
pre.apd-code .hl-fn    { color: #fbbf24; }
pre.apd-code .hl-bool  { color: #fdba74; }

/* Inline code */
.apd-main code:not([class]) {
  background: #f1f5f9;
  color: #e11d48;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13.5px;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

/* ── Tables ── */
.apd-table-wrap {
  margin: 0 0 20px;
  overflow-x: auto;
}
.apd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.apd-table th {
  text-align: left;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}
.apd-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  vertical-align: top;
}
.apd-table tr:hover td { background: #fafbfc; }
.apd-table code {
  background: #f1f5f9;
  color: #e11d48;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
}

/* ── Method badges ── */
.apd-method {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: .03em;
  vertical-align: middle;
}
.apd-method-get  { background: #dcfce7; color: #166534; }
.apd-method-post { background: #dbeafe; color: #1e40af; }
.apd-method-del  { background: #fee2e2; color: #991b1b; }

/* ── Alert boxes ── */
.apd-alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
}
.apd-alert-info  { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e40af; }
.apd-alert-warn  { background: #fffbeb; border-left: 4px solid #f59e0b; color: #92400e; }
.apd-alert-tip   { background: #f0fdf4; border-left: 4px solid #22c55e; color: #166534; }
.apd-alert strong { display: block; margin-bottom: 4px; }

/* ── Endpoint box ── */
.apd-endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 20px;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 14px;
  color: #334155;
}
.apd-endpoint-url { word-break: break-all; }

/* ── Param list ── */
.apd-params { margin: 0 0 24px; }
.apd-param {
  border-bottom: 1px solid #f1f5f9;
  padding: 12px 0;
}
.apd-param:last-child { border-bottom: none; }
.apd-param-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.apd-param-name {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  color: #111;
}
.apd-param-type {
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 3px;
}
.apd-param-required {
  font-size: 11px;
  color: #dc2626;
  font-weight: 600;
}
.apd-param-desc {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

/* ── Section nav (bottom) ── */
.apd-nav-bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}
.apd-nav-btn {
  display: flex;
  flex-direction: column;
  padding: 12px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  color: #374151;
  transition: all .15s;
  max-width: 45%;
}
.apd-nav-btn:hover { border-color: #2563eb; color: #2563eb; text-decoration: none; }
.apd-nav-btn small { font-size: 12px; color: #9ca3af; margin-bottom: 2px; }
.apd-nav-btn strong { font-size: 14px; }
.apd-nav-btn-next { text-align: right; margin-left: auto; }

/* ── TOC (right column on large screens) ── */
.apd-toc {
  width: 200px;
  min-width: 200px;
  padding: 32px 16px 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid #f1f5f9;
  display: none; /* shown on xl */
}
.apd-toc-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
  margin: 0 0 10px;
}
.apd-toc a {
  display: block;
  font-size: 13px;
  color: #6b7280;
  text-decoration: none;
  padding: 3px 0;
  line-height: 1.4;
}
.apd-toc a:hover { color: #2563eb; }

/* ── Responsive ── */
@media (min-width: 1400px) {
  .apd-toc { display: block; }
}
@media (max-width: 900px) {
  .apd-wrap { flex-direction: column; }
  .apd-sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 0;
  }
  .apd-nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 16px; }
  .apd-nav a { padding: 6px 12px; border-radius: 6px; border-left: none; font-size: 13px; }
  .apd-nav a.active { border-left: none; }
  .apd-sidebar-label { display: none; }
  .apd-sidebar-logo { padding: 0 16px 12px; }
  .apd-main { padding: 24px 16px 40px; }
  .apd-toc { display: none; }
}

/* ── Copy success animation ── */
.apd-copy-btn.copied {
  color: #22c55e;
  border-color: #22c55e;
}
