/* Two-column API page layout */
.api-page {
  display: flex;
  gap: 2em;
  align-items: flex-start;
}

.api-page-left { flex: 1; min-width: 0; }

.api-page-right {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 4rem;
}

.api-example {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #0d1a5e;
  font-size: 0.82em;
  background: #000418;
}

.api-example-title {
  background: #050e42;
  padding: 6px 14px;
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
  border-bottom: 1px solid #0d1a5e;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.api-example-select {
  background: transparent;
  border: none;
  color: inherit;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: inherit;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  flex: 1;
  min-width: 0;
}

.api-example-select option {
  background: #000825;
  text-transform: none;
  font-weight: normal;
  letter-spacing: normal;
}

.api-example-copy {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 2px 4px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.api-example-copy:hover { opacity: 1; }

.json-line {
  padding: 0 14px;
  margin: 0 -14px;
  border-radius: 2px;
  transition: background 0.1s;
}

.json-line:hover { background: rgba(255, 255, 255, 0.05); }
.json-line-highlighted { background: rgba(227, 0, 126, 0.12); }

.api-example pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  overflow-y: visible;
  background: transparent;
  border: none;
  border-radius: 0;
}

.api-example pre code.hljs {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

@media (max-width: 900px) {
  .api-page { flex-direction: column; }
  .api-page-right { width: 100%; position: static; }
}

/* Response blocks */
.api-responses { margin: 1em 0; }

.api-response {
  border: 1px solid #0d1a5e;
  border-radius: 4px;
  margin-bottom: 6px;
  overflow: hidden;
}

.api-response-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.api-response-summary::-webkit-details-marker { display: none; }
.api-response-summary:hover { background: #050e42; }
.api-response-summary-no-body { cursor: default; }
.api-response-summary-no-body::after { display: none !important; }

.api-response-summary::after {
  content: '▶';
  font-size: 0.6em;
  margin-left: auto;
  opacity: 0.4;
  transition: transform 0.15s;
}

.api-response[open] > .api-response-summary::after { transform: rotate(90deg); }

.api-response-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.api-response-dot-success  { background: #3fb950; }
.api-response-dot-redirect { background: #d29922; }
.api-response-dot-error    { background: #f85149; }
.api-response-dot-default  { background: #8b949e; }

.api-response-code {
  font-weight: 700;
  font-size: 0.9em;
}

.api-response-desc {
  font-size: 0.88em;
  opacity: 0.7;
}

.api-response-body {
  border-top: 1px solid #0d1a5e;
  padding: 12px 14px;
}

.api-response-body-title {
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 10px;
}

/* Nav method badges */
.nav-list-link {
  display: flex !important;
  align-items: center;
  width: 100%;
  gap: 6px;
}

.nav-method-badge {
  flex-shrink: 0;
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.6;
  margin-left: auto;
}

.nav-method-get    { background: #1a3a52; color: #58a6ff; }
.nav-method-post   { background: #1a3a2a; color: #3fb950; }
.nav-method-patch  { background: #3a2a10; color: #d29922; }
.nav-method-put    { background: #2a2a10; color: #e3b341; }
.nav-method-delete { background: #3a1a1a; color: #f85149; }

/* HTTP method badges */
.api-method-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  vertical-align: middle;
}

.api-method-get    { background: #1a3a52; color: #58a6ff; }
.api-method-post   { background: #1a3a2a; color: #3fb950; }
.api-method-patch  { background: #3a2a10; color: #d29922; }
.api-method-put    { background: #2a2a10; color: #e3b341; }
.api-method-delete { background: #3a1a1a; color: #f85149; }

/* Param blocks */
.api-params {
  margin: 1em 0;
  border: 1px solid #0d1a5e;
  border-radius: 4px;
  overflow: hidden;
}

.api-param {
  padding: 12px 16px;
  border-bottom: 1px solid #0d1a5e;
}

.api-param:last-child { border-bottom: none; }

.api-param-highlighted {
  background: rgba(227, 0, 126, 0.08);
  transition: background 0.15s;
}

@keyframes param-flash {
  0%   { background: rgba(227, 0, 126, 0.35); }
  100% { background: rgba(227, 0, 126, 0.08); }
}

@keyframes json-flash {
  0%   { background: rgba(227, 0, 126, 0.35); }
  100% { background: rgba(227, 0, 126, 0.12); }
}

.api-param-flash { animation: param-flash 0.6s ease-out; }
.json-line-flash { animation: json-flash 0.6s ease-out; }

.api-param-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.api-param-name { font-weight: 700; }

.api-param-type {
  font-size: 0.82em;
  opacity: 0.55;
}

.api-param-required {
  font-size: 0.78em;
  font-weight: 600;
  color: #f96e65;
}

.api-param-desc {
  font-size: 0.88em;
  margin: 6px 0 0;
  opacity: 0.75;
}

.api-param-enum {
  font-size: 0.82em;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.api-param-enum code {
  border: 1px solid #0d1a5e;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 1em;
}

/* Nested param children */
.api-param-children {
  border-left: 2px solid #E3007E;
  margin-top: 10px;
  margin-left: 2px;
  border-radius: 0;
  overflow: hidden;
}

.api-param-children-title {
  padding: 5px 10px;
  font-size: 0.68em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #E3007E;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  opacity: 0.85;
}

.api-param-children-title:hover { opacity: 1; }

.api-param-children-title::-webkit-details-marker { display: none; }

.api-param-children-title::before {
  content: '▶';
  font-size: 0.6em;
  transition: transform 0.15s;
}

.api-param-children[open] > .api-param-children-title::before { transform: rotate(90deg); }

.api-param-children > .api-param {
  border-bottom: 1px solid #0d1a5e;
  border-radius: 0;
  margin: 0;
  padding-left: 14px;
}

.api-param-children > .api-param:last-child { border-bottom: none; }
