/* ═══════════════════════════════════════════════════════════════════════
   Venvera Help Center — Stylesheet
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --brand: #4f46e5;
  --brand-light: #eef2ff;
  --brand-dark: #3730a3;
  --text: #1e293b;
  --text-secondary: #475569;
  --text-dim: #94a3b8;
  --bg: #ffffff;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --max-width: 1200px;
  --sidebar-width: 260px;
  --header-height: 64px;
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg-page);
  line-height: 1.6;
  font-size: 15px;
}

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

/* ─── Header ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.92);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}

.header-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.header-logo-text span {
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 6px;
  font-size: 15px;
}

.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 8px 16px 8px 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-subtle);
  outline: none;
  transition: all 0.2s;
}

.header-search input:focus {
  border-color: var(--brand);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.header-search input::placeholder { color: var(--text-dim); }

.header-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.header-search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: inherit;
}

.header-nav { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.header-link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
}

.header-link:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }

.header-link--primary {
  background: var(--brand);
  color: #fff;
}

.header-link--primary:hover { background: var(--brand-dark); color: #fff; }

/* Mobile menu toggle */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-secondary);
}

/* ─── Search Results Overlay ─────────────────────────────────────────── */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 200;
}

.search-results.active { display: block; }

.search-results-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

.search-result-item {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-subtle); text-decoration: none; }

.search-result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.search-result-breadcrumb {
  font-size: 12px;
  color: var(--text-dim);
}

.search-result-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.search-result-excerpt mark {
  background: #fef08a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ─── Layout ─────────────────────────────────────────────────────────── */
.layout {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 0;
  min-height: calc(100vh - var(--header-height));
}

.layout--home { display: block; }

/* ─── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding: 24px 0 24px 24px;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-section { margin-bottom: 20px; }

.sidebar-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  padding: 4px 12px;
  margin-bottom: 4px;
}

.sidebar-link {
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.4;
}

.sidebar-link:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }

.sidebar-link.active {
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
}

.sidebar-link--parent {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

/* ─── Article Content ────────────────────────────────────────────────── */
.content {
  flex: 1;
  min-width: 0;
  padding: 32px 40px 60px;
  max-width: 800px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.breadcrumbs a { color: var(--text-dim); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .sep { color: var(--border); }

.article-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.article-meta {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.article-body h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 36px 0 12px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.article-body h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 28px 0 8px;
  color: var(--text);
}

.article-body p { margin: 0 0 14px; color: var(--text-secondary); }

.article-body ul, .article-body ol {
  margin: 0 0 16px;
  padding-left: 24px;
  color: var(--text-secondary);
}

.article-body li { margin-bottom: 6px; }

.article-body strong { color: var(--text); font-weight: 600; }

.article-body code {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 13px;
  font-family: "JetBrains Mono", monospace;
}

.article-body pre {
  background: #1e293b;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e2e8f0;
}

/* Callout boxes */
.callout {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 16px 0;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.callout-icon { flex-shrink: 0; font-size: 16px; margin-top: 1px; }

.callout--tip {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.callout--warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.callout--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.callout--danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Step blocks */
.steps { counter-reset: step; margin: 16px 0; }

.step {
  counter-increment: step;
  position: relative;
  padding: 0 0 20px 48px;
  border-left: 2px solid var(--border-light);
  margin-left: 15px;
}

.step:last-child { border-left-color: transparent; padding-bottom: 0; }

.step::before {
  content: counter(step);
  position: absolute;
  left: -16px;
  top: 0;
  width: 30px;
  height: 30px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.step-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.step p { margin-bottom: 8px; }

/* Field reference table */
.field-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.field-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.field-table td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.field-table tr:hover td { background: var(--bg-subtle); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge--required { background: #fef2f2; color: #dc2626; }
.badge--optional { background: var(--bg-subtle); color: var(--text-dim); }

/* ─── Homepage ───────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 60px 24px 40px;
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.hero p { font-size: 17px; color: var(--text-secondary); }

.hero-search {
  max-width: 520px;
  margin: 28px auto 0;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border: 2px solid var(--border);
  border-radius: 999px;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.hero-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(79,70,229,0.1), var(--shadow);
}

.hero-search input::placeholder { color: var(--text-dim); }

.hero-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

/* Category grid */
.categories {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.category-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.category-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}

.category-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.category-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  flex: 1;
}

.category-count {
  font-size: 12px;
  color: var(--text-dim);
}

/* Category listing page */
.category-hero {
  padding: 40px 24px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.category-hero h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.category-hero p {
  color: var(--text-secondary);
  margin-top: 6px;
}

.article-list {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 60px;
}

.article-list-item {
  display: block;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  text-decoration: none;
  transition: all 0.15s;
}

.article-list-item:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.article-list-item h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.article-list-item p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ─── Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--bg);
}

.site-footer a { color: var(--text-secondary); }

/* ─── Article navigation ─────────────────────────────────────────────── */
.article-nav {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.article-nav a {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s;
}

.article-nav a:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }

.article-nav-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.article-nav-title { font-size: 14px; font-weight: 600; color: var(--text); }

.article-nav a:last-child { text-align: right; }

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header { padding: 0 16px; }
  .header-search { display: none; }
  .header-nav .header-link:not(.header-link--primary) { display: none; }
  .mobile-menu-btn { display: block; }
  .sidebar { display: none; position: fixed; inset: 0; top: var(--header-height); z-index: 50; background: var(--bg); width: 100%; padding: 16px; }
  .sidebar.open { display: block; }
  .content { padding: 24px 16px 40px; }
  .hero { padding: 40px 16px 24px; }
  .hero h1 { font-size: 28px; }
  .categories { padding: 0 16px 40px; grid-template-columns: 1fr; }
  .article-nav { flex-direction: column; }
}
