/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #0B5D66;
  --primary-light: #0e7a86;
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;
  --bg-code: #f4f5f7;
  --text: #1a1a2e;
  --text-muted: #5a5a7a;
  --border: #e2e4ea;
  --sidebar-w: 260px;
  --header-h: 56px;
  --radius: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Header ===== */
.docs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.docs-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.docs-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
}

.docs-header a.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.docs-header a.logo:hover { text-decoration: none; }

.docs-header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.docs-header-right a {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}
.docs-header-right a:hover { color: var(--primary); text-decoration: none; }

/* ===== Layout ===== */
.docs-layout {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ===== Sidebar ===== */
.docs-sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  overflow-y: auto;
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  z-index: 50;
}

.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav a {
  display: block;
  padding: 7px 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav a:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }
.sidebar-nav a.active {
  background: #e8f4f5;
  color: var(--primary);
  font-weight: 600;
}

.sidebar-section {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 16px 12px 6px;
}

.sidebar-sub { list-style: none; padding-left: 16px; }
.sidebar-sub a { font-size: 0.8125rem; padding: 5px 12px; }

/* ===== Content ===== */
.docs-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 40px 48px 80px;
  max-width: 800px;
}

.docs-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.docs-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.docs-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 12px;
}
.docs-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
}

.docs-content p { margin-bottom: 16px; }

.docs-content ul, .docs-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}
.docs-content li { margin-bottom: 6px; }

.docs-content code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85em;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
}

.docs-content pre {
  background: var(--bg-code);
  padding: 16px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.docs-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.docs-content th, .docs-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.docs-content th {
  background: var(--bg-subtle);
  font-weight: 600;
}

.docs-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 12px 20px;
  margin-bottom: 16px;
  background: var(--bg-subtle);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
}

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

.tip, .warning {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.tip { background: #e8f4f5; border-left: 3px solid var(--primary); }
.warning { background: #fff8e6; border-left: 3px solid #d4a017; }

/* ===== Sidebar Overlay (mobile) ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 40;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .sidebar-toggle { display: block; }

  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 60;
  }
  .docs-sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  .docs-content {
    margin-left: 0;
    padding: 24px 20px 60px;
  }

  .docs-content h1 { font-size: 1.6rem; }
  .docs-content h2 { font-size: 1.2rem; }
}
