/* ============================================================
   ABSTRICT · Features v7 CSS
   Thermal est., Noise dB, Upgrade suggestion, Build naming,
   Subtotals, Export PDF, Similar alternatives, Price min/max
   ============================================================ */

/* === Thermal estimation === */
.thermal-section {
  margin-top: 12px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.thermal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.thermal-title { font-size: 12px; font-weight: 600; }
.thermal-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.thermal-card {
  padding: 8px 10px;
  background: var(--bg-alt); border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}
.thermal-card-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.thermal-card-value {
  font-family: var(--mono); font-size: 20px; font-weight: 700;
  margin-top: 2px;
}
.thermal-card-value.cool { color: var(--success); }
.thermal-card-value.warm { color: var(--warning); }
.thermal-card-value.hot { color: var(--danger); }
.thermal-card-bar {
  height: 4px; background: var(--border-subtle);
  border-radius: 2px; overflow: hidden; margin-top: 4px;
}
.thermal-card-bar-fill {
  height: 100%; border-radius: 2px;
  transition: width 600ms var(--ease);
}
.thermal-card-bar-fill.cool { background: var(--success); }
.thermal-card-bar-fill.warm { background: var(--warning); }
.thermal-card-bar-fill.hot { background: var(--danger); }
.thermal-card-hint {
  font-size: 9px; color: var(--text-muted); margin-top: 3px;
  font-family: var(--mono);
}

/* === Noise estimation === */
.noise-section {
  margin-top: 12px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.noise-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.noise-title { font-size: 12px; font-weight: 600; }
.noise-value {
  font-family: var(--mono); font-size: 20px; font-weight: 700;
}
.noise-value.silent { color: var(--success); }
.noise-value.quiet { color: var(--teal); }
.noise-value.moderate { color: var(--warning); }
.noise-value.loud { color: var(--danger); }
.noise-bar {
  height: 8px; background: var(--border-subtle);
  border-radius: 4px; overflow: hidden;
}
.noise-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 600ms var(--ease);
}
.noise-bar-fill.silent { background: var(--success); }
.noise-bar-fill.quiet { background: var(--teal); }
.noise-bar-fill.moderate { background: var(--warning); }
.noise-bar-fill.loud { background: var(--danger); }
.noise-scale {
  display: flex; justify-content: space-between;
  margin-top: 3px;
  font-family: var(--mono); font-size: 8px; color: var(--text-muted);
}
.noise-detail {
  font-size: 10px; color: var(--text-secondary); margin-top: 6px;
  line-height: 1.4;
}

/* === Upgrade suggestion === */
.upgrade-sug {
  margin-top: 12px; padding: 10px 12px;
  background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(16,185,129,.06));
  border: 1px solid rgba(99,102,241,.15);
  border-radius: var(--radius-lg);
}
.upgrade-sug-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--accent);
  margin-bottom: 6px;
}
.upgrade-sug-body {
  display: flex; gap: 10px; align-items: center;
}
.upgrade-sug-from {
  flex: 1; padding: 8px 10px;
  background: var(--bg-alt); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); font-size: 11px;
}
.upgrade-sug-from .name { font-weight: 600; color: var(--text); }
.upgrade-sug-from .detail { font-size: 9px; color: var(--text-muted); margin-top: 2px; }
.upgrade-sug-arrow {
  font-size: 16px; color: var(--accent); flex-shrink: 0;
}
.upgrade-sug-to {
  flex: 1; padding: 8px 10px;
  background: rgba(99,102,241,.06); border: 1px solid rgba(99,102,241,.2);
  border-radius: var(--radius); font-size: 11px;
}
.upgrade-sug-to .name { font-weight: 600; color: var(--accent); }
.upgrade-sug-to .detail { font-size: 9px; color: var(--text-muted); margin-top: 2px; }
.upgrade-sug-gain {
  margin-top: 6px; font-family: var(--mono); font-size: 10px;
  display: flex; gap: 12px;
}
.upgrade-sug-gain .perf { color: var(--success); font-weight: 600; }
.upgrade-sug-gain .price { color: var(--warning); }
.upgrade-sug-apply {
  margin-top: 6px;
}
.upgrade-sug-apply button {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  padding: 4px 10px; border-radius: 3px;
  background: var(--accent); color: #fff;
  border: none; cursor: pointer;
}

/* === Build naming === */
.build-name-wrap {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px;
}
.build-name-input {
  flex: 1; padding: 4px 8px;
  background: var(--bg-alt); border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  font-family: var(--mono); font-size: 11px;
  color: var(--text);
}
.build-name-input:focus { border-color: var(--accent); outline: none; }
.build-name-input::placeholder { color: var(--text-muted); }

/* === Subtotals by category === */
.subtotals {
  margin-top: 6px; padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}
.subtotal-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2px 0;
  font-family: var(--mono); font-size: 10px;
}
.subtotal-row .cat { color: var(--text-muted); }
.subtotal-row .val { color: var(--text-secondary); font-weight: 500; }
.subtotal-row.empty .cat,
.subtotal-row.empty .val { color: var(--text-muted); opacity: .5; }

/* === Similar alternatives overlay === */
.similar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: modalIn 200ms var(--ease-spring);
}
.similar-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  max-width: 500px; width: 90vw; max-height: 70vh;
  overflow: auto; box-shadow: var(--shadow-lg);
}
.similar-card h3 {
  margin: 0 0 10px; font-size: 14px; font-weight: 600;
}
.similar-list { display: flex; flex-direction: column; gap: 6px; }
.similar-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px;
  background: var(--bg-alt); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); cursor: pointer;
  transition: all 150ms var(--ease);
}
.similar-item:hover { border-color: var(--accent); background: var(--surface); }
.similar-item .si-name { font-size: 11px; font-weight: 600; color: var(--text); }
.similar-item .si-meta { font-size: 9px; color: var(--text-muted); margin-top: 2px; }
.similar-item .si-price {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--accent);
}
.similar-empty { text-align: center; padding: 16px; color: var(--text-muted); font-size: 11px; }

/* === Price min/max in tracker === */
.price-track-minmax {
  display: flex; gap: 10px; margin-top: 4px;
  font-family: var(--mono); font-size: 9px;
}
.price-track-minmax .min { color: var(--success); }
.price-track-minmax .max { color: var(--danger); }

/* === Mobile overrides === */
@media (max-width: 768px) {
  .thermal-grid { grid-template-columns: 1fr; }
  .upgrade-sug-body { flex-direction: column; }
  .upgrade-sug-arrow { transform: rotate(90deg); }
}
