/* ═══════════════════════════════════════════════════════════════════
   help.css — Amon Hen Help & Documentation page
   ═══════════════════════════════════════════════════════════════════ */

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

:root {
  --bg:           #0d0d0d;
  --surface:      #161616;
  --surface-2:    #1e1e1e;
  --surface-3:    #242424;
  --border:       #2a2a2a;
  --border-light: #333;
  --text:         #e8e8e8;
  --text-muted:   #8a8a8a;
  --text-faint:   #555;
  --accent:       #5b8dee;
  --accent-dim:   rgba(91, 141, 238, 0.12);
  --green:        #34c759;
  --amber:        #f5a623;
  --red:          #ff453a;
  --nav-width:    240px;
  --header-h:     90px;
  --radius:       8px;
  --radius-sm:    5px;
}

html { scroll-behavior: smooth; }

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

/* ── Header ─────────────────────────────────────────────────────── */

.help-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background-image: url("../Images/header.png");
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
}

.help-brand-link {
  text-decoration: none;
  color: inherit;
}

.help-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.help-logo {
  height: 75px;
  width: auto;
  flex-shrink: 0;
}

.help-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.help-title {
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.help-tagline {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.help-back-link {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

.help-back-link:hover { color: #fff; }

/* ── Layout ─────────────────────────────────────────────────────── */

.help-layout {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ── Left nav ────────────────────────────────────────────────────── */

.help-nav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--nav-width);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  flex-shrink: 0;
}

.help-nav-section {
  padding: 0 16px 20px;
}

.help-nav-heading {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
  padding-left: 4px;
}

.help-nav-link {
  display: block;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  line-height: 1.4;
}

.help-nav-link:hover {
  background: var(--surface-3);
  color: var(--text);
}

.help-nav-link.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ── Main content ────────────────────────────────────────────────── */

.help-main {
  margin-left: var(--nav-width);
  flex: 1;
  padding: 48px 56px 80px;
  max-width: 900px;
}

/* ── Sections ────────────────────────────────────────────────────── */

.help-section {
  padding-bottom: 60px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 60px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.help-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.help-section h1 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  line-height: 1.25;
}

.help-section h2 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  line-height: 1.3;
}

.help-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: #d0d0d0;
  margin-top: 28px;
  margin-bottom: 8px;
}

.help-section h3:first-child { margin-top: 0; }

.help-section p {
  color: var(--text);
  margin-bottom: 12px;
}

.help-section p:last-child { margin-bottom: 0; }

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

/* ── Lists ───────────────────────────────────────────────────────── */

.help-list {
  padding-left: 20px;
  margin-bottom: 12px;
}

.help-list li {
  margin-bottom: 6px;
  color: var(--text);
}

.help-list li:last-child { margin-bottom: 0; }

ol.help-list { counter-reset: none; }

/* ── Inline code ─────────────────────────────────────────────────── */

code {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Consolas, monospace;
  font-size: 12.5px;
  color: #c8d0e0;
}

/* ── Keyboard keys ───────────────────────────────────────────────── */

kbd {
  display: inline-block;
  background: var(--surface-3);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text);
  box-shadow: 0 1px 0 var(--border-light);
}

/* ── Code block ──────────────────────────────────────────────────── */

pre.help-code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Consolas, monospace;
  font-size: 12.5px;
  color: #c8d0e0;
  overflow-x: auto;
  line-height: 1.6;
  white-space: pre;
  margin-top: 16px;
}

/* ── Tips & warnings ─────────────────────────────────────────────── */

.help-tip, .help-warning {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13.5px;
  margin: 16px 0;
  line-height: 1.55;
}

.help-tip {
  background: rgba(91, 141, 238, 0.08);
  border: 1px solid rgba(91, 141, 238, 0.25);
  color: #b8ccf5;
}

.help-tip strong { color: var(--accent); }

.help-warning {
  background: rgba(255, 69, 58, 0.07);
  border: 1px solid rgba(255, 69, 58, 0.25);
  color: #f5b4b0;
}

.help-warning strong { color: var(--red); }

/* ── Examples ────────────────────────────────────────────────────── */

.help-example {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  margin: 16px 0;
  overflow: hidden;
}

.help-example-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 8px 14px;
  background: var(--accent-dim);
  border-bottom: 1px solid var(--border);
}

.help-example-body {
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.6;
}

.help-example-body p { margin-bottom: 8px; }
.help-example-body p:last-child { margin-bottom: 0; }
.help-example-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

/* ── Comparison grid ─────────────────────────────────────────────── */

.help-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 20px 0;
}

.help-comparison-card {
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid var(--border);
}

.help-comparison-card.contrast {
  background: var(--surface-2);
  border-color: var(--border);
}

.help-comparison-card.highlight {
  background: rgba(91, 141, 238, 0.06);
  border-color: rgba(91, 141, 238, 0.28);
}

.help-comparison-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.help-comparison-card.contrast .help-comparison-label {
  color: var(--text-faint);
}

.help-comparison-card.highlight .help-comparison-label {
  color: var(--accent);
}

.help-comparison-list {
  padding-left: 16px;
  margin: 0;
}

.help-comparison-list li {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 7px;
  line-height: 1.5;
}

.help-comparison-list li:last-child { margin-bottom: 0; }

.help-comparison-card.highlight .help-comparison-list li {
  color: #c0cce8;
}

@media (max-width: 720px) {
  .help-comparison-grid { grid-template-columns: 1fr; }
}

/* ── Concept cards ───────────────────────────────────────────────── */

.help-concept-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}

.help-concept-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.help-concept-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}

.help-concept-card strong {
  display: block;
  color: #fff;
  margin-bottom: 4px;
  font-size: 14px;
}

.help-concept-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Item type table ─────────────────────────────────────────────── */

.help-type-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.help-type-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.help-type-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 20px;
  margin-top: 1px;
  white-space: nowrap;
}

.type-rule     { background: rgba(91, 141, 238, 0.15); color: #7baaf7; }
.type-decision { background: rgba(245, 166, 35, 0.15); color: #f5a623; }
.type-note     { background: rgba(52, 199, 89, 0.12);  color: #50d87c; }
.type-code     { background: rgba(175, 82, 222, 0.15); color: #bf6ff0; }
.type-kpi      { background: rgba(91, 141, 238, 0.12); color: var(--accent); min-width: 120px; text-align: center; }

/* ── Reference table ─────────────────────────────────────────────── */

.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 16px 0;
}

.help-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.help-table td {
  padding: 10px 12px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  line-height: 1.55;
}

.help-table tr:last-child td { border-bottom: none; }

.help-table td:first-child {
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 12px;
  color: #c8d0e0;
  white-space: nowrap;
}

.help-table td:nth-child(2) {
  color: var(--text-faint);
  white-space: nowrap;
}

.help-table td:nth-child(3) {
  white-space: nowrap;
}

/* ── FAQ (details/summary) ───────────────────────────────────────── */

.help-faq-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.help-faq-item[open] {
  border-color: var(--border-light);
}

.help-faq-item summary {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.help-faq-item summary::after {
  content: "+";
  font-size: 18px;
  font-weight: 300;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 12px;
  transition: transform 0.2s;
}

.help-faq-item[open] summary::after {
  content: "−";
}

.help-faq-item summary::-webkit-details-marker { display: none; }

.help-faq-item p {
  padding: 0 16px 14px;
  font-size: 13.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin: 0;
  line-height: 1.6;
}

/* ── Admin badge ─────────────────────────────────────────────────── */

.help-admin-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(245, 166, 35, 0.15);
  color: var(--amber);
  border-radius: 20px;
  padding: 2px 8px;
  vertical-align: middle;
  margin-left: 8px;
}

/* ── Legend ──────────────────────────────────────────────────────── */

.help-legend {
  display: flex;
  gap: 20px;
  align-items: center;
  margin: 14px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.help-legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.help-legend-dot.rule     { background: #5b8dee; }
.help-legend-dot.decision { background: #f5a623; }
.help-legend-dot.code     { background: #af52de; }
.help-legend-dot.note     { background: #34c759; }

/* ── Links ───────────────────────────────────────────────────────── */

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Footer ──────────────────────────────────────────────────────── */

.help-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.8;
}

.help-footer a { color: var(--text-muted); }
.help-footer a:hover { color: var(--text); }

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .help-concept-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .help-nav {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .help-layout { flex-direction: column; }

  .help-main {
    margin-left: 0;
    padding: 32px 20px 60px;
  }
}
