/* devtoken.tools — header-analyser page styles (builds on style.css) */

/* ── Grade display ── */
.grade-panel {
  display: none;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.grade-panel.visible { display: flex; }

.grade-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 36px;
  font-weight: 700;
  flex-shrink: 0;
  border: 3px solid;
}

.grade-A  { background: rgba(34,197,94,0.12);  border-color: #22c55e; color: #22c55e; }
.grade-B  { background: rgba(132,204,22,0.12); border-color: #84cc16; color: #84cc16; }
.grade-C  { background: rgba(234,179,8,0.12);  border-color: #eab308; color: #eab308; }
.grade-D  { background: rgba(249,115,22,0.12); border-color: #f97316; color: #f97316; }
.grade-F  { background: rgba(239,68,68,0.12);  border-color: #ef4444; color: #ef4444; }

.grade-meta {
  flex: 1;
}

.grade-title {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.grade-summary {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.grade-score-bar {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
  max-width: 300px;
}

.grade-score-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.grade-breakdown {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.grade-breakdown-item {
  font-family: var(--mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.grade-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Parsed headers table ── */
.headers-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 13px;
}

.headers-table tr:hover td { background: var(--bg3); }

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

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

.hdr-name {
  color: var(--payload);
  font-weight: 600;
  white-space: nowrap;
  width: 240px;
  padding-right: 16px;
}

.hdr-value {
  color: var(--text);
  word-break: break-all;
  line-height: 1.6;
}

.hdr-value.long { font-size: 12px; }

/* ── Findings list ── */
.findings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.finding {
  display: flex;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid transparent;
}

.finding.pass    { border-color: rgba(34,197,94,0.2); }
.finding.warn    { border-color: rgba(245,158,11,0.2); }
.finding.fail    { border-color: rgba(239,68,68,0.2); }
.finding.info    { border-color: rgba(14,165,233,0.15); }
.finding.missing { border-color: rgba(249,115,22,0.2); }

.finding-strip {
  width: 4px;
  flex-shrink: 0;
}

.finding.pass    .finding-strip { background: var(--ok); }
.finding.warn    .finding-strip { background: var(--warn); }
.finding.fail    .finding-strip { background: var(--danger); }
.finding.info    .finding-strip { background: var(--payload); }
.finding.missing .finding-strip { background: var(--sig); }

.finding-body {
  flex: 1;
  padding: 11px 14px;
  background: var(--bg2);
}

.finding-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.finding-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.finding-hdr-name {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--border2);
  border-radius: 3px;
  padding: 1px 7px;
  white-space: nowrap;
}

.finding-detail {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.finding-value {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  background: var(--bg3);
  border-radius: 3px;
  padding: 4px 8px;
  margin-top: 6px;
  word-break: break-all;
  display: block;
}

.finding-rec {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  margin-top: 6px;
  display: block;
  line-height: 1.5;
}

/* ── Status line display ── */
.status-line-panel {
  display: none;
  font-family: var(--mono);
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--bg3);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.status-line-panel.visible { display: flex; }

.status-code {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
}

.status-1xx { background: #0c1a2e; color: #7dd3fc; }
.status-2xx { background: #14532d; color: #86efac; }
.status-3xx { background: #2e1065; color: #c4b5fd; }
.status-4xx { background: #451a03; color: #fcd34d; }
.status-5xx { background: #450a0a; color: #fca5a5; }

.status-text { color: var(--muted); font-size: 13px; }

/* ── Empty / idle ── */
#results { display: none; }
#results.visible { display: block; }

@media (max-width: 600px) {
  .grade-panel { flex-direction: column; }
  .hdr-name { width: auto; display: block; margin-bottom: 3px; }
  .headers-table td { display: block; padding: 6px 10px; }
  .headers-table td.hdr-name { border-bottom: none; padding-bottom: 0; }
}

/* Replaces inline styles from the old page */
.grade-dot-pass { background: #22c55e; }
.grade-dot-warn { background: #f59e0b; }
.grade-dot-fail { background: #ef4444; }
.finding-detail-lines { white-space: pre-line; }

/* v2: hub panel and per-finding tool links */
.hub-list { margin: 0 0 10px; padding: 0; }
.hub-list a { height: 100%; background: var(--bg3); }
.finding-tool {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 13px;
}
#status-code-badge[hidden] { display: none; }
