:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: rgba(15, 23, 42, 0.08);
  --accent: #0f6fe9;
  --accent-2: #16a34a;
  --header: rgba(255, 255, 255, 0.85);
  --code-bg: #0b1220;
  --code-text: #dbeafe;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  --input-bg: #ffffff;
  --input-text: #111827;
  --input-border: rgba(15, 23, 42, 0.12);
  --input-placeholder: #94a3b8;
  --docs-header-height: 72px;
}

html[data-theme="dark"] {
  --bg: #0c111b;
  --card: #121826;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.15);
  --accent: #5fa8ff;
  --accent-2: #34d399;
  --header: rgba(12, 17, 27, 0.88);
  --code-bg: #080c14;
  --code-text: #dbeafe;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  --input-bg: #0f172a;
  --input-text: #e5e7eb;
  --input-border: rgba(148, 163, 184, 0.35);
  --input-placeholder: #64748b;
}

body.docs {
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.docs-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
}

.docs-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}

.docs-brand small {
  color: var(--muted);
  font-weight: 600;
}

.docs-nav {
  display: flex;
  gap: 18px;
  font-size: 0.95rem;
}

.docs-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.docs-nav a:hover {
  color: var(--accent);
}

.btn-theme {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
}

.hero-card {
  background: linear-gradient(130deg, rgba(15, 111, 233, 0.12), transparent 55%);
  padding: 22px 24px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.hero-card h1 {
  font-weight: 700;
  margin-bottom: 8px;
}

.hero-card p {
  color: var(--muted);
  margin-bottom: 12px;
}

.hero-badges .badge {
  background: var(--accent);
  color: #fff;
  margin-right: 6px;
  font-size: 0.75rem;
}

.hero-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-actions small {
  color: var(--muted);
  font-size: 0.78rem;
}

.docs-section {
  padding: 24px;
}

.docs-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  gap: 20px;
  max-width: 1500px;
  margin: 0 auto;
}

.docs-sidebar,
.docs-content,
.docs-aside {
  min-width: 0;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--docs-header-height) + 16px);
  align-self: start;
  height: calc(100vh - var(--docs-header-height) - 32px);
  display: flex;
  flex-direction: column;
}

.docs-search {
  position: relative;
  margin-bottom: 14px;
}

.docs-search input {
  padding-right: 70px;
}

.shortcut-hint {
  position: absolute;
  right: 10px;
  top: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 0.7rem;
  color: var(--muted);
}

.docs-nav-list {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 14px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 12px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}

.nav-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.78rem;
}

.nav-item.active {
  background: rgba(15, 111, 233, 0.15);
  color: var(--accent);
  font-weight: 600;
}

.docs-content {
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}

.docs-content h2 {
  margin-top: 12px;
  margin-bottom: 10px;
  font-weight: 700;
}

.docs-content h3 {
  margin-top: 20px;
  margin-bottom: 8px;
  font-weight: 600;
}

.endpoint-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.endpoint-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.endpoint-headline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.endpoint-route {
  font-family: "Fira Code", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.82rem;
  color: var(--muted);
}

.section-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 90%, var(--accent) 10%);
}

.endpoint-counter {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.endpoint-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
}

.endpoint-block h3 {
  margin-top: 0;
}

.endpoint-description,
.endpoint-note {
  color: var(--muted);
}

.endpoint-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
}

.endpoint-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.endpoint-path {
  font-family: "Fira Code", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.83rem;
  color: var(--muted);
}

.method-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.method-GET { background: #0ea5e9; }
.method-POST { background: #16a34a; }
.method-PUT { background: #f59e0b; }
.method-DELETE { background: #ef4444; }

.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
}

.docs-table th,
.docs-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
  font-size: 0.88rem;
}

.docs-table th {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.code-block {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 14px;
  border-radius: 12px;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 10px;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lang-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.lang-title {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lang-card .code-block {
  margin-top: 8px;
  max-height: 280px;
  overflow: auto;
}

.docs-pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  gap: 10px;
}

.docs-pagination .btn {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.docs-aside .docs-card {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.version-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  margin-bottom: 8px;
}

.on-this-page a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.api-response {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 12px;
  padding: 10px;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.75rem;
  max-height: 220px;
  overflow: auto;
}

.docs .form-control,
.docs .form-select,
.docs .form-control-sm,
.docs .form-select-sm,
.docs textarea {
  background: var(--input-bg);
  color: var(--input-text);
  border-color: var(--input-border);
}

.docs .form-control::placeholder,
.docs textarea::placeholder {
  color: var(--input-placeholder);
}

.docs .form-control:focus,
.docs .form-select:focus,
.docs textarea:focus {
  background: var(--input-bg);
  color: var(--input-text);
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(15, 111, 233, 0.15);
}

@media (max-width: 1200px) {
  .docs-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .docs-aside {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  :root {
    --docs-header-height: 120px;
  }
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .docs-nav {
    flex-wrap: wrap;
  }
  .docs-sidebar {
    position: static;
    height: auto;
  }

  .lang-grid {
    grid-template-columns: 1fr;
  }
}
