/* styles.css — dark theme, table-heavy, monospace. Aged Cookie Detection Lab. */

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #c9d1d9;
  --muted: #8b949e;
  --blue: #58a6ff;
  --green: #3fb950;
  --red: #f85149;
  --yellow: #d29922;
  --orange: #db6d28;
}

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

body {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

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

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

header a { color: var(--blue); font-weight: bold; }

main { padding: 1.5rem; max-width: 1400px; }

h1 { font-size: 1.3rem; color: var(--blue); margin-bottom: 1rem; }
h2 { font-size: 1rem; color: var(--blue); margin: 1.5rem 0 0.5rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--border); }
h3 { font-size: 0.9rem; color: var(--muted); margin: 1rem 0 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ─── Tables ─────────────────────────────────────────────────── */

table { width: 100%; border-collapse: collapse; margin-top: 0.4rem; font-size: 12px; }
th, td { text-align: left; padding: 0.3rem 0.6rem; border: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface); color: var(--muted); font-weight: normal; white-space: nowrap; }
tbody tr:nth-child(even) { background: rgba(22, 27, 34, 0.5); }
tbody tr:hover { background: rgba(88, 166, 255, 0.05); }

.meta-table th { width: 180px; }
.sig-name { color: var(--muted); white-space: nowrap; width: 240px; }
.sig-val { word-break: break-all; }

/* ─── Badges ─────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-weight: bold;
  font-size: 11px;
  white-space: nowrap;
}
.badge-pass { background: #1a7f37; color: #fff; }
.badge-warn { background: #9e6a03; color: #fff; }
.badge-fail { background: #b62324; color: #fff; }
.badge-muted { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.badge-dc { background: #9e6a03; color: #fff; }

/* ─── Rule row highlight ─────────────────────────────────────── */

.row-pass td:first-child { border-left: 3px solid var(--green); }
.row-warn td:first-child { border-left: 3px solid var(--yellow); }
.row-fail td:first-child { border-left: 3px solid var(--red); }

/* ─── Code / pre ─────────────────────────────────────────────── */

code { background: var(--surface); padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 12px; }
pre { background: var(--surface); padding: 0.8rem; border-radius: 4px; overflow-x: auto; font-size: 11px; border: 1px solid var(--border); }
pre.json-val { max-height: 200px; padding: 0.4rem; }

/* ─── Details / collapsible ──────────────────────────────────── */

details { margin-top: 1.5rem; }
summary { cursor: pointer; color: var(--blue); padding: 0.4rem 0; user-select: none; }
details pre { margin-top: 0.5rem; max-height: 600px; }

/* ─── Headless gauge ─────────────────────────────────────────── */

.gauge-wrap { display: flex; align-items: center; gap: 0.6rem; }
.gauge { height: 8px; flex: 1; max-width: 160px; background: var(--border); border-radius: 4px; overflow: hidden; }
.gauge-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.gauge-fill.low { background: var(--green); }
.gauge-fill.mid { background: var(--yellow); }
.gauge-fill.high { background: var(--red); }

/* ─── Compare diff ───────────────────────────────────────────── */

.diff-changed { background: #3b2e00; }
.diff-only-a { background: #3d1c1c; }
.diff-only-b { background: #1a3320; }

/* ─── Misc ───────────────────────────────────────────────────── */

.null { color: var(--muted); font-style: italic; }
.bool-true { color: var(--green); }
.bool-false { color: var(--red); }
.error-badge { background: var(--red); color: #fff; padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 11px; margin-left: 0.5rem; }
.error-msg { color: var(--red); padding: 0.3rem 0; }
.parse-error { color: var(--red); border: 1px solid var(--red); padding: 0.8rem; border-radius: 4px; margin: 1rem 0; }
.muted { color: var(--muted); font-style: italic; }
.lies-list { margin: 0.3rem 0 0 1rem; font-size: 12px; }
.lies-list li { margin-bottom: 0.2rem; }
small { font-size: 11px; }

/* ─── History filter form ────────────────────────────────────── */

.filter-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1rem; }
.filter-form label { color: var(--muted); }
.filter-form input, .filter-form select {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  padding: 0.25rem 0.5rem; border-radius: 3px; font-family: inherit; font-size: 12px;
}
.filter-form button {
  background: var(--blue); color: #0d1117; border: none; padding: 0.3rem 0.8rem;
  border-radius: 3px; cursor: pointer; font-weight: bold; font-size: 12px;
}

/* ─── Compare columns ────────────────────────────────────────── */

.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .compare-grid { grid-template-columns: 1fr; } }

.compare-col { border: 1px solid var(--border); border-radius: 4px; padding: 1rem; }
.compare-col h2 { margin-top: 0; }

/* ─── Chart container ────────────────────────────────────────── */

.chart-container { margin: 1rem 0; height: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 0.5rem; }
