/* ═══════════════════════════════════════════════
   COIxist — Documentation Styles
   ═══════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #07090F;
  --bg-elevated: #0D1117;
  --bg-card: #111622;
  --bg-sidebar: #0B0E16;
  --border: rgba(91, 143, 206, 0.1);
  --border-hover: rgba(91, 143, 206, 0.25);
  --blue: #5B8FCE;
  --blue-light: #7AA5DC;
  --blue-pale: #A8C8F0;
  --text-primary: #F1F3F9;
  --text-secondary: #A0A8C0;
  --text-muted: #5A6380;
  --risk-high: #F87171;
  --risk-medium: #FBBF24;
  --risk-low: #60A5FA;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --nav-height: 60px;
  --sidebar-width: 280px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text-primary); overflow-x: hidden; }
a { color: var(--blue-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── TOP NAV ─── */
.docs-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(7, 9, 15, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.docs-nav-inner {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.docs-nav-logo {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.docs-nav-logo-img {
  height: 28px;
  width: 28px;
  object-fit: contain;
}

.docs-nav-logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
}

.docs-nav-logo-x {
  color: #E88271;
}

.docs-nav-logo-ist {
  color: #5B9279;
}

.docs-nav-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--blue);
  background: rgba(91, 143, 206, 0.1);
  border: 1px solid rgba(91, 143, 206, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
}

.docs-search {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}

.docs-search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.docs-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.3s;
}

.docs-search input::placeholder { color: var(--text-muted); }
.docs-search input:focus { border-color: var(--blue); }

.docs-search kbd {
  position: absolute;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.docs-nav-links {
  display: flex;
  gap: 20px;
  margin-left: auto;
  flex-shrink: 0;
}

.docs-nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
}

.docs-nav-links a:hover { color: var(--text-primary); text-decoration: none; }

.docs-nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  margin-left: auto;
}

.docs-nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s;
}

/* ─── LAYOUT ─── */
.docs-layout {
  display: flex;
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* ─── SIDEBAR ─── */
.docs-sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 0;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.docs-sidebar-section {
  padding: 0 20px;
  margin-bottom: 28px;
}

.docs-sidebar-heading {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 0 12px;
}

.docs-sidebar-link {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
  border-left: 2px solid transparent;
}

.docs-sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(91, 143, 206, 0.05);
  text-decoration: none;
}

.docs-sidebar-link.active {
  color: var(--blue-light);
  background: rgba(91, 143, 206, 0.08);
  border-left-color: var(--blue);
}

/* ─── CONTENT ─── */
.docs-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
}

.docs-content-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 40px 120px;
}

/* ─── ARTICLES ─── */
.docs-article {
  padding-bottom: 64px;
  margin-bottom: 64px;
  border-bottom: 1px solid var(--border);
}

.docs-article:last-child {
  border-bottom: none;
}

.docs-breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.docs-article h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.2;
}

.docs-article h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.docs-article h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.docs-article p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.docs-article ul, .docs-article ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.docs-article li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.docs-article code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--blue-light);
  background: rgba(91, 143, 206, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.docs-article strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ─── TABLE ─── */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
}

.docs-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  padding: 10px 16px;
  border-bottom: 2px solid var(--border);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.docs-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  line-height: 1.6;
}

.docs-table tr:last-child td { border-bottom: none; }

.docs-table tr:hover td { background: rgba(91, 143, 206, 0.03); }

/* ─── CALLOUT ─── */
.docs-callout {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.7;
  border-left: 3px solid;
}

.docs-callout strong {
  display: block;
  margin-bottom: 4px;
}

.docs-callout--info {
  background: rgba(91, 143, 206, 0.06);
  border-left-color: var(--blue);
  color: var(--text-secondary);
}

.docs-callout--info strong { color: var(--blue-light); }

.docs-callout--warning {
  background: rgba(251, 191, 36, 0.06);
  border-left-color: var(--risk-medium);
  color: var(--text-secondary);
}

.docs-callout--warning strong { color: var(--risk-medium); }

/* ─── BADGES ─── */
.docs-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.docs-badge--red { background: rgba(248, 113, 113, 0.15); color: var(--risk-high); }
.docs-badge--blue { background: rgba(96, 165, 250, 0.15); color: var(--risk-low); }
.docs-badge--yellow { background: rgba(251, 191, 36, 0.15); color: var(--risk-medium); }
.docs-badge--gray { background: rgba(90, 99, 128, 0.2); color: var(--text-muted); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .docs-content-inner {
    padding: 32px 24px 80px;
  }
}

@media (max-width: 768px) {
  .docs-nav-links { display: none; }
  .docs-nav-hamburger { display: flex; }

  .docs-search { max-width: none; flex: 1; }
  .docs-search kbd { display: none; }

  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-out-expo);
    width: 280px;
    z-index: 90;
  }

  .docs-sidebar.is-open {
    transform: translateX(0);
  }

  .docs-content {
    margin-left: 0;
  }

  .docs-content-inner {
    padding: 24px 16px 80px;
  }

  .docs-article h1 { font-size: 26px; }

  .docs-table { font-size: 13px; }
  .docs-table th, .docs-table td { padding: 8px 10px; }
}

/* ── Tabs ── */
.docs-tabs { margin: 20px 0; }
.docs-tab-buttons { display: flex; gap: 0; border-bottom: 2px solid #e2e8f0; margin-bottom: 0; }
.docs-tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  transition: color 0.2s, border-color 0.2s;
}
.docs-tab-btn:hover { color: #334155; }
.docs-tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; }
.docs-tab-content { display: none; padding: 20px 0; }
.docs-tab-content.active { display: block; }
.docs-tab-content ol { margin-left: 20px; }
.docs-tab-content code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
