/* GoRoute API Documentation Styles */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --accent: #10b981;
  --accent-dark: #059669;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  --sidebar-width: 280px;
  --header-height: 64px;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --code-bg: #0f172a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 20px); }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.version-badge {
  background: var(--bg-tertiary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Marks a field or parameter that is in spec but still subject to change. */
.beta-badge {
  background: #f59e0b;
  color: #1f2937;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: 1px;
  margin-right: 6px;
  white-space: nowrap;
}

.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle:hover { background: var(--bg-tertiary); }

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 0;
}

.nav-section { margin-bottom: 24px; }

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 0 24px;
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

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

.nav-link.active {
  background: var(--bg);
  color: var(--primary);
  border-left-color: var(--primary);
}

.nav-link .method {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.method-get { background: #dcfce7; color: #166534; }
.method-post { background: #dbeafe; color: #1e40af; }
.method-put { background: #fef3c7; color: #92400e; }
.method-delete { background: #fee2e2; color: #991b1b; }

[data-theme="dark"] .method-get { background: #166534; color: #dcfce7; }
[data-theme="dark"] .method-post { background: #1e40af; color: #dbeafe; }
[data-theme="dark"] .method-put { background: #92400e; color: #fef3c7; }
[data-theme="dark"] .method-delete { background: #991b1b; color: #fee2e2; }

/* Main Content */
.main {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 40px 60px;
  max-width: 1000px;
}

.section { margin-bottom: 80px; }

.section-header {
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.section-description {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 650px;
  line-height: 1.7;
}

/* Mode Cards */
.mode-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 32px 0;
}

.mode-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.2s;
  cursor: pointer;
}

.mode-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.mode-card.poll { border-top: 4px solid var(--primary); }
.mode-card.push { border-top: 4px solid var(--accent); }

.mode-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.mode-card.poll .mode-card-icon { background: rgba(37, 99, 235, 0.1); color: var(--primary); }
.mode-card.push .mode-card-icon { background: rgba(16, 185, 129, 0.1); color: var(--accent); }

.mode-card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.mode-card-description {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.mode-card-list {
  list-style: none;
  margin-top: 16px;
}

.mode-card-list li {
  padding: 6px 0;
  padding-left: 24px;
  position: relative;
  font-size: 14px;
  color: var(--text-secondary);
}

.mode-card-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* Endpoint Block */
.endpoint-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 32px;
  overflow: hidden;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.endpoint-header:hover { background: var(--bg-secondary); }

.endpoint-method {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.endpoint-summary {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 14px;
}

.endpoint-content { padding: 24px; }

.endpoint-description {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.7;
}

/* Code Blocks */
.code-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--code-bg);
  border-radius: 8px 8px 0 0;
}

.code-tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.2s;
}

.code-tab:hover { color: var(--code-text); }
.code-tab.active { color: var(--primary-light); border-bottom: 2px solid var(--primary); }

.code-block {
  position: relative;
  background: var(--code-bg);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.code-block pre {
  padding: 20px;
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--code-text);
}

.code-block code { font-family: inherit; }

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.copy-btn:hover { background: rgba(255,255,255,0.2); color: var(--code-text); }
.copy-btn.copied { color: var(--accent); }

/* Parameters Table */
.params-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.params-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.params-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.param-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.param-type {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}

.param-required {
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 600;
}

.param-optional {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 600;
}

/* Response Examples */
.response-block {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.response-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  font-size: 13px;
  font-weight: 600;
}

.status-code {
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.status-200 { background: #dcfce7; color: #166534; }
.status-201 { background: #dcfce7; color: #166534; }
.status-400 { background: #fee2e2; color: #991b1b; }
.status-401 { background: #fef3c7; color: #92400e; }
.status-404 { background: #fee2e2; color: #991b1b; }

[data-theme="dark"] .status-200 { background: #166534; color: #dcfce7; }
[data-theme="dark"] .status-201 { background: #166534; color: #dcfce7; }
[data-theme="dark"] .status-400 { background: #991b1b; color: #fee2e2; }
[data-theme="dark"] .status-401 { background: #92400e; color: #fef3c7; }
[data-theme="dark"] .status-404 { background: #991b1b; color: #fee2e2; }

/* Info boxes */
.info-box {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0;
  border-left: 4px solid;
}

.info-box.info { background: rgba(37, 99, 235, 0.1); border-color: var(--primary); }
.info-box.success { background: rgba(16, 185, 129, 0.1); border-color: var(--accent); }
.info-box.warning { background: rgba(245, 158, 11, 0.1); border-color: var(--warning); }
.info-box.danger { background: rgba(239, 68, 68, 0.1); border-color: var(--danger); }

.info-box-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}

.info-box p { font-size: 14px; color: var(--text-secondary); }

/* Object Model */
.object-model {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
}

.object-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.object-title .tag {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 1024px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 24px; }
  .mode-cards { grid-template-columns: 1fr; }
}

