/* ── Linux Troubleshooting Runbook — stylesheet ── */

:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --border:    #30363d;
  --accent:    #58a6ff;
  --green:     #3fb950;
  --yellow:    #d29922;
  --red:       #f85149;
  --purple:    #bc8cff;
  --text:      #e6edf3;
  --muted:     #8b949e;
  --code-bg:   #1e2a38;
  --tag-bg:    #1f2d3d;
}

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

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

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

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

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  font-size: 20px;
}

.sidebar-logo h1 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.sidebar-logo span {
  font-size: 11px;
  color: var(--muted);
  display: block;
}

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

.sidebar-search input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.sidebar-search input:focus { border-color: var(--accent); }
.sidebar-search input::placeholder { color: var(--muted); }

.nav-section { padding: 8px 0; border-bottom: 1px solid var(--border); }

.nav-section-label {
  padding: 6px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.04); }

.nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(88,166,255,0.07);
}

.nav-item .nav-icon { font-size: 13px; width: 16px; text-align: center; }
.nav-item .nav-count {
  margin-left: auto;
  background: var(--tag-bg);
  color: var(--muted);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
}

.content {
  flex: 1;
  padding: 36px 48px;
  max-width: 900px;
  overflow-x: hidden;
}

/* ── Page sections ───────────────────────────────── */

.page { display: none; }
.page.active { display: block; }

.page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.page-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.page-header p { color: var(--muted); font-size: 14px; }

/* ── Scenario cards ──────────────────────────────── */

.scenario {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}

.scenario-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}

.scenario-header:hover { background: rgba(255,255,255,0.03); }

.scenario-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--tag-bg);
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 2px;
  white-space: nowrap;
}

.scenario-meta { flex: 1; }

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

.scenario-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.tag-sev-high   { background: rgba(248,81,73,0.15);  color: var(--red);    border: 1px solid rgba(248,81,73,0.3); }
.tag-sev-med    { background: rgba(210,153,34,0.15); color: var(--yellow); border: 1px solid rgba(210,153,34,0.3); }
.tag-sev-low    { background: rgba(63,185,80,0.15);  color: var(--green);  border: 1px solid rgba(63,185,80,0.3); }
.tag-category   { background: var(--tag-bg); color: var(--muted); border: 1px solid var(--border); }

.scenario-chevron {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  transition: transform 0.2s;
}

.scenario.open .scenario-chevron { transform: rotate(90deg); }

.scenario-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
}

.scenario.open .scenario-body { display: block; }

.scenario-body h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 16px 0 8px;
}

.scenario-body p {
  color: var(--text);
  font-size: 14px;
  margin-bottom: 8px;
}

/* ── Code blocks ─────────────────────────────────── */

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 8px 0;
  position: relative;
}

pre code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--text);
  background: none;
  line-height: 1.65;
}

.cmd-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.step-list { list-style: none; counter-reset: steps; }

.step-list li {
  counter-increment: steps;
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 14px;
}

.step-list li::before {
  content: counter(steps);
  background: var(--accent);
  color: var(--bg);
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
  flex-shrink: 0;
}

.step-list li div { flex: 1; }

/* ── One-liners table ────────────────────────────── */

.oneliners-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 28px;
}

.oneliners-table th {
  background: var(--surface);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--border);
}

.oneliners-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}

.oneliners-table tr:hover td { background: rgba(255,255,255,0.02); }

.oneliners-table td:first-child { color: var(--muted); font-size: 12px; width: 180px; }

.oneliners-table code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  color: var(--green);
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  word-break: break-all;
}

/* ── Common mistakes ─────────────────────────────── */

.mistake-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
  border-left: 3px solid var(--red);
}

.mistake-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mistake-title::before { content: "✗"; color: var(--red); }

.fix-card {
  background: rgba(63,185,80,0.06);
  border: 1px solid rgba(63,185,80,0.2);
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 13px;
}

.fix-card strong { color: var(--green); }

/* ── Home page ───────────────────────────────────── */

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.home-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.home-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.home-card .card-icon { font-size: 28px; margin-bottom: 10px; }
.home-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.home-card p { font-size: 12px; color: var(--muted); }

.stats-row {
  display: flex;
  gap: 20px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 20px;
  flex: 1;
  min-width: 120px;
  text-align: center;
}

.stat .num { font-size: 28px; font-weight: 700; color: var(--accent); }
.stat .label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Search highlight ────────────────────────────── */

mark { background: rgba(210,153,34,0.35); color: var(--text); border-radius: 2px; }

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

@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { padding: 20px; }
}

/* ── Scrollbar ───────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
