:root {
  --bg-tertiary: #f3f4f6;
  --text-tertiary: #9ca3af;
  --accent-color: #FFC107;
  --link-color: #2563eb;
  --link-hover: #1d4ed8;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
}

[data-theme="dark"] {
  --bg-tertiary: #1f2937;
  --text-tertiary: #6b7280;
  --link-color: #60a5fa;
  --link-hover: #93c5fd;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.docs-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.docs-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 2px;
}

.docs-header nav {
  display: flex;
  gap: 24px;
}

.docs-header nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.docs-header nav a:hover {
  color: var(--accent-color);
}

.theme-toggle {
  background: none;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.2s;
  white-space: nowrap;
  margin-left: 12px;
}

.theme-toggle:hover {
  border-color: var(--text-primary);
}

.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px;
}

.docs-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar-nav {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--border-color);
}

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

.nav-section:last-child {
  margin-bottom: 0;
}

.nav-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.nav-section li {
  margin: 4px 0;
}

.nav-section a {
  display: block;
  padding: 6px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  border-radius: 4px;
  transition: all 0.2s;
}

.nav-section a:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.nav-section a.active {
  background: var(--accent-color);
  color: #000;
  font-weight: 500;
}

.docs-main {
  min-width: 0;
}

.docs-content {
  background: var(--bg-primary);
  padding: 40px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.breadcrumb {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--link-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 8px;
}

h1 {
  font-size: 36px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.lead {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

.docs-section {
  margin: 40px 0;
}

.docs-section h2 {
  font-size: 28px;
  margin-bottom: 16px;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
}

.docs-section h3 {
  font-size: 22px;
  margin: 24px 0 12px 0;
  color: var(--text-primary);
}

.docs-section h4 {
  font-size: 18px;
  margin: 16px 0 8px 0;
  color: var(--text-primary);
}

.docs-section p {
  margin: 12px 0;
  line-height: 1.8;
}

.docs-section ul,
.docs-section ol {
  margin: 12px 0;
  padding-left: 24px;
}

.docs-section li {
  margin: 8px 0;
  line-height: 1.7;
}

.docs-section a {
  color: var(--link-color);
  text-decoration: none;
}

.docs-section a:hover {
  text-decoration: underline;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.feature-card {
  background: var(--bg-secondary);
  padding: 24px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
}

.card-link {
  color: var(--link-color);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

.steps-list {
  counter-reset: step-counter;
  list-style: none;
  padding: 0;
}

.steps-list li {
  counter-increment: step-counter;
  margin: 24px 0;
  padding-left: 40px;
  position: relative;
}

.steps-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  background: var(--accent-color);
  color: #000;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.use-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.use-case {
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.use-case h4 {
  font-size: 16px;
  margin-bottom: 8px;
}

.use-case p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

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

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-header span {
  color: var(--code-text);
  font-size: 13px;
  font-family: 'Monaco', 'Courier New', monospace;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--code-text);
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.code-block pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
}

.code-block code {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--code-text);
}

.callout {
  padding: 16px;
  border-radius: 8px;
  margin: 20px 0;
  border-left: 4px solid;
}

.callout-warning {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.callout strong {
  display: block;
  margin-bottom: 4px;
}

.cta-section {
  background: var(--bg-secondary);
  padding: 32px;
  border-radius: 8px;
  text-align: center;
  margin: 40px 0;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
}

.btn {
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.2s;
  display: inline-block;
}

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

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--link-color);
  border: 2px solid var(--link-color);
}

.btn-secondary:hover {
  background: var(--link-color);
  color: white;
}

.docs-footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 32px 0;
  margin-top: 60px;
}

.docs-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.docs-footer nav {
  display: flex;
  gap: 24px;
}

.docs-footer nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
}

.docs-footer nav a:hover {
  color: var(--accent-color);
}

@media (max-width: 1024px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
    max-height: none;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .docs-footer .container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .docs-content {
    padding: 24px;
  }

  h1 {
    font-size: 28px;
  }

  .docs-section h2 {
    font-size: 24px;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
