/*
 * XycAi Docs — shared stylesheet.
 * Nunito + monochrome zinc + orange jelly accent, matching the marketing site.
 * Plain CSS, no framework. Layout: fixed left sidebar + scrollable content.
 */
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --jelly: #ff5436;
  --jelly-2: #ff7a3d;
  --jelly-dark: #e23a1f;
  --bg: #fafafa;
  --bg-1: #f4f4f5;
  --surface: #ffffff;
  --text: #18181b;
  --text-2: #3f3f46;
  --text-3: #71717a;
  --border: rgba(24, 24, 27, 0.1);
  --border-strong: rgba(24, 24, 27, 0.16);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 280px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Nunito', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Layout ---------- */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: block;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  padding: 0 24px 20px;
  color: var(--text);
}
.sidebar-brand span {
  color: var(--jelly);
}

.nav-group {
  margin-bottom: 18px;
}
.nav-group-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 0 24px 6px;
}
.nav-link {
  display: block;
  padding: 6px 24px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-2);
  border-left: 2px solid transparent;
}
.nav-link:hover {
  color: var(--text);
  background: var(--bg-1);
  text-decoration: none;
}
.nav-link.active {
  color: var(--jelly-dark);
  border-left-color: var(--jelly);
  background: rgba(255, 84, 54, 0.05);
}

.content {
  flex: 1;
  min-width: 0;
  max-width: 880px;
  padding: 56px 64px 120px;
}

/* ---------- Typography ---------- */
.content h1 {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}
.content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 48px 0 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.content h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 32px 0 12px;
}
.content p {
  color: var(--text-2);
  margin: 0 0 16px;
}
.lead {
  font-size: 1.15rem;
  color: var(--text-3);
  margin-bottom: 32px;
}

/* ---------- Code ---------- */
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--jelly-dark);
}
pre {
  background: #1c1c1f;
  color: #e4e4e7;
  border-radius: var(--radius);
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.6;
  margin: 0 0 20px;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.tok-kw { color: #ff8a65; }
.tok-str { color: #a5d6a7; }
.tok-cm { color: #6b7280; font-style: italic; }
.tok-fn { color: #82aaff; }
.tok-num { color: #f5c97e; }

/* ---------- Code tabs ---------- */
.tabs {
  margin: 0 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.tab-bar {
  display: flex;
  gap: 2px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  padding: 6px 6px 0;
}
.tab-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-3);
  background: none;
  border: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 8px 16px;
  cursor: pointer;
}
.tab-btn.active {
  color: var(--text);
  background: #1c1c1f;
  color: #fff;
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
.tabs pre {
  margin: 0;
  border-radius: 0;
}

/* ---------- Tables ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}
th {
  background: var(--bg-1);
  font-weight: 800;
  color: var(--text);
}
td code {
  white-space: nowrap;
}

/* ---------- Callouts ---------- */
.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--jelly);
  background: rgba(255, 84, 54, 0.04);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 0 0 24px;
}
.callout p:last-child {
  margin-bottom: 0;
}
.callout-title {
  font-weight: 800;
  color: var(--jelly-dark);
  margin-bottom: 4px;
}
.callout.info {
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}
.callout.info .callout-title {
  color: #2563eb;
}

/* ---------- Endpoint badge ---------- */
.endpoint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin-bottom: 16px;
}
.method {
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 5px;
  color: #fff;
}
.method.post { background: #16a34a; }
.method.get { background: #2563eb; }

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--surface);
  transition: border-color 0.18s, transform 0.18s;
}
.card:hover {
  border-color: var(--jelly);
  transform: translateY(-2px);
  text-decoration: none;
}
.card-title {
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.card-desc {
  font-size: 0.88rem;
  color: var(--text-3);
}

/* ---------- Misc ---------- */
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--jelly-dark);
  background: rgba(255, 84, 54, 0.1);
  border-radius: 999px;
  padding: 2px 10px;
  margin-left: 8px;
  vertical-align: middle;
}

.footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-3);
}

/* ---------- Mobile ---------- */
.menu-toggle {
  display: none;
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .content {
    padding: 56px 24px 100px;
  }
  .menu-toggle {
    display: flex;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 60;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2rem;
  }
}
