/* =========================================
   Klaudii Docs — docs.css
   ========================================= */

:root {
  --bg:            #0a0a0f;
  --bg-raised:     #111118;
  --bg-card:       #16161f;
  --border:        rgba(255,255,255,0.06);
  --border-bright: rgba(255,255,255,0.12);
  --text:          #e4e4ed;
  --text-muted:    #8888a0;
  --text-dim:      #55556a;
  --accent:        #7c5bf5;
  --accent-light:  #a78bfa;
  --green:         #34d399;
  --green-bg:      rgba(52,211,153,0.12);
  --yellow:        #fbbf24;
  --yellow-bg:     rgba(251,191,36,0.12);
  --red:           #f87171;
  --red-bg:        rgba(248,113,113,0.12);
  --blue-bg:       rgba(96,165,250,0.1);
  --font:          'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:     'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --sidebar-w:     260px;
  --topbar-h:      56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; scroll-padding-top: calc(var(--topbar-h) + 1.5rem); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(124,91,245,0.3); color: #fff; }

/* ---- TOPBAR ---- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: rgba(10,10,15,0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 100;
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.topbar-logo:hover { text-decoration: none; }
.topbar-docs-label {
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 0.15rem;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  gap: 1.5rem;
}
.topbar-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
}
.topbar-link:hover { color: var(--text); text-decoration: none; }
.sidebar-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: 1rem;
}
.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

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

/* ---- SIDEBAR ---- */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  overflow-y: auto;
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--border);
  background: var(--bg);
  z-index: 50;
}
.sidebar-section {
  margin-bottom: 1.5rem;
}
.sidebar-heading {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  padding: 0 0.5rem;
}
.sidebar-link {
  display: block;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
}
.sidebar-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
  text-decoration: none;
}
.sidebar-link.active {
  color: var(--text);
  background: rgba(124,91,245,0.1);
  text-decoration: none;
}

/* ---- CONTENT ---- */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  max-width: 780px;
  padding: 2.5rem 3rem 6rem;
}

.content section {
  margin-bottom: 4rem;
}

.content h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  padding-top: 0.5rem;
}
.content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.content p {
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}
.content p strong { color: var(--text); }
.content ul, .content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}
.content li {
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.content ul { list-style: disc; }
.content ol { list-style: decimal; }

/* Inline code */
.content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(255,255,255,0.06);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--text);
}

/* Code blocks */
.code-block {
  background: #0d0d14;
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.code-block-inline { margin-bottom: 0; margin-top: 0.5rem; }
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-dim);
}
.code-copy {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  font-family: var(--font);
}
.code-copy:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.code-block pre {
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.7;
}
.code-block pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: var(--text-muted);
  font-size: inherit;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
thead th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-bright);
  color: var(--text);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
tbody td strong { color: var(--text); }

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-red { background: var(--red-bg); color: var(--red); }

/* Callouts */
.callout {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.callout strong { color: var(--text); }
.callout-info {
  border-left: 3px solid var(--accent);
  background: rgba(124,91,245,0.05);
}
.callout-warn {
  border-left: 3px solid var(--yellow);
  background: rgba(251,191,36,0.05);
}

/* Steps */
.steps { margin-bottom: 1.5rem; }
.step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(124,91,245,0.12);
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.step h3 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}
.step p { margin-bottom: 0.4rem; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 280px;
    background: var(--bg-raised);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .content {
    margin-left: 0;
    padding: 2rem 1.5rem 4rem;
  }
}

@media (max-width: 480px) {
  .content { padding: 1.5rem 1rem 4rem; }
  .content h1 { font-size: 1.5rem; }
  .content h2 { font-size: 1.25rem; }
  table { font-size: 0.8rem; }
}
