/* ═══════════════════════════════════════════════════
   CalcUK — Shared Calculator Component Styles
   Precision Utility Design System
   ═══════════════════════════════════════════════════ */

/* ── Animated bar transitions ── */
.pay-bar {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Row fade-in animation ── */
.band-row {
  animation: fadeUp 0.3s ease-out both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Custom range sliders ── */
.precision-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 9999px;
  background: #e6e8ea;
  outline: none;
  cursor: pointer;
  margin-top: 4px;
}
.precision-slider::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 9999px;
  background: linear-gradient(
    to right,
    #3755c3 var(--fill, 0%),
    #e6e8ea var(--fill, 0%)
  );
}
.precision-slider::-moz-range-track {
  height: 5px;
  border-radius: 9999px;
  background: #e6e8ea;
}
.precision-slider::-moz-range-progress {
  height: 5px;
  border-radius: 9999px;
  background: #3755c3;
}
.precision-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #3755c3;
  box-shadow: 0 2px 8px rgba(0,17,61,0.12);
  margin-top: -7px;
  cursor: grab;
  transition: box-shadow 0.2s, transform 0.15s;
}
.precision-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #3755c3;
  box-shadow: 0 2px 8px rgba(0,17,61,0.12);
  cursor: grab;
  transition: box-shadow 0.2s, transform 0.15s;
}
.precision-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 2px 16px rgba(55,85,195,0.3);
  transform: scale(1.1);
}
.precision-slider::-moz-range-thumb:hover {
  box-shadow: 0 2px 16px rgba(55,85,195,0.3);
  transform: scale(1.1);
}
.precision-slider::-webkit-slider-thumb:active { cursor: grabbing; }
.precision-slider::-moz-range-thumb:active { cursor: grabbing; }

/* ═══════════════════════════════════════════════════
   MOBILE CALCULATOR OPTIMISATIONS
   ═══════════════════════════════════════════════════ */

/* ── Bigger slider thumb on touch devices ── */
@media (pointer: coarse) {
  .precision-slider::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    margin-top: -10px;
  }
  .precision-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }
  .precision-slider {
    height: 6px;
  }
  .precision-slider::-webkit-slider-runnable-track {
    height: 6px;
  }
  .precision-slider::-moz-range-track {
    height: 6px;
  }
  .precision-slider::-moz-range-progress {
    height: 6px;
  }
}

/* ── Result card mobile ── */
@media (max-width: 640px) {
  /* Ensure result card text doesn't overflow */
  [id$="Pay"], [id$="Litres"], [id$="Value"], [id="takeHomePay"],
  [id="monthlyPay"], [id="totalSDLT"], [id="dailyLitres"] {
    font-size: 1.75rem !important;
    word-break: break-word;
  }
  /* Stack breakdown panels on narrow screens */
  .bg-white\/10 {
    min-width: 0;
  }
}

/* ── Tables scroll on mobile ── */
@media (max-width: 640px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  thead, tbody, tr {
    display: table;
    width: 100%;
    table-layout: fixed;
  }
}

/* ── Prevent horizontal overflow ── */
*, *::before, *::after {
  box-sizing: border-box;
}
img, svg, video {
  max-width: 100%;
  height: auto;
}
