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

:root {
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', monospace;
  
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f4f4f5;
  --border-color: #e4e4e7;
  --border-light: #f4f4f5;
  
  --text-primary: #09090b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  
  --accent-primary: #000000;
  --accent-secondary: #18181b;
  --brand-blue: #0066ff;
  --brand-emerald: #10b981;
  --brand-amber: #f59e0b;
  
  --sidebar-width: 280px;
  --header-height: 64px;
}

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

html {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

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

.header-brand img {
  height: 36px;
  width: auto;
  object-contain: fit;
}

.header-brand .badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
}

.header-search-container {
  position: relative;
  max-width: 320px;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.45rem 0.75rem 0.45rem 2.25rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s ease;
}

.search-input:focus {
  border-color: var(--text-primary);
  background: var(--bg-primary);
  box-shadow: 0 0 0 1px var(--text-primary);
}

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

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

.btn-main {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  background: var(--accent-primary);
  color: #ffffff;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-main:hover {
  background: var(--accent-secondary);
}

.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  padding: 0.4rem;
  border-radius: 6px;
  cursor: pointer;
}

/* Layout */
.docs-layout {
  display: flex;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.docs-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  padding: 1.75rem 1.25rem;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

.sidebar-group {
  margin-bottom: 1.5rem;
}

.sidebar-heading {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

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

.sidebar-link {
  display: block;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}

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

.sidebar-link.active {
  color: var(--text-primary);
  background: var(--bg-secondary);
  font-weight: 600;
  border-left-color: var(--text-primary);
}

/* Main Content */
.docs-content {
  flex: 1;
  max-width: 860px;
  padding: 2.5rem 3rem 5rem 3rem;
  line-height: 1.7;
}

.content-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

.content-section h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.content-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.content-section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem 0;
  color: var(--text-primary);
}

.content-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.lead-text {
  font-size: 1.1rem !important;
  color: var(--text-secondary) !important;
  line-height: 1.6;
}

/* Code Blocks */
.code-block-wrapper {
  position: relative;
  margin: 1.25rem 0;
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 8px;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #18181b;
  border-bottom: 1px solid #27272a;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #a1a1aa;
}

.copy-btn {
  background: transparent;
  border: 1px solid #3f3f46;
  color: #d4d4d8;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn:hover {
  background: #27272a;
  color: #ffffff;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #f4f4f5;
  line-height: 1.5;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.15em 0.35em;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
}

pre code {
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
}

/* Callouts / Alerts */
.callout {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1.25rem 0;
  font-size: 0.9rem;
  border-left: 4px solid;
}

.callout-info {
  background: #f0fdf4;
  border-color: var(--brand-emerald);
  color: #166534;
}

.callout-warning {
  background: #fffbeb;
  border-color: var(--brand-amber);
  color: #92400e;
}

.callout p {
  color: inherit !important;
  margin: 0;
}

/* Feature Grid */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.grid-card {
  padding: 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: border-color 0.15s;
}

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

.grid-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.grid-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Table */
.docs-table-wrapper {
  overflow-x: auto;
  margin: 1.25rem 0;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.docs-table th,
.docs-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.docs-table th {
  background: var(--bg-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .docs-sidebar {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--bg-primary);
    z-index: 40;
  }
  
  .docs-sidebar.open {
    display: block;
  }

  .mobile-toggle {
    display: block;
  }

  .docs-content {
    padding: 1.5rem 1.25rem;
  }
  
  .header-search-container {
    display: none;
  }
}
