.snake-slider {
  font-family: var(--font-family);
  width: 100%;
}

.snake-slider--vertical {
  height: 200px;
  width: auto;
}

.snake-slider--disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* Label */
.snake-slider__label {
  display: block;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

.snake-slider--small .snake-slider__label {
  font-size: var(--font-size-sm);
}

.snake-slider--large .snake-slider__label {
  font-size: var(--font-size-lg);
}

/* Container */
.snake-slider__container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.snake-slider--vertical .snake-slider__container {
  height: 100%;
  align-items: center;
}

/* Wrapper */
.snake-slider__wrapper {
  position: relative;
  width: 100%;
  padding: 12px 0;
}

.snake-slider--vertical .snake-slider__wrapper {
  width: auto;
  height: 100%;
  padding: 0 12px;
}

/* Track */
.snake-slider__track {
  position: relative;
  width: 100%;
  height: 6px;
  background-color: #2a2a2c;
  border: 1px solid #3a3a3a;
  cursor: pointer;
  overflow: visible;
}

.snake-slider--small .snake-slider__track {
  height: 4px;
}

.snake-slider--large .snake-slider__track {
  height: 8px;
}

.snake-slider--vertical .snake-slider__track {
  width: 6px;
  height: 100%;
}

.snake-slider--vertical.snake-slider--small .snake-slider__track {
  width: 4px;
}

.snake-slider--vertical.snake-slider--large .snake-slider__track {
  width: 8px;
}

/* Fill */
.snake-slider__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: var(--color-success);
  transition: none;
  pointer-events: none;
}

.snake-slider--vertical .snake-slider__fill {
  bottom: 0;
  top: auto;
  width: 100%;
  transition: none;
}

/* Variants */
.snake-slider--default .snake-slider__fill {
  background-color: #bdbdbd;
}

.snake-slider--success .snake-slider__fill {
  background-color: var(--color-success);
}

.snake-slider--warning .snake-slider__fill {
  background-color: var(--color-warning);
}

.snake-slider--danger .snake-slider__fill {
  background-color: var(--color-danger);
}

.snake-slider--info .snake-slider__fill {
  background-color: #61dafb;
}

/* Thumb */
.snake-slider__thumb {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  background-color: #ffffff;
  border: 2px solid #3a3a3a;
  transform: translate(-50%, -50%);
  cursor: grab;
  transition:
    transform var(--transition-fast),
    background-color var(--transition-fast),
    border-color var(--transition-fast);
  z-index: 2;
}

.snake-slider--small .snake-slider__thumb {
  width: 16px;
  height: 16px;
}

.snake-slider--large .snake-slider__thumb {
  width: 24px;
  height: 24px;
}

.snake-slider--vertical .snake-slider__thumb {
  left: 50%;
  top: auto;
  transform: translate(-50%, 50%);
}

.snake-slider__thumb:hover {
  background-color: #f0f0f0;
  border-color: #4a4a4a;
  transform: translate(-50%, -50%) scale(1.1);
}

.snake-slider--vertical .snake-slider__thumb:hover {
  transform: translate(-50%, 50%) scale(1.1);
}

.snake-slider--dragging .snake-slider__thumb {
  cursor: grabbing;
  background-color: #e0e0e0;
  transform: translate(-50%, -50%) scale(1.15);
}

.snake-slider--vertical.snake-slider--dragging .snake-slider__thumb {
  transform: translate(-50%, 50%) scale(1.15);
}

.snake-slider__thumb:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(189, 189, 189, 0.3);
}

/* Value labels */
.snake-slider__value {
  text-align: center;
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-family: var(--font-family-mono);
  padding: 4px 8px;
  background-color: #1f1d20;
  border: 1px solid #3a3a3a;
  min-width: 50px;
}

.snake-slider--small .snake-slider__value {
  font-size: var(--font-size-xs);
  padding: 2px 6px;
  min-width: 40px;
}

.snake-slider--large .snake-slider__value {
  font-size: var(--font-size-base);
  padding: 6px 10px;
  min-width: 60px;
}

/* Tooltip */
.snake-slider__tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background-color: #1f1d20;
  border: 1px solid #3a3a3a;
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-family: var(--font-family-mono);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  animation: snake-slider-tooltip-in var(--transition-fast) ease-out forwards;
}

.snake-slider--vertical .snake-slider__tooltip {
  bottom: auto;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
}

@keyframes snake-slider-tooltip-in {
  to {
    opacity: 1;
  }
}

/* Ticks */
.snake-slider__tick {
  position: absolute;
  top: 100%;
  width: 1px;
  height: 8px;
  background-color: #3a3a3a;
  transform: translateX(-50%);
  margin-top: 4px;
}

.snake-slider--vertical .snake-slider__tick {
  top: auto;
  left: 100%;
  width: 8px;
  height: 1px;
  transform: translateY(50%);
  margin-top: 0;
  margin-left: 4px;
}

.snake-slider__tick-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  font-size: var(--font-size-xs);
  color: #8e8e90;
  white-space: nowrap;
}

.snake-slider--vertical .snake-slider__tick-label {
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  margin-top: 0;
  margin-left: 4px;
}

/* Corner decorations */
.snake-slider__corner {
  position: absolute;
  width: 6px;
  height: 6px;
  border: 1px solid #3a3a3a;
  opacity: 0.6;
}

.snake-slider__corner--start-top {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.snake-slider__corner--start-bottom {
  bottom: -1px;
  left: -1px;
  border-right: none;
  border-top: none;
}

.snake-slider__corner--end-top {
  top: -1px;
  right: -1px;
  border-left: none;
  border-bottom: none;
}

.snake-slider__corner--end-bottom {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.snake-slider--vertical .snake-slider__corner--start-top,
.snake-slider--vertical .snake-slider__corner--start-bottom {
  left: auto;
  right: -1px;
}

.snake-slider--vertical .snake-slider__corner--end-top,
.snake-slider--vertical .snake-slider__corner--end-bottom {
  right: auto;
  left: -1px;
}

.snake-slider--vertical .snake-slider__corner--start-top {
  top: auto;
  bottom: -1px;
}

.snake-slider--vertical .snake-slider__corner--end-bottom {
  bottom: auto;
  top: -1px;
}

/* Hover effect */
.snake-slider:hover .snake-slider__corner {
  opacity: 1;
}

/* Focus styles */
.snake-slider__track:focus-within {
  border-color: #4a4a4a;
}
