/* FXPay docs — design tokens (teal / stone, distinct from legacy blue-slate) */
:root {
  --font-sans: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", monospace;

  --primary-color: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #2dd4bf;
  --accent-warm: #ea580c;
  --accent-violet: #7c3aed;

  --secondary-color: #78716c;
  --background-color: #fafaf9;
  --surface-color: #ffffff;
  --surface-muted: #f5f5f4;

  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --border-color: #e7e5e4;
  --border-strong: #d6d3d1;

  --success-color: #059669;
  --error-color: #dc2626;
  --warning-color: #d97706;

  --code-background: #1c1917;
  --code-text: #fafaf9;

  --focus-ring: color-mix(in srgb, var(--primary-color) 28%, transparent);

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-pill: 9999px;

  --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 4px 14px rgba(28, 25, 23, 0.07);
  --shadow-lg: 0 14px 44px -12px rgba(28, 25, 23, 0.2), 0 0 0 1px rgba(28, 25, 23, 0.04);

  --header-h: 5rem;
}

[data-theme="dark"] {
  --background-color: #0c0a09;
  --surface-color: #1c1917;
  --surface-muted: #292524;
  --text-primary: #fafaf9;
  --text-secondary: #a8a29e;
  --border-color: #44403c;
  --border-strong: #57534e;
  --code-background: #0c0a09;
  --code-text: #e7e5e4;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.45);
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--background-color);
  background-image:
    radial-gradient(ellipse 100% 60% at 100% -15%, color-mix(in srgb, var(--primary-color) 14%, transparent), transparent 52%),
    radial-gradient(ellipse 70% 45% at 0% 105%, color-mix(in srgb, var(--accent-warm) 10%, transparent), transparent 48%);
  transition: background-color 0.3s ease, color 0.3s ease;
}

html {
  scroll-padding-top: calc(var(--header-h) + 0.75rem);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--surface-color) 88%, transparent);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--primary-color) 8%, transparent);
}

.header-content {
  width: 100%;
  max-width: 100%;
  padding: 0.875rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.875rem;
}

/* Hamburger — hidden on large screens */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-toggle:hover {
  background: var(--surface-color);
  box-shadow: var(--shadow);
}

.nav-toggle-bar {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.logo-mark {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 0.55rem 0.45rem;
  border-radius: var(--radius-md);
  color: #fff;
  background: linear-gradient(145deg, var(--primary-dark), var(--primary-light));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary-color) 35%, transparent);
}

.logo-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  margin: 0;
  min-width: 0;
  font-weight: inherit;
}

.logo-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--text-primary);
}

.logo-tagline {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
}

.version {
  flex-shrink: 0;
  margin-left: auto;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: #fff;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 1px 4px color-mix(in srgb, var(--primary-color) 40%, transparent);
}

.language-toggle {
  font-family: var(--font-sans);
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  margin-right: 0.5rem;
}

.language-toggle:hover {
  background: var(--surface-color);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.theme-toggle {
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
  background: var(--surface-color);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

/* Drawer overlay (mobile only; inactive on desktop) */
.sidebar-backdrop {
  display: none;
}

/* Container */
.container {
  display: flex;
  min-height: calc(100vh - var(--header-h));
  padding-top: var(--header-h);
  position: relative;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: 280px;
  height: calc(100vh - var(--header-h));
  background: linear-gradient(180deg, var(--surface-color) 0%, color-mix(in srgb, var(--surface-muted) 55%, var(--surface-color)) 100%);
  border-right: 1px solid var(--border-color);
  box-shadow: 4px 0 24px color-mix(in srgb, var(--primary-color) 4%, transparent);
  overflow-y: auto;
  padding: 1.75rem 0 2rem;
  z-index: 100;
}

.nav-section {
  margin-bottom: 2rem;
  padding: 0 1.5rem;
}

.nav-section h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.nav-section ul {
  list-style: none;
}

.nav-section li {
  margin-bottom: 0.25rem;
}

.nav-section a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.18s ease, color 0.18s ease;
  font-size: 0.875rem;
}

.nav-section a:hover {
  background: color-mix(in srgb, var(--primary-color) 14%, var(--surface-muted));
  color: var(--text-primary);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: block;
  margin-bottom: 0.25rem;
}

.nav-item a {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.18s ease, color 0.18s ease;
  font-size: 0.875rem;
  line-height: 1.4;
  white-space: normal;
  overflow: hidden;
}

.nav-item a:hover {
  background: color-mix(in srgb, var(--primary-color) 14%, var(--surface-muted));
  color: var(--text-primary);
}

.method-tag {
  display: inline-block !important;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: 0.5rem;
  min-width: 2.5rem;
  text-align: center;
  visibility: visible !important;
  opacity: 1 !important;
}

.method-tag.get {
  background: #10b981;
  color: white;
}

.method-tag.post {
  background: #f59e0b;
  color: white;
}

.method-tag.patch {
  background: #8b5cf6;
  color: white;
}

.method-tag.put {
  background: #0d9488;
  color: white;
}

.method-tag.delete {
  background: #ef4444;
  color: white;
}

/* Ensure method tags are visible in sidebar */
.nav-section .method-tag {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: #10b981 !important;
  color: white !important;
  padding: 0.125rem 0.375rem !important;
  border-radius: 0.25rem !important;
  font-size: 0.625rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  margin-right: 0.5rem !important;
  min-width: 2.5rem !important;
  text-align: center !important;
  flex-shrink: 0 !important;
}

.nav-section .method-tag.get {
  background: #10b981 !important;
}

.nav-section .method-tag.post {
  background: #f59e0b !important;
}

.nav-section .method-tag.patch {
  background: #8b5cf6 !important;
}

.nav-section .method-tag.put {
  background: #0d9488 !important;
}

.nav-section .method-tag.delete {
  background: #ef4444 !important;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: calc(100vw - 280px);
  margin-left: 280px;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Ensure content doesn't overflow */
.main-content > * {
  max-width: 100%;
  box-sizing: border-box;
}

.content-section {
  margin-bottom: 4rem;
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}

.content-section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.content-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem 0;
  color: var(--text-primary);
}

.content-section p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* JWT Manager */
.jwt-manager {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.jwt-manager h2 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.token-input-group {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
}

.token-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.token-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.save-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary-color) 35%, transparent);
}

.save-btn:hover {
  background: var(--primary-dark);
}

.token-note {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.cors-notice {
  margin-top: 1rem;
  padding: 1rem;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 0.5rem;
  border-left: 4px solid #f39c12;
}

.cors-notice .notice-content h4 {
  margin: 0 0 0.5rem 0;
  color: #856404;
  font-size: 1rem;
}

.cors-notice .notice-content p {
  margin: 0;
  color: #856404;
  font-size: 0.875rem;
  line-height: 1.4;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--primary-color) 22%, var(--border-color));
}

.feature-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.875rem;
}

/* API Overview */
.api-overview {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin: 2rem 0;
}

.api-overview h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.api-overview p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.overview-item {
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
}

.overview-item h4 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.overview-item ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.overview-item li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.overview-item li:last-child {
  border-bottom: none;
}

/* Callback Note */
.callback-note {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.callback-note h4 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.callback-note ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.callback-note li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.5rem;
}

.callback-note li:before {
  content: "•";
  color: var(--primary-color);
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* Steps */
.steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 2rem 0;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.step-number {
  background: var(--primary-color);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.step-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
}

.step-content p {
  margin: 0;
  color: var(--text-secondary);
}

/* Code Tabs */
.code-tabs {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1rem 0;
  box-shadow: var(--shadow);
}

.tab-buttons {
  display: flex;
  background: var(--background-color);
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
  color: white;
  font-weight: 600;
}

.tab-btn:hover:not(.active) {
  background: color-mix(in srgb, var(--primary-color) 8%, var(--surface-color));
  color: var(--text-primary);
}

.tab-content {
  display: none;
  padding: 1.5rem;
}

.tab-content.active {
  display: block;
}

/* Code blocks */
pre {
  background: var(--code-background);
  border-radius: 0.5rem;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 0;
  max-width: 100%;
  box-sizing: border-box;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  word-break: break-all;
  white-space: pre-wrap;
}

/* API Endpoint Sections */
.api-endpoint {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
  box-shadow: var(--shadow);
}

.endpoint-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  min-height: 80px;
  flex-wrap: nowrap;
}

.endpoint-method-tag {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: white;
  min-width: 3.5rem;
  text-align: center;
  flex-shrink: 0;
}

.endpoint-method-tag.method-get {
  background: #10b981;
}

.endpoint-method-tag.method-post {
  background: #f59e0b;
}

.endpoint-method-tag.method-patch {
  background: #8b5cf6;
}

.endpoint-method-tag.method-put {
  background: #0d9488;
}

.endpoint-method-tag.method-delete {
  background: #ef4444;
}

.endpoint-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  justify-content: center;
  overflow: hidden;
}

.endpoint-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.25rem 0;
  color: var(--text-primary);
  line-height: 1.2;
  max-width: 100%;
  text-indent: 0;
  padding-left: 0;
  margin-left: 0;
  display: block;
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.endpoint-method {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: 0.75rem;
}

.method-get { background: #10b981; color: white; }
.method-post { background: #f59e0b; color: white; }
.method-patch { background: #8b5cf6; color: white; }
.method-put { background: #0d9488; color: white; }
.method-delete { background: #ef4444; color: white; }

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.endpoint-path-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.endpoint-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.endpoint-badge--merchant {
  background: color-mix(in srgb, var(--primary-color) 18%, var(--surface-muted));
  color: var(--primary-dark);
  border: 1px solid color-mix(in srgb, var(--primary-color) 28%, var(--border-color));
}

.endpoint-badge--agent {
  background: rgba(139, 92, 246, 0.18);
  color: #6d28d9;
}

.endpoint-badge--dev {
  background: rgba(234, 88, 12, 0.18);
  color: #ea580c;
}

[data-theme="dark"] .endpoint-badge--merchant {
  background: color-mix(in srgb, var(--primary-color) 22%, transparent);
  color: var(--primary-light);
  border-color: color-mix(in srgb, var(--primary-color) 40%, var(--border-color));
}

[data-theme="dark"] .endpoint-badge--agent {
  background: rgba(139, 92, 246, 0.35);
}

[data-theme="dark"] .endpoint-badge--dev {
  background: rgba(234, 88, 12, 0.3);
}

.endpoint-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.endpoint-description {
  margin-top: 0.5rem;
  color: var(--text-secondary);
  line-height: 1.4;
  text-indent: 0;
  padding-left: 0;
}

/* Workflow description card */
.workflow-description {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin: 1rem 0 1.5rem;
  color: var(--text-secondary);
  line-height: 1.7;
  box-shadow: var(--shadow);
  box-sizing: border-box;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.workflow-description > *:first-child {
  margin-top: 0;
}

.workflow-description > *:last-child {
  margin-bottom: 0;
}

.workflow-description p {
  margin: 0 0 1rem;
}

.workflow-description ol,
.workflow-description ul {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.workflow-description li {
  margin-bottom: 0.6rem;
}

.workflow-description li:last-child {
  margin-bottom: 0;
}

.workflow-description strong {
  color: var(--text-primary);
}

.workflow-description code {
  background: color-mix(in srgb, var(--primary-color) 12%, transparent);
  color: var(--primary-color);
  padding: 0.1rem 0.4rem;
  border-radius: 0.3rem;
  font-size: 0.85em;
  word-break: break-word;
  white-space: normal;
}

[data-theme="dark"] .workflow-description code {
  color: var(--primary-light);
  background: color-mix(in srgb, var(--primary-color) 22%, transparent);
}

/* Workflow: space between numbered steps and the Notes heading */
.workflow-description ol + p {
  margin-top: 1.75rem;
}

.workflow-description ol + p + ul {
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .workflow-description {
    padding: 1.25rem 1.1rem;
    margin: 0.75rem 0 1.25rem;
    border-radius: 0.75rem;
  }

  .workflow-description ol,
  .workflow-description ul {
    padding-left: 1.25rem;
  }

  .workflow-description li {
    margin-bottom: 0.75rem;
  }
}

@media (max-width: 480px) {
  .workflow-description {
    padding: 1rem 0.9rem;
  }

  .workflow-description ol,
  .workflow-description ul {
    padding-left: 1.1rem;
  }
}

.endpoint-content {
  padding: 1.5rem;
}

/* Try It Out Section */
.try-it-out {
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
  max-width: 100%;
  box-sizing: border-box;
}

.try-it-out h4 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.try-it-note {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group--checkbox label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group--checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.param-location {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--background-color);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.param-note {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-style: italic;
}

/* Parameters Section */
.parameters-section {
  margin: 2rem 0;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.parameters-section h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.parameters-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--background-color);
  border-radius: 0.5rem;
  overflow: hidden;
}

.parameters-table th {
  background: var(--surface-color);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.parameters-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.parameters-table tr:last-child td {
  border-bottom: none;
}

.parameters-table code {
  background: color-mix(in srgb, var(--primary-color) 8%, var(--surface-muted));
  padding: 0.125rem 0.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--primary-dark);
  border: 1px solid color-mix(in srgb, var(--primary-color) 18%, var(--border-color));
}

[data-theme="dark"] .parameters-table code {
  background: var(--surface-muted);
  color: var(--primary-light);
  border: 1px solid var(--border-color);
}

/* Response Examples */
.response-examples {
  margin: 2rem 0;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.response-examples h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.response-tabs {
  background: var(--background-color);
  border-radius: 0.5rem;
  overflow: hidden;
}

.response-tab-buttons {
  display: flex;
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
}

.response-tab-btn {
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-right: 1px solid var(--border-color);
}

.response-tab-btn:last-child {
  border-right: none;
}

.response-tab-btn:hover {
  background: var(--background-color);
  color: var(--text-primary);
}

.response-tab-btn.active {
  background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
  color: white;
  font-weight: 600;
}

.response-tab-content {
  display: none;
  padding: 1.5rem;
}

.response-tab-content.active {
  display: block;
}

.response-content-type {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-style: italic;
}

.response-tab-content pre {
  background: var(--code-background);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 0;
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
}

.response-tab-content code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Response Example Items */
.response-examples-container {
  margin-top: 1rem;
}

.response-example-item {
  margin-bottom: 2rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--background-color);
}

.response-example-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.response-example-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  font-style: italic;
}

.response-example-item pre {
  background: var(--code-background);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 0;
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
}

.response-example-item code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
}

.send-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary-color) 35%, transparent);
  margin-top: 1rem;
}

.send-btn:hover {
  background: var(--primary-dark);
}

.send-btn:disabled {
  background: var(--secondary-color);
  cursor: not-allowed;
}

/* Response Display */
.response-display {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--code-background);
  border-radius: 0.5rem;
  border-left: 4px solid var(--success-color);
}

.response-display.error {
  border-left-color: var(--error-color);
}

.response-status {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--success-color);
}

.response-display.error .response-status {
  color: var(--error-color);
}

.response-content {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--code-text);
  white-space: pre-wrap;
  word-break: break-all;
}

/* Loading state */
.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .logo {
    flex: 1;
    min-width: 0;
  }

  .logo-name {
    font-size: 1.05rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .logo-tagline {
    display: none;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    background: color-mix(in srgb, var(--text-primary) 42%, transparent);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  [data-theme="dark"] .sidebar-backdrop {
    background: rgba(0, 0, 0, 0.55);
  }

  .sidebar-backdrop.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: min(300px, 88vw);
    height: calc(100vh - var(--header-h));
    max-height: calc(100vh - var(--header-h));
    padding: 1.25rem 0 2rem;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    border-right: 1px solid var(--border-color);
    border-bottom: none;
    z-index: 1050;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

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

  body.nav-drawer-open {
    overflow: hidden;
  }

  .main-content {
    margin-left: 0;
    max-width: 100vw;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .header-content {
    padding: 0.75rem 1rem;
  }
  
  .main-content {
    padding: 1rem;
  }
  
  .token-input-group {
    flex-direction: column;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  .tab-buttons {
    flex-wrap: wrap;
  }
  
  .step {
    flex-direction: column;
    text-align: center;
  }
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--surface-color);
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Additional desktop fixes */
.table-container {
  overflow-x: auto;
  margin: 1.5rem 0;
  max-width: 100%;
  box-sizing: border-box;
}

.error-table, .bank-table, .callback-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-color);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 600px;
}

.error-table th, .error-table td,
.bank-table th, .bank-table td,
.callback-table th, .callback-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  word-wrap: break-word;
  max-width: 300px;
}

.error-table th, .bank-table th, .callback-table th {
  background: var(--background-color);
  font-weight: 600;
  color: var(--text-primary);
}

.status-code {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-code.success {
  background: var(--success-color);
  color: white;
}

.status-code.error {
  background: var(--error-color);
  color: white;
}

/* Fix for long URLs and code */
.endpoint-path {
  word-break: break-all;
  overflow-wrap: break-word;
}

.token-input {
  word-break: break-all;
  overflow-wrap: break-word;
}

/* Ensure proper spacing on desktop */
@media (min-width: 1025px) {
  .main-content {
    padding: 2rem 3rem;
  }
  
  .api-endpoint {
    margin-bottom: 3rem;
  }
  
  .content-section {
    margin-bottom: 5rem;
  }
}
