/*
 * slider.css - Styles for the No BS Dual Handle Range Slider.
 * Author: Phixyn
 */

.range-slider {
  position: relative;
  /* Horizontal margin creates a 14px buffer on each side so handles at
   * the 0% / 100% positions (which overflow by ~11px via translate) never
   * clip at the viewport edge. overflow: visible lets them extend into
   * the margin area without triggering a horizontal scrollbar. */
  margin: 0 14px;
  height: 44px;
  overflow: visible;
  user-select: none;
  touch-action: none;
}

.range-slider__track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--color-border-emphasis);
  border-radius: 3px;
  transform: translateY(-50%);
}

.range-slider__fill {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-link) 100%);
  border-radius: 3px;
  transition: left 0.05s ease, right 0.05s ease;
}

.range-slider__handle {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  background: var(--color-bg-elevated);
  border: 2.5px solid var(--color-link);
  border-radius: 50%;
  cursor: grab;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
  z-index: 1;
}

.range-slider__handle:hover {
  transform: translate(-50%, -50%) scale(1.2);
  border-color: var(--color-link-hover);
  box-shadow: 0 2px 10px var(--color-accent-glow);
}

.range-slider__handle:active,
.range-slider__handle.dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.3);
  border-color: var(--color-link-hover);
  box-shadow: 0 4px 14px var(--color-accent-muted);
  z-index: 2;
}

.range-slider__handle:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--color-accent-glow);
  transform: translate(-50%, -50%) scale(1.2);
}

.range-slider__handle:focus .range-slider__label {
  opacity: 1;
}

.range-slider__label {
  position: absolute;
  top: -32px;
  transform: translateX(-50%);
  background: var(--color-bg-overlay);
  color: var(--color-text);
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.range-slider__handle:hover .range-slider__label,
.range-slider__handle.dragging .range-slider__label {
  opacity: 1;
}
