/* V20.37 L159/L160/L161 — Bouches VMC physiques + grilles aération fenêtre + aide CVC
 * ==========================================================================
 * Styles dédiés au panel "Bouches VMC + grilles aération" injecté dans le
 * panel "equipements" (étape 7 du parcours).
 *
 * Conventions :
 *   - Bouches insufflation : palette bleu pâle  (#a4c8e1)
 *   - Bouches extraction   : palette rouge pâle (#e1a4a4)
 *   - Bouches hygro        : palette ambrée     (#e1c5a4)
 *   - Grilles aération     : palette bleue pâle (#a8c8d8)
 *
 * S'aligne sur la grammaire visuelle des autres panels (configurator-studio.css)
 * — Montserrat 10–11px, accent #a8c8d8, bordure 1px rgba(168,200,216,0.2).
 */

/* ============================================================================
 * 1. Panel hôte (greffé dans data-studio-panel="equipements")
 * ============================================================================ */
.studio-vmc-panel {
  margin-top: 12px;
  padding: 10px;
  background: rgba(164, 200, 225, 0.05);
  border-left: 2px solid rgba(164, 200, 225, 0.4);
  border-radius: 5px;
}

.studio-vmc-panel-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a8c8d8;
  font-weight: 600;
  margin: 0 0 6px;
}

.studio-vmc-panel-hint {
  font-size: 11px;
  color: rgba(244, 240, 232, 0.65);
  margin: 0 0 8px;
  line-height: 1.35;
}

/* ============================================================================
 * 2. Accordéons <details> (Bouches / Grilles)
 * ============================================================================ */
.studio-vmc-acc {
  margin-bottom: 6px;
  border: 1px solid rgba(168, 200, 216, 0.15);
  border-radius: 5px;
  overflow: hidden;
}

.studio-vmc-acc > summary {
  list-style: none;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: rgba(244, 240, 232, 0.85);
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.studio-vmc-acc > summary::-webkit-details-marker { display: none; }
.studio-vmc-acc > summary::after {
  content: '▼';
  font-size: 9px;
  opacity: 0.6;
  transition: transform 0.2s;
}
.studio-vmc-acc[open] > summary::after { transform: rotate(180deg); }
.studio-vmc-acc > summary:hover { background: rgba(168, 200, 216, 0.1); }

/* ============================================================================
 * 3. Grille de cartes (bouches + grilles)
 * ============================================================================ */
.studio-vmc-grid {
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: rgba(0, 0, 0, 0.12);
}

.studio-vmc-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  padding: 6px 7px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(168, 200, 216, 0.18);
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  text-align: left;
  color: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.studio-vmc-card:hover {
  border-color: #a8c8d8;
  background: rgba(168, 200, 216, 0.1);
  transform: translateY(-1px);
}

.studio-vmc-card[data-active="true"] {
  border-color: #ffe066;
  background: rgba(255, 224, 102, 0.16);
  box-shadow: 0 0 0 2px rgba(255, 224, 102, 0.25);
}

.studio-vmc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 10.5px;
  color: rgba(244, 240, 232, 0.92);
  font-weight: 600;
  line-height: 1.15;
}

.studio-vmc-card-icon {
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}

.studio-vmc-card-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-vmc-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: #a8c8d8;
  font-weight: 600;
}

.studio-vmc-card-debit { color: #a4c8e1; }
.studio-vmc-card-price { color: #e1c5a4; }

/* Variante extraction (rouge pâle) */
.studio-vmc-card[data-flow="extraction"] .studio-vmc-card-debit { color: #e1a4a4; }
.studio-vmc-card[data-flow="extraction-hygro"] .studio-vmc-card-debit { color: #e1c5a4; }

/* ============================================================================
 * 4. Boutons d'action (auto / vérifier / vider)
 * ============================================================================ */
.studio-vmc-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.studio-vmc-action-btn {
  flex: 1;
  min-width: 110px;
  padding: 7px 10px;
  background: rgba(164, 200, 225, 0.16);
  border: 1px solid rgba(164, 200, 225, 0.45);
  border-radius: 5px;
  color: #a8c8d8;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.studio-vmc-action-btn:hover {
  background: rgba(164, 200, 225, 0.3);
  border-color: #a8c8d8;
}

.studio-vmc-action-btn[data-variant="ghost"] {
  background: transparent;
  border-color: rgba(244, 240, 232, 0.2);
  color: rgba(244, 240, 232, 0.7);
}

.studio-vmc-action-btn[data-variant="ghost"]:hover {
  border-color: rgba(244, 240, 232, 0.5);
  background: rgba(255, 255, 255, 0.05);
}

/* ============================================================================
 * 5. Bilan d'équilibre VMC (affiché sous les actions)
 * ============================================================================ */
.studio-vmc-balance {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(168, 200, 216, 0.12);
  border-radius: 4px;
  font-family: 'Montserrat', sans-serif;
  font-size: 10.5px;
  color: rgba(244, 240, 232, 0.75);
  line-height: 1.5;
  display: none;
}

.studio-vmc-balance[data-has-data="true"] { display: block; }

.studio-vmc-balance-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}

.studio-vmc-balance-row strong {
  color: #a8c8d8;
  font-weight: 600;
}

.studio-vmc-balance-ok {
  color: #88c098 !important;
}

.studio-vmc-balance-warn {
  color: #e1c5a4 !important;
}

.studio-vmc-balance-err {
  color: #e1a4a4 !important;
}

/* ============================================================================
 * 6. Popup tooltip CVC contextuel (L161)
 * ============================================================================ */
.studio-cvc-tooltip {
  position: fixed;
  z-index: 10000;
  min-width: 230px;
  max-width: 320px;
  padding: 10px 12px;
  background: rgba(20, 24, 32, 0.97);
  border: 1px solid rgba(168, 200, 216, 0.35);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: rgba(244, 240, 232, 0.88);
  pointer-events: none;
  line-height: 1.4;
  animation: studioCvcTipFadeIn 0.18s ease-out;
}

@keyframes studioCvcTipFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.studio-cvc-tooltip h4 {
  font-size: 11.5px;
  font-weight: 700;
  color: #a8c8d8;
  margin: 0 0 6px;
  letter-spacing: 0.04em;
}

.studio-cvc-tooltip .cvc-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px dashed rgba(168, 200, 216, 0.12);
}

.studio-cvc-tooltip .cvc-row:last-of-type {
  border-bottom: none;
}

.studio-cvc-tooltip .cvc-row span {
  color: rgba(244, 240, 232, 0.65);
}

.studio-cvc-tooltip .cvc-row strong {
  color: #a4c8e1;
  font-weight: 600;
}

.studio-cvc-tooltip .cvc-advice {
  margin: 6px 0 0;
  padding: 6px 8px;
  background: rgba(255, 224, 102, 0.1);
  border-left: 2px solid #ffe066;
  border-radius: 3px;
  font-size: 10.5px;
  font-style: italic;
  color: rgba(255, 224, 102, 0.88);
}

.studio-cvc-tooltip .cvc-reglo {
  margin: 6px 0 0;
  padding-top: 6px;
  border-top: 1px solid rgba(168, 200, 216, 0.18);
  font-size: 10px;
  color: rgba(244, 240, 232, 0.6);
}

.studio-cvc-tooltip .cvc-reglo strong {
  color: #a8c8d8;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ============================================================================
 * 7. Curseur custom + badge d'armement (mode placement)
 * ============================================================================ */
.solea-vmc-arming .konvajs-content { cursor: crosshair !important; }

.solea-vmc-arm-badge {
  position: fixed;
  top: 170px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 14px;
  background: rgba(164, 200, 225, 0.95);
  color: #0d0d10;
  border-radius: 22px;
  font: 600 12px/1 'Montserrat', sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  cursor: pointer;
  pointer-events: auto;
  animation: soleaVmcArmPulse 1.3s ease-in-out infinite;
}

@keyframes soleaVmcArmPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.75; }
}

/* ============================================================================
 * 8. Texte d'aide en pied de panel
 * ============================================================================ */
.studio-vmc-help {
  font-size: 10px;
  color: rgba(244, 240, 232, 0.55);
  margin: 6px 0 0;
  line-height: 1.4;
  font-style: italic;
}
