/* docs.css — Strut Documentation Portal Styling */

:root {
  --bg-primary: #09090b;
  --bg-secondary: #121216;
  --bg-surface: #18181b;
  --bg-elevated: #202024;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(96, 165, 250, 0.5);
  
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.2);
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;

  --ease-ui: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.docs-body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.docs-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.docs-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.docs-logo-img {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: opacity 160ms ease;
}

.docs-logo:hover .docs-logo-img {
  opacity: 0.85;
}

.docs-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 4px;
}

.docs-search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  gap: 8px;
  width: 320px;
  transition: border-color 160ms var(--ease-ui), box-shadow 160ms var(--ease-ui);
}

.docs-search-bar:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.docs-search-bar input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13px;
  width: 100%;
  outline: none;
}

.docs-search-bar input::placeholder {
  color: var(--text-muted);
}

.docs-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  transition: all 160ms var(--ease-ui);
}

.nav-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-btn:active {
  transform: scale(0.97);
}

.agent-btn {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
  color: #c084fc;
  border-color: rgba(139, 92, 246, 0.4);
}

.agent-btn:hover {
  color: #e9d5ff;
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.ghost-btn {
  background: transparent;
  border-color: transparent;
}

/* Layout */
.docs-layout {
  display: flex;
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* Sidebar */
.docs-sidebar {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
  position: sticky;
  top: 61px;
  height: calc(100vh - 61px);
  overflow-y: auto;
}

.nav-group {
  margin-bottom: 24px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding: 4px 12px;
  margin-bottom: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  border-radius: 6px;
  transition: all 140ms var(--ease-ui);
}

.sidebar-link:hover {
  color: #fff;
  background: var(--bg-surface);
}

.sidebar-link.active {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.1);
  font-weight: 500;
}

.method {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}

.method.post {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.method.get {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

/* Content Area */
.docs-content {
  flex: 1;
  padding: 40px 60px;
  max-width: 960px;
  min-width: 0;   /* let long code lines scroll in their `pre`, not widen the page */
}

.doc-section {
  margin-bottom: 56px;
  scroll-margin-top: 80px;
}

.section-tag {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #60a5fa;
  margin-bottom: 8px;
}

.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 12px;
}

.section-lead {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  margin: 28px 0 14px 0;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 10px 0;
}

p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 14.5px;
}

/* Callout Box */
.callout {
  display: flex;
  gap: 12px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  padding: 16px;
  margin: 20px 0;
}

.callout-icon {
  font-size: 18px;
}

.callout-body {
  font-size: 14px;
  color: #dbeafe;
}

/* Benchmarks Grid */
.benchmark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.benchmark-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
}

.bench-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 700;
  color: #34d399;
  margin-bottom: 6px;
}

.bench-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.bench-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Table */
.params-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px 0;
  font-size: 13.5px;
}

.params-table th, .params-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.params-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
}

.params-table td {
  color: var(--text-secondary);
}

.params-table code {
  background: var(--bg-surface);
  padding: 2px 6px;
  border-radius: 4px;
  color: #60a5fa;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
}

/* Code Block */
.code-block-wrapper {
  background: #0d0d11;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin: 16px 0 28px 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
}

.code-lang {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
}

.copy-code-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 140ms var(--ease-ui);
}

.copy-code-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.copy-code-btn:active {
  transform: scale(0.96);
}

pre {
  padding: 18px 20px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.55;
  color: #e4e4e7;
}

/* Syntax Highlighting */
.token-cmd { color: #f43f5e; font-weight: 600; }
.token-str { color: #34d399; }
.token-key { color: #60a5fa; }
.token-num { color: #f59e0b; }
.token-kw { color: #c084fc; font-weight: 600; }
.token-fn { color: #38bdf8; }
.token-dec { color: #fbbf24; }
.token-bool { color: #f472b6; }
.token-comment { color: #71717a; font-style: italic; }

@media (max-width: 1024px) {
  .docs-layout {
    flex-direction: column;
  }
  .docs-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .docs-content {
    padding: 30px 20px;
  }
}

/* ========================================================================= */
/* RESPONSIVE — NARROW VIEWPORTS */
/* ========================================================================= */
/* The header is a single justify-between row sized for desktop: logo + 320px
   search on the left, three nav buttons on the right. Below ~720px that row
   cannot fit, so it wraps into two rows rather than dropping links — docs has
   no footer, so the header is the only navigation off this page. */
@media (max-width: 720px) {
  .docs-header {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px 10px;
  }

  .docs-header-left {
    flex: 1 1 100%;
    gap: 10px;
    min-width: 0;
  }

  .docs-search-bar {
    width: auto;      /* was a fixed 320px */
    flex: 1;
    min-width: 0;
  }

  .docs-search-bar input {
    min-width: 0;
  }

  .docs-header-right {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }

  .nav-btn {
    white-space: nowrap;
    font-size: 12px;
    padding: 6px 10px;
  }

  .docs-content {
    padding: 28px 16px;
  }

  /* The parameter tables have a ~427px min-content width they cannot shrink
     below, and they sit as bare <table> elements with no wrapper to scroll in.
     Making the table itself a scrollable block keeps the row layout (browsers
     generate an anonymous table box inside) while confining the overflow. */
  .params-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
