/* aftester UI stylesheet — Plan 2 Task 16 scaffold.
 *
 * Palette tokens are verbatim from spec §6 (the "Palette tokens (CSS
 * variables)" block). Layout/components below cover the three-column
 * shell, the corner-glow indicator, and base component primitives
 * (card, button, table). All visual rules live here; the no-style=
 * grep test in Task 23 enforces that templates carry no inline styles.
 */

:root {
  --bg: #0b0f0e;       --panel: #0e1b18;    --panel-2: #122520;
  --border: #1f3a32;   --mint: #7cf2c2;     --mint-dim: #39d896;
  --red: #ff6b6b;      --yellow: #ffd166;   --orange: #ff9b54;
  --text: #e8f5ef;     --text-dim: #8aa39a; --text-faint: #5d7670;
}

/* --- Reset-ish base --------------------------------------------------- */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

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

h1, h2, h3, h4 { color: var(--text); margin: 0 0 0.75rem 0; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

code, pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
}

pre {
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 0.75rem;
  overflow-x: auto;
  border-radius: 6px;
}

/* --- Three-column shell ---------------------------------------------- */

.aftester-shell {
  display: grid;
  grid-template-columns: 220px 1fr 320px;
  grid-template-rows: 100vh;
  width: 100%;
}

.aftester-sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
}

.aftester-main {
  background: var(--bg);
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

.aftester-right {
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
}

.aftester-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.aftester-nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--text-dim);
}

.aftester-nav-link:hover {
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.aftester-heading { color: var(--text); }
.aftester-text-dim { color: var(--text-dim); }
.aftester-text-faint { color: var(--text-faint); }

/* --- Corner-glow status indicator ------------------------------------ */
/*
 * Glow sits in the top-right corner and changes hue with the body's
 * data-platform-status attribute. Rules per spec §6:
 *   healthy -> mint;  warning -> yellow/orange;  alert -> red.
 */

.aftester-corner-glow {
  position: fixed;
  top: -80px;
  right: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
  opacity: 0.55;
  transition: background-color 0.25s ease-in-out, opacity 0.25s ease-in-out;
  z-index: 0;
}

body[data-platform-status="healthy"] .aftester-corner-glow {
  background: var(--mint);
}

body[data-platform-status="warning"] .aftester-corner-glow {
  background: var(--yellow);
}

body[data-platform-status="alert"] .aftester-corner-glow {
  background: var(--red);
  opacity: 0.7;
}

/* --- Component primitives -------------------------------------------- */

.aftester-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.aftester-card-strong {
  background: var(--panel-2);
}

.aftester-button {
  display: inline-block;
  background: var(--mint);
  color: var(--bg);
  border: 1px solid var(--mint);
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.aftester-button:hover {
  background: var(--mint-dim);
  border-color: var(--mint-dim);
  text-decoration: none;
}

.aftester-button-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.aftester-button-danger {
  background: var(--red);
  border-color: var(--red);
  color: var(--bg);
}

.aftester-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.aftester-table th,
.aftester-table td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.aftester-table th {
  background: var(--panel-2);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

/* --- Severity / status pills ----------------------------------------- */

.aftester-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
}

.aftester-pill-critical { background: var(--red);    color: var(--bg); border-color: var(--red); }
.aftester-pill-high     { background: var(--orange); color: var(--bg); border-color: var(--orange); }
.aftester-pill-med      { background: var(--yellow); color: var(--bg); border-color: var(--yellow); }
.aftester-pill-low      { background: var(--mint);   color: var(--bg); border-color: var(--mint); }

/* --- Reports list / detail (Task 20) --------------------------------- */

.aftester-filter-card {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 1rem;
}

.aftester-filter-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.aftester-reports-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.aftester-report-row {
  border-left: 4px solid var(--border);
}

.aftester-report-row-critical { border-left-color: var(--red); }
.aftester-report-row-high     { border-left-color: var(--orange); }
.aftester-report-row-med      { border-left-color: var(--yellow); }
.aftester-report-row-medium   { border-left-color: var(--yellow); }
.aftester-report-row-low      { border-left-color: var(--mint); }

.aftester-report-row-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.aftester-report-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.aftester-report-link:hover { text-decoration: underline; }

.aftester-report-row-meta {
  margin-top: 0.4rem;
  font-size: 0.9rem;
}

.aftester-report-detail-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.aftester-report-body pre {
  background: var(--panel-2);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  overflow-x: auto;
}
