/* ══════════════════════════════════════════════════
   daemmung.css — Seitenspezifische Styles
   Dämmung Wirtschaftlichkeitsrechner
   ══════════════════════════════════════════════════ */

/* ── Bauteil-Auswahl (graphisch, multi-select) ── */
.component-select-always {
  margin: 4px 0 12px;
}

.component-select-label {
  display: block;
  margin-bottom: 8px;
}

.component-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.component-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 8px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--card, rgba(255, 255, 255, 0.55));
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
  text-align: center;
}

@media (hover: hover) {
  .component-card:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
  }
}

.component-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.component-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 2px 6px rgba(var(--brand-primary-rgb) / 0.12);
}

.component-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.component-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

.component-card.active .component-label {
  color: var(--accent);
}

.component-sub {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.component-check {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s;
}

.component-card.active .component-check {
  opacity: 1;
  transform: scale(1);
}

.hint-inline {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85em;
}

/* ── Per-Bauteil parameter blocks ── */
.component-params-list {
  margin-top: 16px;
}

.component-params {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px 16px;
  margin-bottom: 16px;
  background: var(--accent-soft);
}

.component-params:last-child {
  margin-bottom: 0;
}

.component-params-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}

.component-params-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  flex-shrink: 0;
  color: var(--accent);
  overflow: hidden;
}

.component-params-icon svg {
  display: block;
  width: 32px;
  height: 32px;
  max-width: 100%;
  max-height: 100%;
}

.component-params-name {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.component-params-remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.component-params-remove:hover,
.component-params-remove:focus-visible {
  color: var(--accent);
  border-color: var(--border-strong);
  background: var(--card, rgba(255, 255, 255, 0.4));
  outline: none;
}

.component-params .slider {
  margin-bottom: 10px;
}

.component-params .slider:last-child {
  margin-bottom: 0;
}

/* ── KPI Grid ── */
.hero-kpi {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

/* ── Detail KPI Grid ── */
.detail-kpi {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

/* ── Chart Legend Dots ── */
.dot.a { background: var(--accent); }
.dot.b { background: var(--accent-2); }
.dot.c { background: var(--legend-dot); }

/* ── Select styling ── */
select {
  font-size: 0.95rem;
  accent-color: var(--accent);
}

/* ── Collapsible sections ── */
.section-block {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: rgba(255,255,255,0.45);
}

.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
  padding: 0;
  border: none;
}

.section-block.collapsed .section-body { display: none; }
.section-block:not(.collapsed) .section-summary,
.section-block:not(.collapsed) .section-footer { display: none; }

.section-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

.section-summary strong {
  color: var(--ink);
  font-weight: 600;
}

.section-footer {
  margin-top: 8px;
  text-align: right;
}

/* .expand-btn / .collapse-btn — siehe shared.css */

/* ── Direct-edit number inputs ── */
.value-input {
  width: 72px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
  font-size: inherit;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 1px 4px;
  background: transparent;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}

.value-input::-webkit-inner-spin-button,
.value-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.value-input:hover { border-color: var(--border-strong); }

.value-input:focus {
  border-color: var(--accent);
  outline: none;
  background: #fff;
}

/* ── Computed value display ── */
.computed-value {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(var(--brand-primary-rgb) / 0.06);
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 6px;
  color: var(--muted);
}
.computed-value span {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-kpi { grid-template-columns: repeat(3, 1fr); }
  .detail-kpi { grid-template-columns: repeat(2, 1fr); }
  .component-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .hero-kpi { grid-template-columns: 1fr; }
  .hero-charts { grid-template-columns: 1fr; }
  .detail-kpi { grid-template-columns: 1fr; }
  .component-grid { grid-template-columns: repeat(2, 1fr); }
  .component-card { padding: 10px 6px; }
  .component-icon { width: 40px; height: 40px; }
  .component-label { font-size: 0.85rem; }
  .component-sub { display: none; }
}
/* ── Dark-Mode-Overrides ── */
[data-theme="dark"] .component-card { background: var(--surface-translucent); }
[data-theme="dark"] .section-block { background: var(--surface-translucent); }
[data-theme="dark"] .value-input { background: var(--surface); }
