/* VisualPay API Guide — 1xGate-style layout, panel-aligned dark theme */
:root {
  --page-bg: #000000;
  --sidebar-bg: #0a0a0a;
  --card-bg: #111111;
  --card-bg-elevated: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #999999;
  --text-muted: #808080;
  --border-color: #222222;
  --accent: #fdb813;
  --accent-hover: #e5a610;
  --accent-soft: rgba(253, 184, 19, 0.14);
  --accent-on: #000000;
  --success: #10b981;
  --info: #3b82f6;
  --warning: #f59e0b;
  --sidebar-width: 280px;
  --header-height: 60px;
  --content-max: 860px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #333333 transparent;
}

body.api-guide {
  margin: 0;
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: "Roboto", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

.api-guide__layout {
  min-height: 100vh;
}

.api-guide__sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow: hidden;
}

.api-guide__sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--header-height);
  min-height: var(--header-height);
  padding: 0 18px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.api-guide__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.api-guide__brand img {
  display: block;
  width: 28px;
  height: 28px;
}

.api-guide__brand-name {
  display: inline-flex;
  align-items: baseline;
  font-size: 15px;
  font-weight: 600;
}

.api-guide__brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  white-space: nowrap;
}

.brand-visual {
  color: #ffffff;
}

.brand-pay {
  color: var(--accent);
}

.api-guide__sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.api-guide__nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px 24px;
}

.api-guide__nav-group + .api-guide__nav-group {
  margin-top: 18px;
}

.api-guide__nav-label {
  padding: 0 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c8c8c8;
  cursor: default;
  user-select: none;
}

.api-guide__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.api-guide__nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
}

.api-guide__nav-icon {
  flex-shrink: 0;
  width: 16px;
  font-size: 14px;
  line-height: 1;
  text-align: center;
  opacity: 0.8;
}

.api-guide__nav-link.is-active .api-guide__nav-icon {
  opacity: 1;
}

.api-guide__nav-link:hover {
  background: var(--card-bg);
  color: var(--text-primary);
}

.api-guide__nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.api-guide__sidebar-foot {
  margin-top: auto;
  padding: 10px 12px 10px;
  border-top: 1px solid var(--border-color);
}

.api-guide__dashboard-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  height: 34px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-on);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 24px -8px rgba(253, 184, 19, 0.45);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.api-guide__dashboard-btn:hover {
  background: var(--accent-hover);
  color: var(--accent-on);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -8px rgba(253, 184, 19, 0.55);
}

.api-guide__backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 30;
}

.api-guide__main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.api-guide__topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-height);
  min-height: var(--header-height);
  padding: 0 24px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.api-guide__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-primary);
  cursor: pointer;
}

.api-guide__topbar-title {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.api-guide__topbar-version {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.api-guide__swagger-link {
  margin-left: auto;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}

.api-guide__swagger-link:hover {
  color: var(--accent-hover);
}

.api-guide__content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.api-guide__hero {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
}

.api-guide__hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
  font-weight: 700;
}

.api-guide__hero p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
}

.api-guide__section {
  margin-bottom: 56px;
  scroll-margin-top: calc(var(--header-height) + 20px);
}

.api-guide__section h2 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 700;
}

.api-guide__section h3 {
  margin: 28px 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.api-guide__section p {
  margin: 0 0 14px;
  color: var(--text-secondary);
}

.api-guide__section code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
  color: var(--accent);
}

.api-guide__base-url {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--card-bg);
}

.api-guide__base-url-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.api-guide__base-url code {
  font-size: 15px;
  color: var(--text-primary);
}

.api-guide__callout {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-secondary);
}

.api-guide__callout strong {
  color: var(--text-primary);
}

.api-guide__callout--warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}

.api-guide__callout--info {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.25);
}

.api-guide__endpoint-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.api-guide__method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.api-guide__method--get {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.api-guide__method--post {
  background: var(--accent-soft);
  color: var(--accent);
}

.api-guide__path {
  font-size: 14px;
  color: var(--text-primary) !important;
  word-break: break-all;
}

.api-guide__table-wrap {
  overflow-x: auto;
  margin: 12px 0 4px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.api-guide__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.api-guide__table th,
.api-guide__table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.api-guide__table th {
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.api-guide__table tr:last-child td {
  border-bottom: 0;
}

.api-guide__table td {
  color: var(--text-secondary);
}

.api-guide__code-block {
  margin-top: 10px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
}

.api-guide__code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  background: var(--card-bg-elevated);
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.api-guide__copy-btn {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
}

.api-guide__copy-btn:hover {
  color: var(--text-primary);
  border-color: #444444;
}

.api-guide__code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
}

.api-guide__code-block code {
  color: #e5e7eb;
  white-space: pre;
}

.api-guide__status-list {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.api-guide__status-item {
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--card-bg);
}

.api-guide__status-item code {
  display: inline-block;
  margin-bottom: 6px;
  font-weight: 600;
}

.api-guide__status-item p {
  margin: 0;
}

.api-guide__footer {
  margin-top: auto;
  padding: 20px 24px 28px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.api-guide__footer a {
  color: var(--accent);
  text-decoration: none;
}

.api-guide__footer a:hover {
  color: var(--accent-hover);
}

@media (max-width: 960px) {
  .api-guide__sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .api-guide__sidebar.is-open {
    transform: translateX(0);
  }

  .api-guide__sidebar-close {
    display: inline-flex;
  }

  .api-guide__backdrop.is-visible {
    display: block;
  }

  .api-guide__main {
    margin-left: 0;
  }

  .api-guide__menu-btn {
    display: inline-flex;
  }

  .api-guide__content {
    padding-top: 28px;
  }
}
