/* GitBook-like Documentation Styles */
:root {
  --primary-color: #557b32;
  --primary-hover: #446628;
  --sidebar-bg: #f8fafc;
  --sidebar-border: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  --inline-code-bg: #f1f5f9;
  --inline-code-text: #0f172a;
  --border-color: #e2e8f0;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --info-color: #557b32;
  --content-max-width: 900px;
  --sidebar-width: 280px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: #fff;
}

/* Layout */
.docs-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.sidebar-logo svg {
  width: 32px;
  height: 32px;
}

.sidebar-logo span {
  font-size: 20px;
  font-weight: 700;
}

.sidebar-nav {
  padding: 16px 0;
}

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

.nav-section-title {
  padding: 8px 24px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.nav-item {
  display: block;
  padding: 10px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(85, 123, 50, 0.05);
}

.nav-item.active {
  color: var(--primary-color);
  background: rgba(85, 123, 50, 0.08);
  border-left-color: var(--primary-color);
  font-weight: 500;
}

.nav-item-sub {
  padding-left: 40px;
  font-size: 13px;
}

/* Platform selector */
.platform-selector {
  padding: 16px 24px;
  border-bottom: 1px solid var(--sidebar-border);
}

.platform-tabs {
  display: flex;
  gap: 4px;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 8px;
}

.platform-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.platform-tab:hover {
  color: var(--text-primary);
}

.platform-tab.active {
  background: #fff;
  color: var(--primary-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.content-wrapper {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 40px 60px;
}

/* Typography */
h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  line-height: 1.3;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

p {
  margin-bottom: 16px;
  color: var(--text-primary);
}

.lead {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Code */
code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.875em;
}

:not(pre) > code {
  background: var(--inline-code-bg);
  color: var(--inline-code-text);
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 20px 24px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0 24px;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 14px;
}

/* Code block header */
.code-block {
  position: relative;
  margin: 16px 0 24px;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  padding: 8px 16px;
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.code-block-header + pre {
  margin-top: 0;
  border-radius: 0 0 8px 8px;
}

.copy-button {
  background: transparent;
  border: 1px solid #334155;
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}

.copy-button:hover {
  background: #334155;
  color: #fff;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border: 1px solid var(--border-color);
}

th {
  background: var(--sidebar-bg);
  font-weight: 600;
  color: var(--text-primary);
}

td {
  color: var(--text-primary);
}

tr:hover td {
  background: rgba(248, 250, 252, 0.5);
}

/* Lists */
ul, ol {
  margin: 16px 0;
  padding-left: 24px;
}

li {
  margin-bottom: 8px;
}

li::marker {
  color: var(--text-muted);
}

/* Callouts/Alerts */
.callout {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0;
  border-left: 4px solid;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout-info {
  background: rgba(85, 123, 50, 0.08);
  border-color: var(--info-color);
}

.callout-info .callout-title {
  color: var(--info-color);
}

.callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--warning-color);
}

.callout-warning .callout-title {
  color: var(--warning-color);
}

.callout-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--success-color);
}

.callout-success .callout-title {
  color: var(--success-color);
}

.callout-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--error-color);
}

.callout-error .callout-title {
  color: var(--error-color);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
}

.badge-required {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
}

.badge-optional {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-secondary);
}

/* Tabs */
.tabs {
  margin: 24px 0;
}

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

.tab-button {
  padding: 12px 20px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s ease;
}

.tab-button:hover {
  color: var(--text-primary);
}

.tab-button.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-content {
  display: none;
  padding-top: 16px;
}

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

/* Navigation buttons */
.page-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.nav-button {
  display: flex;
  flex-direction: column;
  padding: 16px 24px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.15s ease;
  max-width: 45%;
}

.nav-button:hover {
  border-color: var(--primary-color);
  background: rgba(85, 123, 50, 0.02);
  text-decoration: none;
}

.nav-button-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.nav-button-title {
  font-weight: 500;
  color: var(--primary-color);
}

.nav-button-prev {
  align-items: flex-start;
}

.nav-button-next {
  align-items: flex-end;
  margin-left: auto;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 101;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Syntax highlighting */
.hljs-keyword { color: #c792ea; }
.hljs-string { color: #c3e88d; }
.hljs-number { color: #f78c6c; }
.hljs-comment { color: #676e95; font-style: italic; }
.hljs-function { color: #82aaff; }
.hljs-class { color: #ffcb6b; }
.hljs-variable { color: #f07178; }
.hljs-operator { color: #89ddff; }
.hljs-punctuation { color: #89ddff; }
.hljs-property { color: #f07178; }
.hljs-attr { color: #ffcb6b; }
.hljs-type { color: #ffcb6b; }

/* API method signature */
.method-signature {
  background: var(--sidebar-bg);
  padding: 16px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin: 16px 0;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
}

.method-name {
  color: #82aaff;
  font-weight: 600;
}

.method-params {
  color: var(--text-secondary);
}

.method-return {
  color: #c792ea;
}

/* Parameter list */
.param-list {
  margin: 16px 0;
}

.param-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.param-name {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-weight: 600;
  color: var(--text-primary);
}

.param-type {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  color: var(--primary-color);
  font-size: 14px;
}

.param-description {
  color: var(--text-secondary);
  margin-top: 4px;
  font-size: 14px;
}

/* Search */
.search-container {
  padding: 16px 24px;
  border-bottom: 1px solid var(--sidebar-border);
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  color: var(--text-primary);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(85, 123, 50, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
  .content-wrapper {
    padding: 32px 40px;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-content {
    margin-left: 0;
  }

  .content-wrapper {
    padding: 24px 20px;
    padding-top: 72px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .page-navigation {
    flex-direction: column;
    gap: 16px;
  }

  .nav-button {
    max-width: 100%;
  }
}

/* Hero section for landing page */
.hero {
  text-align: center;
  padding: 60px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.hero .lead {
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  text-decoration: none;
}

.btn-secondary {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  text-decoration: none;
}

/* Feature cards */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 40px 0;
}

.feature-card {
  padding: 24px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.15s ease;
}

.feature-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(85, 123, 50, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.feature-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-description {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* Version badge */
.version-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}

/* On this page (TOC) */
.toc {
  position: fixed;
  right: 40px;
  top: 100px;
  width: 200px;
  font-size: 13px;
}

.toc-title {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  margin-bottom: 12px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin-bottom: 8px;
}

.toc-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.toc-link:hover,
.toc-link.active {
  color: var(--primary-color);
}

@media (max-width: 1280px) {
  .toc {
    display: none;
  }
}
