/* =========================================================
   Heat Loss Calculator — Full CSS
   ========================================================= */

/* Layout wrappers */
.inputs-and-house-wrapper {
  display: flex;
  column-gap: 5rem;
  justify-content: space-between;
}

.inputs {
  flex-grow: 1;
}

/* Input group (sq ft suffix) */
.input-group {
  display: flex;
  column-gap: 0.5rem;
}
.input-group-append {
  display: flex;
  align-items: center;
}

/* Primary CTA */
.estimate-button {
  color: #fff;
  border: none;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border-radius: 5px;
  background: #0074c8;
  cursor: pointer;
}

/* ---- Headings / intro ---- */
.heatloss-calculator h2 {
  color: #0072ce;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.heatloss-calculator p {
  color: #333;
  margin-bottom: 1.25rem;
  max-width: 720px;
}

/* ---- Two-column layout ---- */
.inputs-and-house-wrapper {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 32px;
}
@media (max-width: 992px) {
  .inputs-and-house-wrapper {
    grid-template-columns: 1fr;
  }
}

/* Number input */
.heatloss-calculator .form-group .form-control[type='number'] {
  height: 36px;
  text-align: center;
  font-size: 13.5px;
  line-height: 1;
  background: #fff;
  border: 1px solid #a5a5a5;
  border-radius: 5px;
}
.heatloss-calculator input[type='number'] {
  max-width: 160px;
  text-align: right;
}
label {
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 31px;
}

/* ---- Sliders ---- */
.heatloss-calculator .form-group {
  margin-bottom: 22px;
}
.heatloss-calculator input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 15px;
  border-radius: 58px;
  background: #ddd;
  outline: none;
  margin: 10px 0 15px;
}
.heatloss-calculator input[type='range']::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: transparent;
}
.heatloss-calculator input[type='range']::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: #ddd;
}
.heatloss-calculator input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: #fff no-repeat center;
  background-size: 40px;
  margin-top: -15px;
}
.heatloss-calculator input[type='range']::-moz-range-thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: #fff;
}
#windSlider::-webkit-slider-thumb {
  background-image: url('https://takecharge.tgt90.com/wp-content/misc/wind.svg');
}
#tempSlider::-webkit-slider-thumb {
  background-image: url('https://takecharge.tgt90.com/wp-content/misc/temperature.svg');
}
.slider-value {
  color: #0072ce;
  font-weight: 600;
}
.reset-link {
  color: #0072ce;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.875rem;
}
.reset-link:hover {
  text-decoration: underline;
}

/* =========================================================
   House, State Stack, Hotspots, Tooltip, Pill
   ========================================================= */

.house-hotspots-results {
  position: relative;
  display: flex;
  flex-direction: column;
}
/* House wrapper must be the positioning context */
.house-wrapper {
  position: relative;
  isolation: isolate;         /* new stacking context so our z-indexes behave */
  display: block;             /* avoid flex quirks for absolutely positioned children */
}

/* Base image defines the size of the wrapper */
#houseImage {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;                 /* base layer */
}

/* State stack sits ON TOP of the base */
#stateStack {
  position: absolute;
  inset: 0;                   /* fill the wrapper */
  z-index: 5;                 /* higher than #houseImage */
  pointer-events: none;
}

/* Each state (we fade the <picture> itself) */
#stateStack .house-state {
  position: absolute;
  inset: 0;                   /* pin to all four edges of the wrapper */
  display: block;
  width: 100%;
  height: 100%;               /* give it a box so the inner raster can size */
  opacity: 0;
  transition: opacity 500ms ease;
  will-change: opacity;
}

/* visible state */
#stateStack .house-state.is-visible { opacity: 1; }

/* Inner raster fills the state box */
#stateStack .house-state img,
#stateStack .house-state source {
  width: 100%;
  height: 100%;
  object-fit: contain;        /* use 'fill' if overlays match base pixel-for-pixel */
}

/* JS toggles this to snap to 0 without animating */
#stateStack .house-state.no-trans { transition: none !important; }
/* ---------------------------------------------------------
   Hotspot pins: blurred green (default) → blurred white (active)
   --------------------------------------------------------- */

/* Tunables */
.heatloss-calculator {
  --pin-size: 26px;
  --pin-border: 2px;
  --pin-blur: 1px;
  --pin-green: #90b940;
  --pin-white-alpha: 0.64;
  --pin-green-alpha: 0.64;
}

.hotspot {
  position: absolute;
  z-index: 11;
  width: var(--pin-size);
  height: var(--pin-size);
  border-radius: 50%;
  border: var(--pin-border) solid white;
  background: transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    border-color 0.12s ease;
}
.hotspot:hover {
  transform: scale(1.04);
}
.hotspot::after {
  content: none !important;
}
.hotspot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  -webkit-backdrop-filter: blur(var(--pin-blur));
  backdrop-filter: blur(var(--pin-blur));
  background: rgba(144, 185, 64, var(--pin-green-alpha));
  transition: background 0.15s ease, transform 0.12s ease;
}
.hotspot.active::before {
  background: rgba(255, 255, 255, var(--pin-white-alpha));
}

@supports not (backdrop-filter: blur(1px)) {
  .hotspot::before {
    background: radial-gradient(
      circle at 50% 50%,
      rgba(144, 185, 64, var(--pin-green-alpha)) 0 70%,
      rgba(144, 185, 64, 0) 100%
    );
  }
  .hotspot.active::before {
    background: radial-gradient(
      circle at 50% 50%,
      rgba(255, 255, 255, var(--pin-white-alpha)) 0 70%,
      rgba(255, 255, 255, 0) 100%
    );
  }
}

/* ---------------------------------------------------------
   Tooltip bubble (edge-aware caret)
   --------------------------------------------------------- */
.hotspot-tooltip {
  position: absolute;
  z-index: 11;
  background: #fff;
  color: #0072ce;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  padding: 8px 10px;
  border-radius: 6px;
  transition: opacity 0.12s ease, transform 0.12s ease;
  opacity: 1;
  pointer-events: none;
  max-width: 260px;
  white-space: nowrap;
}
.hotspot-tooltip.hidden {
  opacity: 0;
  transform: translateY(-4px);
  display: block;
  visibility: hidden;
}
.hotspot-tooltip::after {
  content: '';
  position: absolute;
  left: var(--caret-left, 50%);
  transform: translateX(-50%);
  bottom: -8px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #fff;
}
.hotspot-tooltip.is-bottom::after {
  top: -8px;
  bottom: auto;
  border-top: none;
  border-bottom: 8px solid #fff;
}

/* ---------------------------------------------------------
   Result pill
   --------------------------------------------------------- */
.heatloss-badge {
  z-index: 10;
  color: #333;
  margin-top: 1rem;
  flex-shrink: 1;
  align-self: flex-end;
  font-weight: 500;
  font-size: 15px;
}
#heatLossBadgeAmount {
  font-size: 20px;
  font-weight: 700;
  color: #0074c8;
}

/* Helpers */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hidden {
  display: none !important;
}

/* ---------------------------------------------------------
   Info card
   --------------------------------------------------------- */
.info-card {
  background: #fff;
  border: 2px solid #90b940;
  border-radius: 5px;
  padding: 14px 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-top: 1rem;
}
.info-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.info-card__header h5 {
  color: #1d78d6;
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
}
.info-card__close {
  background: transparent;
  border: none;
  color: #1d78d6;
  font-size: 20px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
}
.info-card__close:hover {
  background: rgba(29, 120, 214, 0.1);
}
.info-card__body ul { margin: .5rem 0 .25rem 1rem; }
.info-card__body li { margin: .125rem 0; }
/* Default hint */
.info-hint {
  display: flex;
  align-self: flex-end;
  color: #0074C8;
  font-size: 13.5px;
  font-weight: 700;
  background: #fff;
  border: 2px solid #90b940;
  border-radius: 5px;
  padding: 14px 16px;
  margin-top: 1rem;
}
