@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --sidebar-bg: #111113;
  --panel: rgba(24, 24, 27, 0.8);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --muted: #71717a;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-bg: rgba(99, 102, 241, 0.1);
  --success: #22c55e;
  --warning: #f59e0b;
  --sidebar-width: 260px;
  --header-height: 60px;
}

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

html {
  scroll-behavior: smooth;
}

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

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--sidebar-bg);
}

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

.sidebar-logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.sidebar-version {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

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

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

.nav-links {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

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

.nav-link.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.nav-link-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  padding: 8px 0;
  transition: color 0.15s ease;
}

.sidebar-footer a:hover {
  color: var(--text);
}

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

.content-header {
  position: sticky;
  top: 0;
  background: rgba(10, 10, 11, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 40px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

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

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb-sep {
  color: var(--border);
}

.header-actions {
  display: flex;
  gap: 12px;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.header-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--panel);
}

/* Page Content */
.page-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}

.page-header {
  margin-bottom: 40px;
}

.page-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.page-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
}

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: var(--border-hover);
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 20px 0 10px;
  color: var(--text-secondary);
}

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

.card p:last-child {
  margin-bottom: 0;
}

/* Grid layouts */
.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Link cards */
.link-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.link-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.link-card-icon {
  font-size: 24px;
  margin-bottom: 12px;
}

.link-card h3 {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

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

.link-card-arrow {
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.15s ease;
}

.link-card:hover .link-card-arrow {
  transform: translateX(3px);
}

/* Code */
code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  background: #18181b;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  margin: 16px 0;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
}

/* Lists */
ul, ol {
  padding-left: 20px;
  color: var(--text-secondary);
  margin: 12px 0;
}

li {
  margin-bottom: 8px;
}

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

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

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

th {
  color: var(--text);
  font-weight: 600;
  background: var(--panel);
}

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

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Key grid for config options */
.key-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 16px;
}

.key-grid > div {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 16px;
}

.key-grid h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.key-grid ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.key-grid li {
  margin-bottom: 6px;
  font-size: 13px;
}

/* Callouts */
.callout {
  padding: 16px 20px;
  border-radius: 12px;
  margin: 20px 0;
  display: flex;
  gap: 12px;
}

.callout-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.callout-content {
  flex: 1;
}

.callout-info {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.callout-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.callout-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

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

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

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

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--panel);
}

/* Footer */
.page-footer {
  border-top: 1px solid var(--border);
  padding-top: 32px;
  margin-top: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.page-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.page-footer a:hover {
  color: var(--text);
}

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

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  padding: 8px;
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
}

/* Responsive */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

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

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

  .mobile-menu-toggle {
    display: block;
  }

  .page-content {
    padding: 32px 20px 60px;
  }

  .page-title {
    font-size: 2rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .content-header {
    padding: 12px 20px;
  }

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Text utilities */
.text-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

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

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

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

/* Section divider */
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.status-badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}
