/* ChatYug Developer Documentation — layout & components */
:root {
  --docs-brand: #8231D3;
  --docs-brand-dark: #4D1C7D;
  --docs-brand-light: #EEF2FF;
  --docs-sidebar-w: 260px;
  --docs-code-bg: #1e293b;
  --docs-code-text: #e2e8f0;
  --docs-border: #e5e7eb;
  --docs-muted: #6b7280;
  --docs-text: #1f2937;
  --docs-bg: #f9fafb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  color: var(--docs-text);
  background: var(--docs-bg);
}

a { color: var(--docs-brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.docs-layout {
  display: flex;
  min-height: 100vh;
}

.docs-sidebar {
  width: var(--docs-sidebar-w);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--docs-border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 200;
  transform: translateX(0);
  transition: transform 0.25s ease;
}

.docs-sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--docs-border);
}

.docs-sidebar-header a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--docs-brand);
  text-decoration: none;
  font-size: 1rem;
}

.docs-sidebar-header img {
  width: 32px;
  height: 32px;
}

.docs-nav-section {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--docs-border);
}

.docs-nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--docs-muted);
  padding: 0.25rem 1.25rem 0.5rem;
}

.docs-nav-link {
  display: block;
  padding: 0.4rem 1.25rem;
  font-size: 0.875rem;
  color: var(--docs-text);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.docs-nav-link:hover {
  background: var(--docs-brand-light);
  text-decoration: none;
}

.docs-nav-link.active {
  color: var(--docs-brand);
  font-weight: 600;
  border-left-color: var(--docs-brand);
  background: var(--docs-brand-light);
}

.docs-nav-link.docs-nav-soon {
  color: var(--docs-muted);
  cursor: default;
  pointer-events: none;
}

.docs-nav-soon-badge {
  font-size: 0.65rem;
  background: #f3f4f6;
  color: var(--docs-muted);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  margin-left: 0.35rem;
  font-weight: 500;
}

.docs-main {
  flex: 1;
  margin-left: var(--docs-sidebar-w);
  min-width: 0;
}

.docs-topbar {
  background: linear-gradient(135deg, var(--docs-brand) 0%, var(--docs-brand-dark) 100%);
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 1rem;
}

.docs-topbar-title {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.95;
  flex: 1;
}

.docs-topbar-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-shrink: 0;
}

.docs-topbar-links a {
  color: #fff;
  font-size: 0.85rem;
  text-decoration: none;
  opacity: 0.9;
}

.docs-topbar-links a:hover { opacity: 1; text-decoration: underline; }

.docs-topbar-links .docs-btn-outline {
  border: 1px solid rgba(255,255,255,0.5);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
}

.docs-menu-toggle {
  display: none;
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.docs-content {
  max-width: 820px;
  padding: 2rem 2rem 4rem;
}

.docs-content h1 {
  font-size: 1.85rem;
  color: var(--docs-brand-dark);
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.docs-content h2 {
  font-size: 1.35rem;
  color: var(--docs-brand);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--docs-border);
}

.docs-content h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.docs-content p, .docs-content li {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.docs-content ul, .docs-content ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

.docs-lead {
  font-size: 1.05rem;
  color: var(--docs-muted);
  margin-bottom: 1.5rem;
}

.docs-endpoint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--docs-code-bg);
  color: var(--docs-code-text);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.9rem;
  margin: 0.75rem 0 1rem;
}

.docs-method {
  background: var(--docs-brand);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
}

.docs-auth {
  font-size: 0.85rem;
  color: var(--docs-muted);
  margin-bottom: 1.25rem;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.875rem;
}

.docs-table th,
.docs-table td {
  border: 1px solid var(--docs-border);
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.docs-table th {
  background: var(--docs-brand-light);
  font-weight: 600;
  color: var(--docs-brand-dark);
}

.docs-table code { font-size: 0.8rem; }

.docs-code-block {
  background: var(--docs-code-bg);
  color: var(--docs-code-text);
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.55;
}

.docs-code-block pre {
  padding: 1.25rem;
  margin: 0;
  white-space: pre;
}

.docs-tabs { margin: 1rem 0 1.5rem; }

.docs-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--docs-border);
  margin-bottom: 0;
}

.docs-tab-btn {
  background: #f3f4f6;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--docs-muted);
  border-radius: 6px 6px 0 0;
  margin-right: 2px;
}

.docs-tab-btn.active {
  background: var(--docs-code-bg);
  color: #fff;
}

.docs-tab-panel { display: none; }
.docs-tab-panel.active { display: block; }

.docs-tab-panel .docs-code-block {
  margin-top: 0;
  border-radius: 0 8px 8px 8px;
}

.docs-callout {
  padding: 1rem 1.15rem;
  border-radius: 8px;
  margin: 1.25rem 0;
  font-size: 0.9rem;
  border-left: 4px solid;
}

.docs-callout-info {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e40af;
}

.docs-callout-webhook {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #166534;
}

.docs-callout-meta {
  background: var(--docs-brand-light);
  border-color: var(--docs-brand);
  color: var(--docs-brand-dark);
}

.docs-callout strong { font-weight: 600; }

.docs-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.docs-pillar {
  background: #fff;
  border: 1px solid var(--docs-border);
  border-radius: 10px;
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.docs-pillar:hover:not(.docs-pillar-soon) {
  border-color: var(--docs-brand);
  box-shadow: 0 4px 12px rgba(130, 49, 211, 0.12);
}

.docs-pillar h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.docs-pillar h3 a { color: var(--docs-brand-dark); text-decoration: none; }
.docs-pillar h3 a:hover { color: var(--docs-brand); }

.docs-pillar p {
  font-size: 0.85rem;
  color: var(--docs-muted);
  margin: 0;
}

.docs-pillar-soon { opacity: 0.65; }

.docs-pillar-soon .docs-soon-label {
  display: inline-block;
  font-size: 0.7rem;
  background: #f3f4f6;
  color: var(--docs-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.5rem;
}

code {
  background: #f3f4f6;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: Consolas, Monaco, "Courier New", monospace;
}

.docs-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
}

.docs-overlay.open { display: block; }

@media (max-width: 900px) {
  .docs-sidebar { transform: translateX(-100%); }
  .docs-sidebar.open { transform: translateX(0); }
  .docs-main { margin-left: 0; }
  .docs-menu-toggle { display: block; }
  .docs-content { padding: 1.25rem 1rem 3rem; }
}
