/* AppForge Documentation v1.4.0 - Monochrome Design System */

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

:root {
  --primary: hsl(0 0% 7%);
  --primary-light: hsl(0 0% 30%);
  --primary-glow: hsla(0, 0%, 7%, 0.08);
  --background: hsl(0 0% 100%);
  --surface: hsl(0 0% 98%);
  --surface-elevated: hsl(0 0% 100%);
  --surface-hover: hsl(0 0% 96%);
  --border: hsl(0 0% 90%);
  --border-light: hsl(0 0% 94%);
  --text: hsl(0 0% 7%);
  --text-secondary: hsl(0 0% 25%);
  --text-muted: hsl(0 0% 45%);
  --text-faint: hsl(0 0% 60%);
  --success: hsl(142 71% 45%);
  --success-bg: hsla(142, 71%, 45%, 0.08);
  --warning: hsl(38 92% 50%);
  --warning-bg: hsla(38, 92%, 50%, 0.08);
  --error: hsl(0 84% 60%);
  --error-bg: hsla(0, 84%, 60%, 0.08);
  --info: hsl(217 91% 60%);
  --info-bg: hsla(217, 91%, 60%, 0.08);
  --code-bg: hsl(0 0% 97%);
  --shadow-sm: 0 1px 2px hsla(0, 0%, 0%, 0.04);
  --shadow-md: 0 4px 12px hsla(0, 0%, 0%, 0.06);
  --shadow-lg: 0 10px 24px hsla(0, 0%, 0%, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

[data-theme="dark"] {
  --primary: hsl(0 0% 100%);
  --primary-light: hsl(0 0% 80%);
  --primary-glow: hsla(0, 0%, 100%, 0.08);
  --background: hsl(0 0% 4%);
  --surface: hsl(0 0% 7%);
  --surface-elevated: hsl(0 0% 10%);
  --surface-hover: hsl(0 0% 12%);
  --border: hsl(0 0% 18%);
  --border-light: hsl(0 0% 12%);
  --text: hsl(0 0% 98%);
  --text-secondary: hsl(0 0% 85%);
  --text-muted: hsl(0 0% 60%);
  --text-faint: hsl(0 0% 45%);
  --success: hsl(142 71% 55%);
  --success-bg: hsla(142, 71%, 55%, 0.1);
  --warning: hsl(38 92% 60%);
  --warning-bg: hsla(38, 92%, 60%, 0.1);
  --error: hsl(0 84% 65%);
  --error-bg: hsla(0, 84%, 65%, 0.1);
  --info: hsl(217 91% 65%);
  --info-bg: hsla(217, 91%, 65%, 0.1);
  --code-bg: hsl(0 0% 6%);
  --shadow-sm: 0 1px 2px hsla(0, 0%, 0%, 0.2);
  --shadow-md: 0 4px 12px hsla(0, 0%, 0%, 0.3);
  --shadow-lg: 0 10px 24px hsla(0, 0%, 0%, 0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--background);
  color: var(--text);
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
p { color: var(--text-secondary); }

@media (max-width: 768px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.2rem; }
}

a { color: var(--primary); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.7; }

/* Theme Toggle */
.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text-muted);
}
.theme-toggle:hover { background: var(--surface-hover); color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }
[data-theme="dark"] .theme-toggle .sun-icon { display: block; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none; }

/* Navigation */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
}
.nav-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.nav-logo:hover { color: var(--text); opacity: 1; }
.nav-logo svg { width: 24px; height: 24px; color: var(--text); }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}
.nav-links a:hover { background: var(--surface-hover); color: var(--text); opacity: 1; }
.nav-links a.active { background: var(--primary-glow); color: var(--primary); }
@media (max-width: 768px) { .nav-links { display: none; } }

/* Layout */
.docs-layout { display: flex; min-height: calc(100vh - 56px); }
.docs-content { flex: 1; min-width: 0; background: var(--background); }
.docs-content .main-content { max-width: 860px; }
.main-content { max-width: 860px; margin: 0 auto; padding: 40px 28px; }
@media (max-width: 768px) { .main-content { padding: 28px 16px; } }

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  flex-shrink: 0;
  padding: 20px 0;
}
.sidebar-section { margin-bottom: 20px; }
.sidebar-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  padding: 6px 20px;
  margin-bottom: 2px;
}
.sidebar-nav { list-style: none; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
  border-left: 2px solid transparent;
}
.sidebar-link svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.6; }
.sidebar-link:hover { background: var(--surface-hover); color: var(--text); opacity: 1; }
.sidebar-link.active { background: var(--primary-glow); color: var(--primary); border-left-color: var(--primary); }
.sidebar-link.active svg { opacity: 1; }
.sidebar-link-sub { padding-left: 44px; font-size: 12px; font-weight: 400; }

/* Mobile Sidebar */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 100;
  background: var(--primary);
  color: var(--background);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  align-items: center;
  justify-content: center;
}
.sidebar-toggle svg { width: 20px; height: 20px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: hsla(0,0%,0%,0.5); z-index: 199; backdrop-filter: blur(4px); }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -280px; top: 0; height: 100vh; z-index: 200; transition: left 0.3s; padding-top: 16px; }
  .sidebar.open { left: 0; }
  .sidebar-overlay.open { display: block; }
  .sidebar-toggle { display: flex; }
  .docs-layout { display: block; }
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.2s;
}
.card-clickable { cursor: pointer; }
.card-clickable:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-flat:hover { border-color: var(--border); transform: none; box-shadow: none; }

/* Icon Box */
.icon-box { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.icon-box svg { width: 22px; height: 22px; }
.icon-box-primary { background: var(--primary-glow); color: var(--primary); }
.icon-box-success { background: var(--success-bg); color: var(--success); }
.icon-box-warning { background: var(--warning-bg); color: var(--warning); }
.icon-box-info { background: var(--info-bg); color: var(--info); }
.icon-box-error { background: var(--error-bg); color: var(--error); }

.feature-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
  background: var(--primary-glow); color: var(--primary);
}
.feature-icon svg { width: 24px; height: 24px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-md); font-weight: 500; font-size: 13px;
  text-decoration: none; transition: all 0.2s; cursor: pointer; border: none;
  font-family: inherit;
}
.btn:hover { opacity: 1; }
.btn-primary { background: var(--primary); color: var(--background); }
.btn-primary:hover { opacity: 0.9; color: var(--background); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }

/* Code */
code {
  background: var(--code-bg); padding: 2px 6px; border-radius: var(--radius-sm);
  font-size: 12px; color: var(--text); font-family: 'JetBrains Mono', monospace; border: 1px solid var(--border);
}
pre {
  background: var(--code-bg); padding: 16px; border-radius: var(--radius-md);
  overflow-x: auto; border: 1px solid var(--border); margin: 10px 0;
}
pre code { padding: 0; background: none; font-size: 12px; line-height: 1.8; border: none; color: var(--text-secondary); }

.syntax-keyword { color: #c084fc; }
.syntax-string { color: #86efac; }
.syntax-comment { color: var(--text-faint); font-style: italic; }
.syntax-function { color: #60a5fa; }
.syntax-number { color: #fbbf24; }
.syntax-property { color: #f472b6; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: var(--radius-md); margin: 14px 0; display: flex; align-items: flex-start; gap: 10px; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.alert-success { background: var(--success-bg); border: 1px solid var(--success); }
.alert-success svg { color: var(--success); }
.alert-warning { background: var(--warning-bg); border: 1px solid var(--warning); }
.alert-warning svg { color: var(--warning); }
.alert-error { background: var(--error-bg); border: 1px solid var(--error); }
.alert-error svg { color: var(--error); }
.alert-info { background: var(--info-bg); border: 1px solid var(--info); }
.alert-info svg { color: var(--info); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 100px; font-size: 11px; font-weight: 500; }
.badge-ios { background: hsla(217,91%,60%,0.12); color: var(--info); }
.badge-android { background: hsla(142,71%,45%,0.12); color: var(--success); }
.badge-primary { background: var(--primary-glow); color: var(--primary); }
.badge-new { background: var(--success-bg); color: var(--success); }
.badge-secondary { background: var(--surface-hover); color: var(--text-muted); }

/* Tables */
.table-wrapper { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; font-size: 13px; }
th { background: var(--surface); font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid var(--border-light); color: var(--text-muted); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface); }

/* Lists */
ul, ol { padding-left: 20px; }
li { margin: 5px 0; color: var(--text-secondary); font-size: 14px; }
.list-none { list-style: none; padding-left: 0; }
.feature-list { list-style: none; padding-left: 0; }
.feature-list li { padding: 6px 0; border-bottom: 1px solid var(--border-light); font-size: 14px; }
.feature-list li:last-child { border-bottom: none; }

/* Grid */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Flex Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }

/* Spacing */
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.mb-12 { margin-bottom: 48px; } .mb-16 { margin-bottom: 64px; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.p-4 { padding: 16px; } .p-6 { padding: 24px; }

/* Text */
.text-center { text-align: center; }
.text-xs { font-size: 11px; } .text-sm { font-size: 13px; } .text-base { font-size: 15px; }
.text-lg { font-size: 17px; } .text-xl { font-size: 19px; } .text-2xl { font-size: 24px; }
.font-medium { font-weight: 500; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); } .text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); } .text-warning { color: var(--warning); }
.text-error { color: var(--error); } .text-info { color: var(--info); } .text-primary { color: var(--primary); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.tab-btn {
  padding: 10px 16px; background: transparent; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; color: var(--text-muted); font-size: 13px; font-weight: 500; transition: all 0.2s;
  margin-bottom: -1px; font-family: inherit;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.tab-content.active { display: block; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border-light); }
.faq-item:last-child { border-bottom: none; }
.faq-question { cursor: pointer; padding: 14px 0; display: flex; justify-content: space-between; align-items: center; font-weight: 500; color: var(--text); transition: color 0.2s; font-size: 14px; }
.faq-question:hover { color: var(--primary); }
.faq-answer { display: none; padding-bottom: 14px; color: var(--text-muted); line-height: 1.7; font-size: 14px; }
.faq-answer.open { display: block; }
.faq-arrow { transition: transform 0.2s; color: var(--text-faint); font-size: 12px; }

/* Step Numbers */
.step-number {
  background: var(--primary); color: var(--background); width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px;
  margin-right: 10px; flex-shrink: 0;
}

/* Checklist */
.checklist-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.checklist-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* Search */
.search-input {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px 14px; width: 100%; color: var(--text); font-size: 13px; transition: all 0.2s; font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.search-input::placeholder { color: var(--text-faint); }

/* Hero */
.hero { text-align: center; margin-bottom: 40px; padding: 20px 0; }
.hero h1 { margin-bottom: 10px; }
.hero p { color: var(--text-muted); max-width: 520px; margin: 0 auto 20px; font-size: 16px; }

.version-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 100px;
  font-size: 11px; font-weight: 500; color: var(--text-muted); margin-bottom: 12px;
}

/* Footer */
.footer { border-top: 1px solid var(--border); margin-top: 56px; padding: 28px; text-align: center; color: var(--text-faint); font-size: 12px; }

/* TOC */
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 20px; }
.toc-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); margin-bottom: 10px; }
.toc-list { list-style: none; }
.toc-list li { margin: 6px 0; }
.toc-list a { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.toc-list a:hover { color: var(--primary); }

/* Callout */
.callout { display: flex; gap: 14px; padding: 16px; border-radius: var(--radius-lg); margin: 16px 0; }
.callout-icon { width: 20px; height: 20px; flex-shrink: 0; }
.callout-tip { background: var(--success-bg); border: 1px solid var(--success); }
.callout-tip .callout-icon { color: var(--success); }
.callout-warning { background: var(--warning-bg); border: 1px solid var(--warning); }
.callout-warning .callout-icon { color: var(--warning); }
.callout-info { background: var(--info-bg); border: 1px solid var(--info); }
.callout-info .callout-icon { color: var(--info); }

/* Method Badges */
.method-badge { display: inline-flex; padding: 3px 7px; border-radius: var(--radius-sm); font-size: 10px; font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.method-get { background: hsla(217,91%,60%,0.12); color: hsl(217,91%,45%); }
.method-post { background: hsla(142,71%,45%,0.12); color: hsl(142,71%,35%); }

/* Env Table */
.env-table td:first-child { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text); font-weight: 500; white-space: nowrap; }

/* Print */
@media print {
  .sidebar, .nav, .sidebar-toggle, .theme-toggle { display: none !important; }
  .docs-layout { display: block; }
  .main-content { max-width: 100%; padding: 0; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

::selection { background: var(--primary-glow); color: var(--primary); }
*:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease-out; }

kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px;
  padding: 0 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 11px; font-family: 'JetBrains Mono', monospace; color: var(--text-secondary);
}

@media (max-width: 640px) { .hide-mobile { display: none !important; } }
@media (min-width: 641px) { .hide-desktop { display: none !important; } }
