/* ============================================================================
 * docs.travel404.com — clean, readable documentation styling.
 * Color palette mirrors host-site (indigo → violet brand) but layout is
 * tuned for long-form reading: max content width, generous spacing, light
 * monospace styling for permission keys.
 * ==========================================================================*/

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --text-soft: #9ca3af;
  --primary: #6366f1;
  --primary-soft: #eef2ff;
  --accent: #8b5cf6;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --code-bg: #f3f4f6;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

code, pre, kbd, .mono {
  font-family: 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 0.88em;
}

/* ── Top navigation ───────────────────────────────────────────────────── */
.docs-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.docs-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; gap: 24px;
}
.docs-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--text); text-decoration: none;
}
.docs-brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: grid; place-items: center;
  font-weight: 900; font-size: 11px; letter-spacing: -0.02em;
}
.docs-brand-name { font-size: 15px; }
.docs-brand-tag {
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px;
  background: var(--primary-soft); color: var(--primary); margin-left: 6px;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.docs-nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.docs-nav-link {
  font-size: 14px; font-weight: 500; color: var(--text-muted);
}
.docs-nav-link:hover { color: var(--text); text-decoration: none; }
.docs-nav-link.active { color: var(--primary); font-weight: 600; }
.docs-nav-cta {
  font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff !important;
}
.docs-nav-cta:hover { text-decoration: none; background: #4f46e5; }

/* ── Page shell ────────────────────────────────────────────────────────── */
.docs-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.docs-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; gap: 24px; }
  .docs-toc { position: static !important; }
}

/* ── Sidebar TOC ───────────────────────────────────────────────────────── */
.docs-toc {
  position: sticky; top: 80px;
  font-size: 13px;
  border-left: 1px solid var(--border);
  padding-left: 16px;
}
.docs-toc-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-soft);
  margin-bottom: 10px;
}
.docs-toc ul { list-style: none; margin: 0; padding: 0; }
.docs-toc li { margin: 0; }
.docs-toc a {
  display: block; padding: 5px 0;
  color: var(--text-muted); text-decoration: none;
  border-left: 2px solid transparent; padding-left: 10px; margin-left: -12px;
  transition: color 0.15s, border-color 0.15s;
}
.docs-toc a:hover { color: var(--text); }
.docs-toc a.active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.docs-toc-count {
  font-size: 11px; color: var(--text-soft); margin-left: 6px;
  font-weight: 500;
}

/* ── Content typography ────────────────────────────────────────────────── */
.docs-content h1 {
  font-size: 32px; font-weight: 800; line-height: 1.2;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.docs-content .docs-eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--primary); background: var(--primary-soft);
  padding: 4px 10px; border-radius: 20px; margin-bottom: 14px;
}
.docs-content .docs-lead {
  font-size: 17px; color: var(--text-muted);
  margin: 0 0 32px; line-height: 1.55;
}
.docs-content h2 {
  font-size: 22px; font-weight: 700; line-height: 1.3;
  margin: 48px 0 4px;
  letter-spacing: -0.01em;
  scroll-margin-top: 80px;
}
.docs-content h2 .docs-section-count {
  font-size: 13px; font-weight: 500; color: var(--text-soft);
  margin-left: 8px;
}
.docs-content h2 + p { margin-top: 6px; color: var(--text-muted); }
.docs-content h3 { font-size: 17px; font-weight: 700; margin: 28px 0 8px; }
.docs-content p { margin: 12px 0; }
.docs-content ul, .docs-content ol { padding-left: 22px; }
.docs-content li { margin: 6px 0; }
.docs-content hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* ── Inline code ───────────────────────────────────────────────────────── */
.docs-content code:not(pre code) {
  background: var(--code-bg);
  padding: 2px 6px; border-radius: 5px;
  font-size: 0.85em; color: var(--text);
}

/* ── Permission cards ──────────────────────────────────────────────────── */
.perm-group {
  margin-top: 24px;
  padding-top: 8px;
}
.perm-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}
.perm-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.perm-card:hover { border-color: #d4d4d8; box-shadow: var(--shadow-sm); }
.perm-card-main { min-width: 0; }
.perm-card-head {
  display: flex; align-items: baseline; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.perm-label {
  font-size: 16px; font-weight: 700; color: var(--text);
  letter-spacing: -0.005em;
}
.perm-desc {
  font-size: 14.5px; color: var(--text);
  line-height: 1.6;
}
.perm-desc:empty { display: none; }
.perm-roles {
  display: flex; gap: 4px; flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  max-width: 260px;
}
.role-chip {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid transparent;
}
.role-chip.on  { background: var(--primary-soft); color: var(--primary); border-color: #c7d2fe; }
.role-chip.off { background: transparent; color: var(--text-soft); border-color: var(--border); opacity: 0.55; }

/* Loaded-state hint */
.perm-loading {
  padding: 40px 0; text-align: center; color: var(--text-muted);
  font-size: 14px;
}

/* ── Home grid ─────────────────────────────────────────────────────────── */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 32px;
}
.topic-card {
  display: block;
  padding: 22px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.topic-card.coming-soon { opacity: 0.55; pointer-events: none; }
.topic-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.topic-icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: grid; place-items: center;
  margin-bottom: 12px;
  font-size: 18px;
}
.topic-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.topic-desc { font-size: 13.5px; color: var(--text-muted); margin: 0; line-height: 1.5; }
.topic-tag {
  display: inline-block;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 7px; border-radius: 4px;
  margin-top: 12px;
  background: var(--code-bg); color: var(--text-muted);
}
.topic-tag.ready { background: #d1fae5; color: #065f46; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.docs-footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 28px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.docs-footer a { color: var(--text-muted); }

/* ── Filter bar (permissions page) ─────────────────────────────────────── */
.perm-filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 24px 0 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.perm-filters input {
  flex: 1; min-width: 200px;
  border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 6px;
  font-size: 14px; color: var(--text);
  background: #fff;
}
.perm-filters input:focus { outline: none; border-color: var(--primary); }
.perm-filters select {
  border: 1px solid var(--border);
  padding: 8px 10px; border-radius: 6px;
  font-size: 13px; color: var(--text);
  background: #fff;
}
.perm-filters .pf-label {
  font-size: 12px; color: var(--text-muted); font-weight: 600;
}
