/* ============================================================
   AeroXplorer API Docs — styles
   Tokens
   ============================================================ */
:root {
  --blue: #0b539f;
  --blue-dark: #083f79;
  --blue-tint: #eef4fb;
  --blue-tint-2: #dfeaf8;
  --ink: #131c26;
  --ink-soft: #52616f;
  --line: #e2e8f0;
  --line-soft: #edf1f5;
  --white: #ffffff;
  --success: #1a8754;
  --success-tint: #e8f6ee;
  --amber: #b0690f;
  --amber-tint: #fbf0e2;
  --danger: #c53030;
  --danger-tint: #fbe9e9;
  --code-bg: #0f2038;
  --code-text: #dbe7f7;

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', ui-monospace, 'Cascadia Code', Consolas, 'Liberation Mono', monospace;

  --radius: 8px;
  --radius-sm: 5px;
  --header-h: 64px;
  --sidebar-w: 280px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
}

body { font-size: 15px; line-height: 1.55; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

code, pre { font-family: var(--font-mono); }

::selection { background: var(--blue-tint-2); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  z-index: 100;
  gap: 12px;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  content: '';
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink);
  position: relative;
}
.menu-toggle span::before { position: absolute; top: -5px; }
.menu-toggle span::after { position: absolute; top: 5px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand img {
  height: 30px;
  width: auto;
  display: block;
}
.brand__title {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__title small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: .03em;
  text-transform: uppercase;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--blue);
  color: var(--white);
}
.btn--primary:hover { background: var(--blue-dark); }

.btn--ghost {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--blue); color: var(--blue); }

.btn--sm { padding: 6px 10px; font-size: 12.5px; }

.token-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--white);
}
.token-pill__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}
.token-pill.is-set .token-pill__dot { background: var(--success); }
.token-pill.is-set { color: var(--ink); border-color: var(--success); background: var(--success-tint); }

/* ============================================================
   Shell layout
   ============================================================ */
.shell {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  border-right: 1px solid var(--line);
  background: var(--white);
  overflow-y: auto;
  padding: 20px 12px 40px;
  z-index: 90;
}

.sidebar__search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  margin-bottom: 18px;
  background: var(--white);
  color: var(--ink);
}
.sidebar__search:focus { border-color: var(--blue); }

.nav-group { margin-bottom: 6px; }
.nav-group__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 10px 10px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 2px;
}
.nav-link:hover { background: var(--line-soft); text-decoration: none; }
.nav-link.is-active { background: var(--blue-tint); color: var(--blue-dark); font-weight: 600; }

.method-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--blue-tint);
  color: var(--blue-dark);
  flex-shrink: 0;
  letter-spacing: .02em;
}

.nav-link__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lock-icon { margin-left: auto; flex-shrink: 0; opacity: .55; }

/* ============================================================
   Main content
   ============================================================ */
.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 32px 40px 100px;
  max-width: 900px;
}

.intro h1 {
  font-size: 28px;
  margin: 0 0 6px;
  letter-spacing: -.01em;
}
.intro .version-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--blue-tint);
  color: var(--blue-dark);
  padding: 3px 8px;
  border-radius: 5px;
  margin-left: 8px;
  vertical-align: middle;
}
.intro p {
  color: var(--ink-soft);
  max-width: 640px;
  margin: 12px 0 0;
}
.intro .base-url {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--blue-tint);
  border: 1px solid var(--blue-tint-2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--blue-dark);
}

.endpoint {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 40px;
  overflow: hidden;
  scroll-margin-top: 84px;
}

.endpoint__head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.endpoint__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.endpoint__title {
  font-size: 17px;
  font-weight: 650;
  margin: 0;
}

.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: .02em;
}
.badge--get { background: var(--blue-tint); color: var(--blue-dark); }
.badge--auth { background: var(--amber-tint); color: var(--amber); }
.badge--public { background: var(--success-tint); color: var(--success); }

.endpoint__path {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-top: 8px;
  word-break: break-all;
}

.endpoint__desc {
  color: var(--ink-soft);
  margin: 10px 0 0;
  font-size: 14px;
  max-width: 640px;
}

.endpoint__body { padding: 20px 22px 22px; }

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 10px;
}

.param-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-bottom: 22px;
  font-size: 13.5px;
}
.param-table th:nth-child(1),
.param-table td:nth-child(1) { width: 26%; }
.param-table th:nth-child(2),
.param-table td:nth-child(2) { width: 26%; }
.param-table th:nth-child(3),
.param-table td:nth-child(3) { width: 48%; }
.param-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-soft);
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}
.param-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.param-table tr:last-child td { border-bottom: none; }
.param-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: break-word;
}
.param-required {
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}
.param-type {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue-dark);
  background: var(--blue-tint);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.param-desc { color: var(--ink-soft); overflow-wrap: break-word; }

.field {
  margin-bottom: 12px;
}
.field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 5px;
  font-family: var(--font-mono);
}
.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: var(--font-mono);
  color: var(--ink);
  background: var(--white);
}
.field input:focus { border-color: var(--blue); }
.field input::placeholder { color: #a7b2bd; }

.try-panel {
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 6px;
}

.try-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 16px;
}

.try-panel__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.auth-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}
.auth-note.is-missing { color: var(--amber); }

.request-preview {
  margin-top: 14px;
}
.request-preview__url {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  overflow-x: auto;
  white-space: nowrap;
}
.request-preview__url .verb {
  color: #7dd3fc;
  font-weight: 700;
  margin-right: 8px;
}

.response-panel { margin-top: 18px; }
.response-panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.status-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
}
.status-pill--ok { background: var(--success-tint); color: var(--success); }
.status-pill--err { background: var(--danger-tint); color: var(--danger); }
.status-pill--pending { background: var(--line-soft); color: var(--ink-soft); }

.response-time { font-size: 12px; color: var(--ink-soft); font-family: var(--font-mono); }

.json-viewer {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12.8px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  max-height: 420px;
  overflow-y: auto;
}
.json-viewer:empty::before {
  content: 'Response will appear here after you send a request.';
  color: #7086a3;
  font-style: italic;
  white-space: normal;
}

.jv-key { color: #7dd3fc; }
.jv-string { color: #a8e6a1; }
.jv-number { color: #f0b86e; }
.jv-boolean { color: #f4a4c7; }
.jv-null { color: #9fb0c3; }
.jv-punc { color: #7086a3; }

/* ============================================================
   Overlay for mobile sidebar
   ============================================================ */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(19, 28, 38, .35);
  z-index: 80;
}
.overlay.is-visible { display: block; }

/* ============================================================
   Token modal
   ============================================================ */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(19, 28, 38, .45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.is-visible { display: flex; }

.modal {
  background: var(--white);
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(11, 83, 159, .18);
}
.modal h2 {
  font-size: 17px;
  margin: 0 0 6px;
}
.modal p {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin: 0 0 16px;
}
.modal .field input { font-size: 13.5px; }
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.modal__close {
  position: absolute;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    width: 82vw;
    max-width: 320px;
    box-shadow: 0 0 40px rgba(0,0,0,.12);
  }
  .sidebar.is-open { transform: translateX(0); }
  .menu-toggle { display: flex; }
  .main { margin-left: 0; padding: 24px 18px 80px; }
  .brand__title { font-size: 13.5px; }
  .btn span.btn-label { display: none; }
  .try-panel__grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .topbar { padding: 0 12px; }
  .token-pill span.token-pill-label { display: none; }
}