/* ==========================================================================
   Dual-Range Slider Component
   Pure CSS, no external dependencies. Works with range_slider.js.
   ========================================================================== */

.range-slider {
  /* min-width: 0 lets the slider shrink inside flex/grid parents (e.g. the
     col-lg-3 sticky sidebar) instead of forcing its intrinsic content-width
     onto the column and overflowing it. The 10 px horizontal padding leaves
     room for the 20 px circular thumbs at the track edges. */
  padding: 0.25rem 10px;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.range-slider__label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--md-on-surface-variant);
}

/* --- Track Container --- */
.range-slider__track-container {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
}

.range-slider__track {
  position: relative;
  width: 100%;
  height: 5px;
  background: var(--md-border);
  border-radius: 3px;
}

/* Active range highlight between the two thumbs */
.range-slider__fill {
  position: absolute;
  height: 100%;
  background: var(--earthy-primary);
  border-radius: 3px;
  pointer-events: none;
}

/* --- Range Inputs (stacked on top of each other) --- */
.range-slider__input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  z-index: 2;
}

/* Make the track transparent (we draw our own) */
.range-slider__input::-webkit-slider-runnable-track {
  height: 5px;
  background: transparent;
  border: none;
}
.range-slider__input::-moz-range-track {
  height: 5px;
  background: transparent;
  border: none;
}

/* Thumb styling - Webkit */
.range-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--md-surface);
  border: 2px solid var(--earthy-primary);
  cursor: pointer;
  pointer-events: all;
  margin-top: -8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.range-slider__input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(138, 120, 105, 0.35);
}
.range-slider__input::-webkit-slider-thumb:active {
  transform: scale(1.2);
  background: var(--earthy-primary-soft);
}

/* Thumb styling - Firefox */
.range-slider__input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--md-surface);
  border: 2px solid var(--earthy-primary);
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.range-slider__input::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(138, 120, 105, 0.35);
}

/* High z-index for the "from" slider to ensure proper overlap behavior */
.range-slider__input--from {
  z-index: 3;
}

/* --- Text Inputs for Manual Entry --- */
.range-slider__inputs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.35rem;
  min-width: 0;
  max-width: 100%;
}

.range-slider__text-input {
  /* width:0 + flex-grow:1 + min-width:0 fully releases the input from its
     intrinsic ~150 px content-width so it shrinks to whatever its share of
     the flex parent is — works around browser UA stylesheet defaults that
     keep <input> at a minimum text width even with min-width:0 alone. */
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
  text-align: center;
  border: 1px solid var(--md-border);
  border-radius: 0.375rem;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}
.range-slider__text-input:focus {
  border-color: var(--earthy-primary);
  outline: 0;
  box-shadow: 0 0 0 0.15rem rgba(138, 120, 105, 0.2);
}

.range-slider__separator {
  color: var(--md-text-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.range-slider__unit {
  color: var(--md-text-muted);
  font-size: 0.8rem;
  flex-shrink: 0;
  min-width: 1.5rem;
}
