/* ==========================================================================
   API SellerPay Documentation - Main Stylesheet
   CSS nativo sem frameworks externos (Requisito 2.6)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties v5
   -------------------------------------------------------------------------- */
:root {
  /* Colors - Light theme (main content) */
  --color-bg: #ffffff;
  --color-bg-secondary: #f8f9fa;
  --color-text: #1a1a2e;
  --color-text-secondary: #4a4a6a;
  --color-text-muted: #6c757d;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;

  /* Colors - Sidebar */
  --sidebar-bg: #1e293b;
  --sidebar-text: #e2e8f0;
  --sidebar-text-muted: #94a3b8;
  --sidebar-hover: #334155;
  --sidebar-active: #0f172a;
  --sidebar-active-border: #3b82f6;
  --sidebar-width: 260px;

  /* Colors - Dark theme (code blocks) */
  --code-bg: #1a1a2e;
  --code-text: #e4e4e7;
  --code-border: #2d2d44;
  --code-header-bg: #16162a;
  --code-string: #a5d6ff;
  --code-keyword: #ff7b72;
  --code-number: #79c0ff;

  /* Colors - Method badges */
  --method-get: #10b981;
  --method-get-bg: #ecfdf5;
  --method-post: #3b82f6;
  --method-post-bg: #eff6ff;
  --method-put: #f59e0b;
  --method-put-bg: #fffbeb;
  --method-delete: #ef4444;
  --method-delete-bg: #fef2f2;

  /* Colors - Interactive */
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --line-height-tight: 1.25;
  --line-height-base: 1.6;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Borders & Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-overlay: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Z-index layers */
  --z-sidebar: 100;
  --z-overlay: 200;
  --z-dropdown: 300;
  --z-hamburger: 150;
}


/* --------------------------------------------------------------------------
   2. Reset & Base Styles
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Selection colors */
::selection {
  background-color: rgba(59, 130, 246, 0.3);
  color: inherit;
}

.code-block ::selection {
  background-color: rgba(59, 130, 246, 0.5);
  color: #ffffff;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   3. Top Header
   -------------------------------------------------------------------------- */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  background-color: var(--sidebar-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: calc(var(--z-sidebar) + 10);
}

.top-header-left {
  display: flex;
  align-items: center;
}

.top-header-logo img {
  height: 32px;
  width: auto;
}

.top-header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.top-header-btn {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.top-header-btn.btn-outline {
  color: var(--sidebar-text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
}

.top-header-btn.btn-outline:hover {
  background-color: var(--sidebar-hover);
  border-color: rgba(255, 255, 255, 0.4);
}

.top-header-btn.btn-primary {
  color: #ffffff;
  background-color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.top-header-btn.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

/* --------------------------------------------------------------------------
   4. Layout - CSS Grid (Sidebar + Content)
   -------------------------------------------------------------------------- */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  padding-top: 56px;
}

.main-content {
  grid-column: 2;
  padding: var(--space-xl) var(--space-2xl);
  max-width: 900px;
  width: 100%;
}

/* --------------------------------------------------------------------------
   4. Sidebar
   -------------------------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - 56px);
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-header h2 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: #ffffff;
  margin-bottom: var(--space-sm);
}

.version-select {
  width: 100%;
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--sidebar-hover);
  color: var(--sidebar-text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

.version-select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

/* --------------------------------------------------------------------------
   5. Navigation List
   -------------------------------------------------------------------------- */
.nav-list {
  flex: 1;
  padding: var(--space-sm) 0;
  overflow-y: auto;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--sidebar-text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-link:hover {
  background-color: var(--sidebar-hover);
  color: var(--sidebar-text);
}

.nav-link.active {
  background-color: var(--sidebar-active);
  color: #ffffff;
  border-left-color: var(--sidebar-active-border);
  font-weight: var(--font-weight-medium);
}

/* --------------------------------------------------------------------------
   6. Navigation Groups (Expandable)
   -------------------------------------------------------------------------- */
.nav-group {
  margin: var(--space-xs) 0;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  color: var(--sidebar-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-align: left;
  transition: background-color var(--transition-fast);
  border-left: 3px solid transparent;
}

.nav-group-toggle:hover {
  background-color: var(--sidebar-hover);
}

.nav-arrow {
  font-size: var(--font-size-xs);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
  display: inline-block;
  width: 12px;
}

.nav-group-toggle[aria-expanded="true"] .nav-arrow {
  transform: rotate(90deg);
}

.nav-sublist {
  display: none;
  padding-left: var(--space-sm);
}

.nav-group-toggle[aria-expanded="true"] + .nav-sublist {
  display: block;
}

.nav-subitem .nav-link {
  padding-left: var(--space-xl);
  font-size: var(--font-size-xs);
}


/* --------------------------------------------------------------------------
   7. Method Badges
   -------------------------------------------------------------------------- */
.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
  flex-shrink: 0;
  min-width: 42px;
}

.method-badge.method-get,
.method-get {
  color: var(--method-get);
  background-color: var(--method-get-bg);
}

.method-badge.method-post,
.method-post {
  color: var(--method-post);
  background-color: var(--method-post-bg);
}

.method-badge.method-put,
.method-put {
  color: var(--method-put);
  background-color: var(--method-put-bg);
}

.method-badge.method-delete,
.method-delete {
  color: var(--method-delete);
  background-color: var(--method-delete-bg);
}

/* Large badge variant (endpoint detail page) */
.method-badge-lg {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-md);
  min-width: 56px;
}

/* --------------------------------------------------------------------------
   8. Code Blocks - Dark Theme
   Background luminosity ≤ 20% (#1a1a2e = HSL 240, 27%, 14%)
   Text contrast ≥ 4.5:1 (#e4e4e7 on #1a1a2e = ~12.5:1)
   -------------------------------------------------------------------------- */
.code-block {
  position: relative;
  background-color: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-lg);
  margin: var(--space-md) 0;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--code-header-bg);
  border-bottom: 1px solid var(--code-border);
}

.code-block-label {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-block pre {
  margin: 0;
  padding: var(--space-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  line-height: 1.7;
  color: var(--code-text);
  white-space: pre;
  tab-size: 2;
}

/* Forçar texto branco e sem fundo em TUDO dentro de code blocks */
.code-block pre *,
.code-block code,
.code-block code * {
  background: transparent !important;
  background-color: transparent !important;
  color: var(--code-text) !important;
  border: none !important;
  border-top: none !important;
  border-bottom: none !important;
  border-left: none !important;
  border-right: none !important;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: inherit;
  color: inherit;
}

/* Inline code (only outside code blocks) */
:not(.code-block) > code:not([class]),
p > code:not([class]),
td > code:not([class]),
li > code:not([class]) {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 6px;
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   9. Copy Button
   -------------------------------------------------------------------------- */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--sidebar-text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--sidebar-text);
}

.copy-btn.copied {
  background-color: rgba(16, 185, 129, 0.2);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.3);
}

.copy-btn-icon {
  width: 14px;
  height: 14px;
}

/* --------------------------------------------------------------------------
   10. Ask AI Component
   -------------------------------------------------------------------------- */
.ask-ai {
  position: relative;
  display: inline-block;
}

.ask-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.ask-ai-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.ask-ai-btn:active {
  transform: translateY(0);
}

.ask-ai-menu {
  position: absolute;
  top: calc(100% + var(--space-sm));
  right: 0;
  min-width: 180px;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  padding: var(--space-xs) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

.ask-ai-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ask-ai-menu a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  transition: background-color var(--transition-fast);
  text-decoration: none;
}

.ask-ai-menu a:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-primary);
}


/* --------------------------------------------------------------------------
   11. Content Typography & Components
   -------------------------------------------------------------------------- */
.content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.content-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  line-height: var(--line-height-tight);
}

.content-description {
  margin-top: var(--space-sm);
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
}

.endpoint-url {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  word-break: break-all;
}

.endpoint-limit {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Section headings */
.section-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border-light);
}

.section-subtitle {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

/* Paragraphs */
.content-text {
  color: var(--color-text-secondary);
  line-height: var(--line-height-base);
  margin-bottom: var(--space-md);
}

/* Monospace for URLs, fields, code, JSON payloads (Requisito 2.3) */
.field-name,
.url-text,
.json-key {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 1px 5px;
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   12. Tables (Parameters)
   -------------------------------------------------------------------------- */
.params-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  font-size: var(--font-size-sm);
}

.params-table th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-bg-secondary);
  border-bottom: 2px solid var(--color-border);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.params-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text-secondary);
  vertical-align: top;
}

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

.params-table .param-name {
  font-family: var(--font-mono);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  white-space: nowrap;
}

.params-table .param-type {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--color-primary);
}

.params-table .param-required {
  color: var(--color-error);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

/* Nested parameter levels */
.params-table .level-1 .param-name { padding-left: var(--space-md); }
.params-table .level-2 .param-name { padding-left: var(--space-xl); }
.params-table .level-3 .param-name { padding-left: var(--space-2xl); }

/* --------------------------------------------------------------------------
   13. Endpoint Cards (Home page)
   -------------------------------------------------------------------------- */
.endpoint-group {
  margin-bottom: var(--space-xl);
}

.endpoint-group-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.endpoint-group-icon {
  font-size: 20px;
  color: var(--color-text-muted);
}

.endpoint-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.endpoint-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
  color: inherit;
}

.endpoint-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  color: inherit;
}

.endpoint-card-info {
  flex: 1;
  min-width: 0;
}

.endpoint-card-url {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  margin-bottom: 2px;
}

.endpoint-card-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   14. Loading & Error States
   -------------------------------------------------------------------------- */
.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-2xl);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.error-message {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--color-text-muted);
}

.error-message p {
  margin-bottom: var(--space-md);
}

.retry-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.retry-btn:hover {
  background-color: var(--color-primary-hover);
}

/* --------------------------------------------------------------------------
   15. Not Found (404)
   -------------------------------------------------------------------------- */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  padding: var(--space-2xl);
}

.not-found-code {
  font-size: 4rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-border);
  line-height: 1;
  margin-bottom: var(--space-md);
}

.not-found-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.not-found-text {
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

/* --------------------------------------------------------------------------
   16. Hamburger Button (Mobile)
   -------------------------------------------------------------------------- */
.hamburger-btn {
  display: none;
  position: fixed;
  top: var(--space-md);
  left: var(--space-md);
  z-index: var(--z-hamburger);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background-color: var(--sidebar-bg);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background-color var(--transition-fast);
}

.hamburger-btn:hover {
  background-color: var(--sidebar-hover);
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  border-radius: 1px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* Hamburger open state */
.hamburger-btn.open .hamburger-icon span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.hamburger-btn.open .hamburger-icon span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.open .hamburger-icon span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* Sidebar overlay backdrop */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-sidebar) - 1);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}


/* --------------------------------------------------------------------------
   17. Responsive - Mobile (max-width: 768px)
   Sidebar colapsada, botão hamburger visível, sidebar como overlay
   (Requisitos 2.5, 2.7)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .main-content {
    grid-column: 1;
    padding: var(--space-lg) var(--space-md);
    padding-top: calc(var(--space-lg) + 56px); /* Space for hamburger */
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    z-index: var(--z-overlay);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-overlay);
  }

  .hamburger-btn {
    display: flex;
  }

  .top-header-nav .btn-outline {
    display: none;
  }

  .top-header-nav .btn-primary {
    font-size: var(--font-size-xs);
    padding: var(--space-xs) var(--space-sm);
  }

  /* Content header stacks vertically on mobile */
  .content-header {
    flex-direction: column;
    align-items: stretch;
  }

  .ask-ai {
    align-self: flex-start;
  }

  /* Endpoint URL wraps */
  .endpoint-url {
    flex-wrap: wrap;
  }

  /* Table horizontal scroll */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--space-md) calc(-1 * var(--space-md));
    padding: 0 var(--space-md);
  }

  .params-table {
    min-width: 500px;
  }

  /* Code blocks full width */
  .code-block {
    border-radius: var(--radius-md);
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
    border-radius: 0;
  }

  /* Ask AI menu full width on mobile */
  .ask-ai-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(100%);
    min-width: unset;
  }

  .ask-ai-menu.open {
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   18. Responsive - Tablet (max-width: 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) and (min-width: 769px) {
  :root {
    --sidebar-width: 240px;
  }

  .main-content {
    padding: var(--space-lg) var(--space-xl);
  }
}

/* --------------------------------------------------------------------------
   19. Utility Classes
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-mono {
  font-family: var(--font-mono);
}

.text-muted {
  color: var(--color-text-muted);
}

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* --------------------------------------------------------------------------
   20. Print Styles
   -------------------------------------------------------------------------- */
@media print {
  .sidebar,
  .hamburger-btn,
  .copy-btn,
  .ask-ai,
  .sidebar-overlay {
    display: none !important;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 0;
    max-width: 100%;
  }

  .code-block {
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .code-block pre {
    white-space: pre-wrap;
  }
}

/* --------------------------------------------------------------------------
   21. Accessibility - Focus Styles
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.nav-link:focus-visible,
.nav-group-toggle:focus-visible {
  outline-offset: -2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
