/* ── Luminarr Shared Styles ───────────────────────────────────────────────── */
/* Used by all doc pages. Landing page keeps inline styles for compat.       */

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
code, pre { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ── Colors ───────────────────────────────────────────────────────────────── */
:root {
  --bg-base: #0d0d12;
  --bg-surface: #13131a;
  --bg-elevated: #1c1c27;
  --bg-subtle: #252535;
  --border-subtle: rgba(255,255,255,0.08);
  --border-default: rgba(255,255,255,0.13);
  --border-strong: rgba(255,255,255,0.27);
  --accent: #7c6af7;
  --accent-hover: #9283f9;
  --accent-glow: rgba(124,106,247,0.15);
  --text-primary: #f0f0f5;
  --text-secondary: #9898b0;
  --text-muted: #5a5a72;
  --green: #34d399;
  --red: #f87171;
  --blue: #3b9eff;
  --amber: #fbbf24;
  --nav-bg: rgba(13,13,18,0.8);
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ──────────────────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}
nav .nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links .gh-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: border-color 0.2s, background 0.2s;
}
.nav-links .gh-link:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}
.nav-links .gh-link svg { width: 18px; height: 18px; }

/* ── Docs dropdown ────────────────────────────────────────────────────────── */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-trigger {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
  background: none;
  border: none;
  font-family: inherit;
}
.nav-dropdown-trigger:hover { color: var(--text-primary); }
.nav-dropdown-trigger svg { width: 14px; height: 14px; }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  transform: translateX(-50%) translateY(-4px);
}
/* Invisible bridge to cover the gap between trigger and menu */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown-menu a:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}
.nav-dropdown-menu .dd-desc {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-left {
  font-size: 14px;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text-primary); }

/* ── Doc page layout ──────────────────────────────────────────────────────── */
.doc-page {
  padding-top: 120px;
  padding-bottom: 80px;
  min-height: calc(100vh - 100px);
}
.doc-page h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 16px;
}
.doc-page h1 .gradient {
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 50%, var(--blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-desc {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 56px;
}

/* ── Content sections ─────────────────────────────────────────────────────── */
.content-section {
  margin-bottom: 64px;
}
.content-section:last-child {
  margin-bottom: 0;
}
.section-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 12px;
}
.content-section h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  line-height: 1.2;
}
.content-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 32px;
  color: var(--text-primary);
}
.content-section p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  max-width: 760px;
}
.content-section ul, .content-section ol {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  padding-left: 24px;
  max-width: 760px;
}
.content-section li {
  margin-bottom: 8px;
}

/* ── Code blocks ──────────────────────────────────────────────────────────── */
.code-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  max-width: 760px;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}
.code-block-filename {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}
.code-block-body {
  padding: 18px;
  overflow-x: auto;
}
.code-block-body pre {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
}
/* Syntax classes */
.syn-key { color: var(--blue); }
.syn-val { color: var(--green); }
.syn-str { color: var(--green); }
.syn-comment { color: var(--text-muted); font-style: italic; }
.syn-type { color: var(--accent); }
.syn-fn { color: var(--amber); }
.syn-kw { color: var(--red); }
.syn-num { color: var(--amber); }

/* Inline code */
.doc-page code {
  font-size: 13px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.code-block code, .code-block-body code {
  padding: 0;
  border: none;
  background: none;
  border-radius: 0;
}

/* ── Info cards / feature cards ───────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
  max-width: 760px;
}
.card-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.info-card {
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  transition: border-color 0.2s;
}
.info-card:hover {
  border-color: var(--border-default);
}
.info-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0;
}
.info-card .card-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.info-card .card-icon.green { color: var(--green); }
.info-card .card-icon.accent { color: var(--accent); }
.info-card .card-icon.blue { color: var(--blue); }
.info-card .card-icon.red { color: var(--red); }
.info-card .card-icon.amber { color: var(--amber); }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.doc-table {
  width: 100%;
  max-width: 760px;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-default);
  margin-bottom: 24px;
}
.doc-table th,
.doc-table td {
  padding: 14px 18px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.doc-table thead th {
  background: var(--bg-elevated);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}
.doc-table tbody tr {
  background: var(--bg-base);
}
.doc-table tbody tr:nth-child(even) {
  background: var(--bg-surface);
}
.doc-table tbody tr:last-child td {
  border-bottom: none;
}
.doc-table td:first-child {
  font-weight: 500;
  color: var(--text-primary);
}
.doc-table td {
  color: var(--text-secondary);
}
.doc-table code {
  font-size: 12px;
}

/* ── Architecture diagram ─────────────────────────────────────────────────── */
.arch-diagram {
  max-width: 760px;
  margin-bottom: 32px;
}
.arch-layer {
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 8px;
  background: var(--bg-surface);
}
.arch-layer:last-child {
  margin-bottom: 0;
}
.arch-layer-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.arch-layer-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.arch-chip {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.arch-chip.accent { border-color: rgba(124,106,247,0.3); color: var(--accent); }
.arch-chip.green { border-color: rgba(52,211,153,0.3); color: var(--green); }
.arch-chip.blue { border-color: rgba(59,158,255,0.3); color: var(--blue); }
.arch-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  color: var(--text-muted);
  font-size: 18px;
}

/* ── Flow diagram ─────────────────────────────────────────────────────────── */
.flow {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  margin-bottom: 24px;
  max-width: 760px;
}
.flow-step {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  white-space: nowrap;
}
.flow-arrow {
  color: var(--text-muted);
  padding: 0 8px;
  font-size: 16px;
}

/* ── Alert / callout boxes ────────────────────────────────────────────────── */
.callout {
  padding: 16px 20px;
  border-radius: 10px;
  border-left: 3px solid;
  margin-bottom: 24px;
  max-width: 760px;
}
.callout p { margin-bottom: 0; }
.callout.info {
  background: rgba(59,158,255,0.06);
  border-color: var(--blue);
}
.callout.warn {
  background: rgba(251,191,36,0.06);
  border-color: var(--amber);
}
.callout.success {
  background: rgba(52,211,153,0.06);
  border-color: var(--green);
}
.callout.danger {
  background: rgba(248,113,113,0.06);
  border-color: var(--red);
}
.callout strong {
  color: var(--text-primary);
}

/* ── Step list (numbered) ─────────────────────────────────────────────────── */
.step-list {
  list-style: none;
  padding: 0;
  margin-bottom: 24px;
  max-width: 760px;
}
.step-list li {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.step-list .step-content {
  padding-top: 4px;
}
.step-list .step-content p {
  margin-bottom: 4px;
}
.step-list .step-content strong {
  color: var(--text-primary);
}

/* ── Badge / tag ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
}
.badge.green {
  background: rgba(52,211,153,0.12);
  color: var(--green);
}
.badge.red {
  background: rgba(248,113,113,0.12);
  color: var(--red);
}
.badge.blue {
  background: rgba(59,158,255,0.12);
  color: var(--blue);
}
.badge.accent {
  background: var(--accent-glow);
  color: var(--accent);
}

/* ── Animations ───────────────────────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Theme toggle button ──────────────────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 7px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
}
.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.theme-toggle svg { width: 16px; height: 16px; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

/* ── Light mode ───────────────────────────────────────────────────────────── */
[data-theme="light"] {
    --bg-base: #ffffff;
    --bg-surface: #f5f5f8;
    --bg-elevated: #eaeaf0;
    --bg-subtle: #dddde5;
    --border-subtle: rgba(0,0,0,0.06);
    --border-default: rgba(0,0,0,0.12);
    --border-strong: rgba(0,0,0,0.25);
    --accent: #6c5ce7;
    --accent-hover: #5b4bd6;
    --accent-glow: rgba(108,92,231,0.1);
    --text-primary: #1a1a2e;
    --text-secondary: #555570;
    --text-muted: #8888a0;
    --green: #059669;
    --red: #dc2626;
    --blue: #2563eb;
    --amber: #d97706;
    --nav-bg: rgba(255,255,255,0.8);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .card-grid { grid-template-columns: 1fr; }
  .card-grid.cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .doc-page { padding-top: 96px; padding-bottom: 48px; }
  .card-grid.cols-3 { grid-template-columns: 1fr; }
  .nav-links a:not(.gh-link) { display: none; }
  .nav-dropdown { display: none; }
  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  .flow { flex-direction: column; align-items: stretch; }
  .flow-arrow { transform: rotate(90deg); text-align: center; padding: 4px 0; }
  .doc-table { font-size: 13px; }
  .doc-table th, .doc-table td { padding: 10px 12px; }
}
