/*
 * Nieuw ontwerp voor de RC calculator.
 * Deze stijlen zorgen voor een responsieve lay‑out met drie kolommen, kaarten en
 * een duidelijke uitlegsectie. De kleuren zijn gebaseerd op de algemene
 * Build Wise huisstijl (primair blauw, lichtblauw en grijstinten). Pas
 * variabelen in bw-core.css aan voor andere kleuren indien nodig.
 */

.bw-rc-page {
  margin: 20px auto;
  max-width: 1200px;
  padding: 0 16px;
}

/* Tabs voor RC vs Project */
.bw-rc-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.bw-rc-tabs button {
  background: #e5e7eb;
  border: none;
  color: var(--bw-text);
  padding: 8px 20px;
  border-radius: var(--bw-radius-button);
  cursor: pointer;
  font-size: 14px;
  transition: background-color .2s ease;
}
.bw-rc-tabs button.active {
  background: var(--bw-primary);
  color: #fff;
}

/* Inhoud per tab */
.bw-tab-content {
  display: none;
}
.bw-tab-content.active {
  display: block;
}

/* Top row met drie kolommen */
.bw-rc-top-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
/* In de nieuwe indeling bevat de bovenste rij drie kaders (lagen, doorsnede, grafiek) */
.bw-wall-layers {
  flex: 1 1 calc(33.333% - 20px);
}
.bw-wall-section {
  flex: 1 1 calc(33.333% - 20px);
}
.bw-vapour-graph {
  flex: 1 1 calc(33.333% - 20px);
}

/* Kader 4 (Resultaten) beslaat volle breedte */
.bw-results-full {
  margin-top: 20px;
  flex: 1 1 100%;
}

/* Kaart lay‑out */
.bw-card {
  background: var(--bw-card-bg);
  border: 1px solid var(--bw-border);
  border-radius: var(--bw-radius-card);
  padding: 20px;
  box-shadow: var(--bw-card-shadow);
  flex: 1 1 calc(33.333% - 20px);
  display: flex;
  flex-direction: column;
}
.bw-card:hover {
  box-shadow: var(--bw-card-shadow-hover);
}

.bw-card h2 {
  margin: 0 0 16px 0;
  font-size: 20px;
  font-weight: 600;
}

/* Wandlagen kaart */
.bw-wall-layers .layers-container {
  margin-bottom: 12px;
}
.bw-wall-layers .layer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  border-left: 6px solid transparent;
  padding-left: 4px;
  border-radius: var(--bw-radius-input);
  background: #f9fafb;
}

/* Vertical layout voor lagen bij dak/vloer: stapel items onder elkaar */
.vertical-layers .layer-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 8px;
}
.vertical-layers .layer-row select,
.vertical-layers .layer-row input[type="number"] {
  width: 100%;
}
.vertical-layers .layer-row .unit-label {
  display: none;
}
.vertical-layers .layer-row .move-up,
.vertical-layers .layer-row .move-down,
.vertical-layers .layer-row .delete-layer {
  font-size: 14px;
  padding: 2px;
}

.bw-wall-layers .layer-row .index-badge {
  width: 24px;
  text-align: center;
  font-weight: 600;
}
.bw-wall-layers .layer-row select {
  flex: 1 1 auto;
}
.bw-wall-layers .layer-row input[type="number"] {
  width: 70px;
}
.bw-wall-layers .layer-row .unit-label {
  margin-left: 4px;
}
.bw-wall-layers .layer-row .move-up,
.bw-wall-layers .layer-row .move-down,
.bw-wall-layers .layer-row .delete-layer {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s ease;
}
.bw-wall-layers .layer-row .move-up,
.bw-wall-layers .layer-row .move-down {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s ease;
}
.bw-wall-layers .layer-row .move-up img,
.bw-wall-layers .layer-row .move-down img,
.bw-wall-layers .layer-row .delete-layer img {
  width: 16px;
  height: 16px;
}

/* Drag handle styling */
.bw-wall-layers .layer-row .drag-handle {
  display: inline-flex;
  align-items: center;
  cursor: grab;
  padding: 0 4px;
}
.bw-wall-layers .layer-row .drag-handle img {
  width: 16px;
  height: 16px;
}
.bw-wall-layers .layer-row .drag-handle:active {
  cursor: grabbing;
}
.bw-wall-layers .layer-row .move-up:hover,
.bw-wall-layers .layer-row .move-down:hover,
.bw-wall-layers .layer-row .delete-layer:hover {
  color: var(--bw-primary-hover);
}
.bw-wall-layers .actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Klimaatvelden binnen de wandlagen kaart */
.bw-wall-layers .climate-inputs {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Binnen/Buiten labels boven lagen en doorsnede */
.bw-inside-outside,
.bw-inside-outside-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--bw-muted);
}
.bw-inside-outside span,
.bw-inside-outside-section span {
  flex: 1 1 50%;
  text-align: center;
}
.bw-inside-label {
  text-align: left;
}
.bw-outside-label {
  text-align: right;
}
.bw-wall-layers .climate-inputs label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}
.bw-wall-layers .climate-inputs input[type="number"] {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--bw-border);
  border-radius: 4px;
}
/* Constructietype pill knoppen */
.bw-construct-types {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.bw-pill {
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  background: #e5e7eb;
  color: var(--bw-text);
  border: none;
  cursor: pointer;
  transition: background-color .2s ease;
}
.bw-pill.active {
  background: var(--bw-primary);
  color: #fff;
}

/* Materiaal zoekveld */
.bw-material-search {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.bw-material-search input[type="text"] {
  flex: 1 1 auto;
  padding: 8px 12px;
  border: 1px solid var(--bw-border);
  border-radius: var(--bw-radius-input);
  font-size: 14px;
}
.bw-button-icon {
  padding: 8px 12px;
  font-size: 18px;
  line-height: 18px;
}

/* Wanddoorsnede kaart */
/* Doorsnede kaart nieuwe layout */
.bw-wall-section .bw-section-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* Verticale doorsnede oriëntatie voor dak/vloer */
.vertical-section {
  flex-direction: column;
  align-items: center;
}
.vertical-section .bw-section-icon {
  flex-direction: row;
  width: auto;
  justify-content: center;
  margin-bottom: 4px;
}
.vertical-section .bw-section-area {
  width: 80px;
  height: 200px;
  margin: 4px 0;
}
.vertical-section #bw-section-svg {
  width: 100%;
  height: 100%;
}
.bw-wall-section .bw-section-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 48px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--bw-muted);
}
.bw-wall-section .bw-section-icon img {
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
}
.bw-wall-section .bw-section-area {
  flex: 1 1 auto;
}
.bw-wall-section #bw-section-svg {
  width: 100%;
  height: 120px;
  border: 1px solid var(--bw-border);
  border-radius: var(--bw-radius-input);
  background: #fafafa;
}
.bw-wall-section .total-thickness {
  text-align: center;
  font-weight: 600;
  margin-top: 8px;
}

/* Resultaten kaart */
/* Resultaten kaart */
.bw-results .bw-result-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.bw-result-card {
  flex: 1 1 50%;
  background: #F9FAFB;
  border-radius: var(--bw-radius-input);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.bw-result-card .bw-result-value {
  font-size: 32px;
  font-weight: 700;
}
.bw-result-card .bw-result-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--bw-muted);
}
.bw-result-card .bw-result-status {
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
}

/* Status kleuren voor resultaatkaarten */
.status-red {
  background-color: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.2);
}
.status-orange {
  background-color: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.2);
}
.status-green {
  background-color: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.2);
}
.bw-results .bw-rc-requirement {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--bw-muted);
  font-style: italic;
}
.bw-results .sc-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 12px;
}
.bw-results .sc-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
.bw-results .sc-help {
  font-size: 11px;
  color: var(--bw-muted);
  margin-left: 4px;
}
.bw-results .chart-container {
  margin-top: 12px;
}
/* Gebruik SVG voor de grafiek in plaats van canvas */
.bw-results .chart-container svg {
  width: 100%;
  height: 260px;
  display: block;
}
.bw-results .export-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.bw-results .export-buttons button {
  flex: 1 1 auto;
}

/* Uitleg kaart */
.bw-explanation {
  margin-top: 20px;
  background: #ffffff;
  border: 1px solid var(--bw-border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.bw-explanation h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
}
.bw-explanation-content {
  max-height: none;
  overflow: auto;
}
.bw-explanation-footer {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.bw-explanation-footer button {
  flex: 1 1 auto;
}