/* ============================================================
   ABSTRICT · Features v4 CSS
   Design polish, PCIe lanes, Workload profiles, Wattage donut,
   Perf/€, X3D badge, Future-proofing, PSU ATX warning, ST/MT bias
   ============================================================ */

/* === Design polish === */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
body { background: var(--bg); }
.sidebar {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}
.card {
  transition: transform 200ms var(--ease-out),
              box-shadow 200ms var(--ease),
              border-color 150ms var(--ease);
  will-change: transform;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
/* Tier stripe on left edge of cards */
.card[data-tier="budget"]      { border-left: 3px solid var(--success); }
.card[data-tier="mid"]         { border-left: 3px solid var(--teal); }
.card[data-tier="high"]        { border-left: 3px solid var(--accent); }
.card[data-tier="enthusiast"]  { border-left: 3px solid var(--danger); }

/* General fade transitions for elements that depend on STATE */
.perf-card, .stress-card, .tier-row, .lib-card,
.workload-card, .wattage-segment-legend {
  transition: opacity 200ms var(--ease);
}

/* === PCIe lane diagram === */
.pcie-wrap {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}
.pcie-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; color: var(--text-secondary);
  margin-bottom: 6px; font-family: var(--mono);
}
.pcie-head strong { color: var(--text); font-weight: 600; }
.pcie-track {
  display: flex; height: 14px;
  border-radius: 3px; overflow: hidden;
  background: var(--border-subtle);
}
.pcie-seg {
  height: 100%;
  transition: width 600ms var(--ease);
}
.pcie-seg.gpu     { background: var(--accent); }
.pcie-seg.m2-1    { background: var(--success); }
.pcie-seg.m2-2    { background: var(--teal); }
.pcie-seg.m2-3    { background: var(--warning); }
.pcie-seg.thunderbolt { background: var(--danger); }
.pcie-seg.free    { background: var(--border); }
.pcie-legend {
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  margin-top: 6px;
  font-family: var(--mono); font-size: 9px; color: var(--text-muted);
}
.pcie-legend span { display: inline-flex; align-items: center; gap: 3px; }
.pcie-legend i {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 2px;
}
.pcie-warn {
  margin-top: 6px;
  font-size: 10px; color: var(--warning);
  font-family: var(--mono);
}

/* === Workload profile grid === */
.workload-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.workload-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.workload-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  transition: border-color 150ms var(--ease);
}
.workload-card:hover { border-color: var(--text-muted); }
.workload-head {
  display: flex; justify-content: space-between; align-items: baseline;
}
.workload-name { font-size: 12px; font-weight: 600; }
.workload-cat {
  font-family: var(--mono); font-size: 9px;
  padding: 2px 6px; border-radius: 99px;
  background: var(--bg-alt); color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .4px;
}
.workload-value {
  font-family: var(--mono); font-size: 16px; font-weight: 600;
  color: var(--accent); margin-top: 4px;
}
.workload-unit { font-size: 11px; color: var(--text-muted); margin-left: 4px; font-weight: 400; }
.workload-bar {
  height: 5px; background: var(--bg-alt);
  border-radius: 3px; overflow: hidden; margin-top: 8px;
}
.workload-bar-fill {
  height: 100%; background: var(--accent);
  transition: width 700ms var(--ease);
}
.workload-hint { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* === Wattage donut === */
.wattage-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.wattage-block {
  display: flex; align-items: center; gap: 24px;
  padding: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}
.wattage-donut {
  flex-shrink: 0; width: 100px; height: 100px;
  position: relative;
}
.wattage-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.wattage-donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--mono);
}
.wattage-total { font-size: 18px; font-weight: 600; color: var(--text); }
.wattage-total-unit { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.wattage-legend {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px 18px; flex: 1; min-width: 200px;
}
.wattage-legend-row {
  display: grid; grid-template-columns: 14px 1fr auto auto;
  gap: 8px; align-items: center;
  font-family: var(--mono); font-size: 11px;
}
.wattage-legend-swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
}
.wattage-legend-name { color: var(--text-secondary); }
.wattage-legend-watt { color: var(--text); }

/* === Value rating (perf/€) === */
.total-row.value { padding-top: 4px; }
.value-rating {
  font-family: var(--mono); font-size: 10px;
  padding: 1px 6px; border-radius: 3px;
  margin-left: auto;
}
.value-rating.high   { background: rgba(34,197,94,.12); color: var(--success); }
.value-rating.mid    { background: rgba(245,158,11,.12); color: var(--warning); }
.value-rating.low    { background: rgba(239,68,68,.12); color: var(--danger); }

/* === X3D badge + CPU cache chip === */
.badge-x3d {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px;
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  background: rgba(245,158,11,.15); color: #c2410c;
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 99px;
  margin-left: 4px;
  vertical-align: 1px;
}
body.dark .badge-x3d { color: #fdba74; background: rgba(245,158,11,.18); }
.badge-x3d svg { flex-shrink: 0; }
.tech-chip-cache[data-active="1"] {
  opacity: 1 !important;
  border-color: var(--border) !important;
}

/* === Future-proofing ring === */
.future-index {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
}
.future-ring {
  flex-shrink: 0;
  width: 44px; height: 44px;
  position: relative;
}
.future-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.future-ring-num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--text);
}
.future-info { flex: 1; min-width: 0; }
.future-label { font-size: 11px; font-weight: 500; }
.future-hint { font-size: 10px; color: var(--text-muted); margin-top: 2px; line-height: 1.3; }

/* === PSU ATX 3.0 / 12VHPWR warning chip === */
.psu-warn-chip {
  display: flex; align-items: flex-start; gap: 6px;
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.18);
  border-radius: var(--radius);
  font-size: 10px;
  line-height: 1.35;
  color: var(--warning);
}
.psu-warn-chip svg { flex-shrink: 0; margin-top: 1px; }
.psu-atx-tag {
  display: inline-block;
  font-family: var(--mono); font-size: 9px;
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg-alt); color: var(--text-secondary);
  margin-left: 4px;
}
.psu-atx-tag[data-ok="1"] { background: rgba(34,197,94,.12); color: var(--success); }

/* === ST/MT bias bar === */
.bias-bar {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 6px;
}
.bias-bar-row {
  display: grid; grid-template-columns: 28px 1fr 36px;
  gap: 6px; align-items: center;
  font-family: var(--mono); font-size: 9px;
}
.bias-bar-label { color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.bias-bar-track {
  height: 6px; background: var(--bg-alt);
  border-radius: 3px; overflow: hidden;
}
.bias-bar-fill { height: 100%; border-radius: 3px; transition: width 600ms var(--ease); }
.bias-bar-fill.st { background: var(--accent); }
.bias-bar-fill.mt { background: var(--teal); }
.bias-bar-val { text-align: right; color: var(--text); font-weight: 600; }
