:root {
  /* Light theme colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-code: #1e293b;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-code: #e2e8f0;
  --accent-primary: #3b82f6;
  --accent-secondary: #1e40af;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-sidebar: #1e293b;
  --bg-code: #0f172a;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-code: #e2e8f0;
  --accent-primary: #60a5fa;
  --accent-secondary: #3b82f6;
  --border-light: #334155;
  --border-medium: #475569;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  transition: all 0.3s ease;
}

/* Navigation */
.docs-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  transition: all 0.3s ease;
}

[data-theme="dark"] .docs-navbar {
  background: rgba(15, 23, 42, 0.9);
}

.navbar-container {
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-icon {
  font-size: 1.5rem;
}

.navbar-search {
  flex: 1;
  max-width: 400px;
  margin: 0 2rem;
}

.search-container {
  position: relative;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 2.5rem 0 1rem;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  margin-top: 0.5rem;
  display: none;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: var(--bg-secondary);
  color: var(--accent-primary);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent-primary);
  transform: rotate(180deg);
}

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

/* Sidebar */
.docs-sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  position: fixed;
  left: 0;
  top: 70px;
  bottom: 0;
  overflow-y: auto;
  padding: 2rem 0;
  z-index: 50;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem 1rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 2rem;
}

.sidebar-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.sidebar-nav {
  padding: 0 1rem;
}

.nav-section {
  margin-bottom: 2rem;
}

.nav-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  padding: 0 1rem;
}

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

.nav-item {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.nav-item:hover,
.nav-item.active {
  background: var(--accent-primary);
  color: white;
}

/* Main Content */
.docs-main {
  flex: 1;
  margin-left: 280px;
  padding: 0 3rem 3rem;
  max-width: calc(100% - 280px);
}

/* Hero Section */
.hero-section {
  padding: 3rem 0 4rem;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.badge-icon {
  font-size: 1.1rem;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 500;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 4rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

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

.btn-primary:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.hero-code {
  background: var(--bg-code);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  margin: 0 auto;
}

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

.code-dots {
  display: flex;
  gap: 0.5rem;
}

.code-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ef4444;
}

.code-dots span:nth-child(2) {
  background: #f59e0b;
}

.code-dots span:nth-child(3) {
  background: #10b981;
}

.code-title {
  color: var(--text-code);
  font-size: 0.9rem;
  font-weight: 500;
}

.code-block {
  margin: 0;
  padding: 2rem 1.5rem;
  background: transparent;
  color: var(--text-code);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: auto;
}

/* Features Section */
.features-section {
  margin: 4rem 0;
  text-align: center;
}

.features-section h2 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 3rem;
  color: var(--text-primary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  transition: all 0.3s ease;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Documentation Grid */
.docs-grid {
  margin: 4rem 0;
}

.docs-grid h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 2rem;
  color: var(--text-primary);
  text-align: center;
}

.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.docs-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
  position: relative;
}

.docs-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.card-title {
  margin: 0;
}

.card-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.card-link:hover {
  color: var(--accent-primary);
}

.card-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

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

.card-tags {
  display: flex;
  gap: 0.5rem;
}

.card-tag {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.card-arrow {
  color: var(--accent-primary);
  font-size: 1.25rem;
  font-weight: bold;
  text-decoration: none;
  transition: transform 0.2s ease;
}

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

/* Article Styles */
.docs-article {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin: 2rem 0;
  overflow: hidden;
}

.article-header {
  padding: 2rem 3rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-tertiary);
}

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

.breadcrumb-separator {
  color: var(--text-tertiary);
}

.article-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.article-date {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.article-tags {
  display: flex;
  gap: 0.5rem;
}

.tag {
  background: var(--accent-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.article-content {
  padding: 3rem;
  font-size: 1.1rem;
  line-height: 1.8;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin: 2rem 0 1rem;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}

.article-content h1 { font-size: 2.25rem; }
.article-content h2 { font-size: 1.875rem; }
.article-content h3 { font-size: 1.5rem; }
.article-content h4 { font-size: 1.25rem; }

.article-content p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.article-content a {
  color: var(--accent-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.article-content a:hover {
  border-bottom-color: var(--accent-primary);
}

.article-content ul,
.article-content ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.article-content li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.article-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  overflow-x: auto;
  position: relative;
}

.article-content pre code {
  background: none;
  padding: 0;
  color: var(--text-code);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}

.article-content code {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}

.article-content blockquote {
  border-left: 4px solid var(--accent-primary);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--bg-secondary);
  border-radius: 0 8px 8px 0;
}

.article-content blockquote p {
  margin: 0;
  font-style: italic;
  color: var(--text-secondary);
}

.copy-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-code);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.article-footer {
  padding: 2rem 3rem;
  border-top: 1px solid var(--border-light);
}

.article-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.nav-prev,
.nav-next {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-prev:hover,
.nav-next:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.nav-next {
  justify-content: flex-end;
}

.nav-icon {
  color: var(--accent-primary);
  font-size: 1.25rem;
  font-weight: bold;
}

.nav-label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav-title {
  font-weight: 600;
  color: var(--text-primary);
}

.article-actions {
  text-align: center;
}

.edit-page {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.edit-page:hover {
  text-decoration: underline;
}

/* Table of Contents */
.table-of-contents {
  position: sticky;
  top: 100px;
  width: 250px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin-left: 2rem;
  align-self: flex-start;
}

.toc-header h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toc-list {
  list-style: none;
}

.toc-item {
  margin-bottom: 0.25rem;
}

.toc-link {
  display: block;
  padding: 0.5rem 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.4;
  transition: color 0.2s ease;
  border-left: 2px solid transparent;
  padding-left: 1rem;
}

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

.toc-level-3 .toc-link {
  padding-left: 2rem;
  font-size: 0.85rem;
}

.toc-level-4 .toc-link {
  padding-left: 3rem;
  font-size: 0.8rem;
}

/* Footer */
.docs-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  margin-top: 4rem;
  margin-left: 280px;
}

.footer-container {
  max-width: 1200px;
  padding: 3rem 3rem 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-section p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.footer-bottom p {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .docs-main {
    margin-left: 0;
    max-width: 100%;
    padding: 0 2rem 2rem;
  }
  
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .docs-sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-toggle {
    display: block;
  }
  
  .table-of-contents {
    display: none;
  }
  
  .docs-footer {
    margin-left: 0;
  }
  
  .article-navigation {
    grid-template-columns: 1fr;
  }
  
  .nav-next {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .navbar-container {
    padding: 0 1rem;
  }
  
  .navbar-search {
    display: none;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .docs-cards {
    grid-template-columns: 1fr;
  }
  
  .article-header {
    padding: 1.5rem 2rem 1rem;
  }
  
  .article-content {
    padding: 2rem;
  }
  
  .article-footer {
    padding: 1.5rem 2rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-container {
    padding: 2rem 2rem 1rem;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 2rem 0 3rem;
  }
  
  .article-title {
    font-size: 2rem;
  }
  
  .article-header {
    padding: 1rem 1.5rem;
  }
  
  .article-content {
    padding: 1.5rem;
  }
  
  .article-footer {
    padding: 1rem 1.5rem;
  }
  
  .breadcrumb {
    flex-wrap: wrap;
  }
}