/* Nexus Legacy Guide — Dark Theme */
:root {
  --bg-body: #0f172a;
  --bg-sidebar: #0b1120;
  --bg-card: #1e293b;
  --bg-card-alt: #162032;
  --bg-tag: #1e3a5f;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #38bdf8;
  --accent-dim: rgba(56, 189, 248, 0.15);
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --purple: #a78bfa;
  --border: #1e293b;
  --sidebar-w: 240px;
}

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
}

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

/* ── Sidebar ─────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 0 20px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}

.guide-return {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 12px;
  padding: 9px 12px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.guide-return::before {
  content: "←";
  color: var(--accent);
  font-size: 1rem;
  line-height: 1;
}

.guide-return:hover {
  border-color: rgba(56, 189, 248, 0.62);
  background: rgba(56, 189, 248, 0.15);
  text-decoration: none;
}

.guide-search {
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.guide-search-input-wrap {
  position: relative;
}

.guide-search-input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 12px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  outline: none;
}

.guide-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.14);
}

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

.guide-search-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.guide-search-clear:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.guide-search-status {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 0.76rem;
}

.guide-search-results {
  margin-top: 8px;
  display: grid;
  gap: 6px;
  max-height: 330px;
  overflow-y: auto;
}

.guide-search-result {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.58);
  text-decoration: none;
}

.guide-search-result:hover {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.1);
  text-decoration: none;
}

.guide-search-result-title {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
}

.guide-search-result-page {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.guide-search-result-snippet {
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.sidebar nav a {
  display: block;
  padding: 8px 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.sidebar nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
  text-decoration: none;
}

.sidebar nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
  font-weight: 600;
}

/* ── Main content ────────────────────── */
.content {
  margin-left: var(--sidebar-w);
  max-width: 860px;
  padding: 40px 48px 80px;
}

.content h1 {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--text);
}

.content .subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.content h2 {
  font-size: 1.4rem;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.content h3 {
  font-size: 1.1rem;
  margin: 28px 0 12px;
  color: var(--accent);
}

.content h4 {
  font-size: 0.95rem;
  margin: 20px 0 8px;
  color: var(--text);
  font-weight: 600;
}

.content p {
  margin-bottom: 14px;
  color: var(--text);
}

.content ul, .content ol {
  margin: 0 0 14px 24px;
}

.content li {
  margin-bottom: 6px;
}

/* ── Cards ───────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.card h4 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 1rem;
}

.card p { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }

/* ── Tables ──────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-card);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Tags / Badges ───────────────────── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.tag-blue { background: rgba(56,189,248,0.15); color: var(--accent); }
.tag-green { background: rgba(34,197,94,0.15); color: var(--green); }
.tag-yellow { background: rgba(245,158,11,0.15); color: var(--yellow); }
.tag-red { background: rgba(239,68,68,0.15); color: var(--red); }
.tag-purple { background: rgba(167,139,250,0.15); color: var(--purple); }

/* ── Tip / Warning boxes ─────────────── */
.tip {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.tip-info {
  background: rgba(56,189,248,0.08);
  border-left: 3px solid var(--accent);
}

.tip-warn {
  background: rgba(245,158,11,0.08);
  border-left: 3px solid var(--yellow);
}

.tip-danger {
  background: rgba(239,68,68,0.08);
  border-left: 3px solid var(--red);
}

/* ── Grid layouts ────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* ── Nav links at bottom ─────────────── */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.page-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  transition: border-color 0.15s;
}

.page-nav a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

/* ── Mobile hamburger ────────────────── */
.hamburger {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  width: 36px; height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 36px;
  text-align: center;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: block; }
  .content { margin-left: 0; padding: 60px 20px 60px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
