// Copyright 2020 Energinet DataHub A/S
//
// Licensed under the Apache License, Version 2.0 (the "License2");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
watt-slider {
  display: flex;
  flex-direction: column;
  margin: var(--watt-space-m) 0;

  .controls {
    position: relative;
  }

  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: all;
    width: var(--watt-space-ml);
    height: var(--watt-space-ml);
    background-color: var(--watt-color-primary-dark);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--watt-color-primary);
    cursor: pointer;
  }

  input[type="range"]::-moz-range-thumb {
    pointer-events: all;
    width: 24px;
    height: 24px;
    background-color: var(--watt-color-primary-dark);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--watt-color-primary);
    cursor: pointer;
  }

  input[type="range"]::-webkit-slider-thumb:active {
    box-shadow:
      inset 0 0 3px var(--watt-color-primary-dark),
      0 0 9px var(--watt-color-primary-dark);
    -webkit-box-shadow:
      inset 0 0 3px var(--watt-color-primary-dark),
      0 0 9px var(--watt-color-primary-dark);
    cursor: ew-resize;
  }

  input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: var(--watt-space-s);
    top: (var(--watt-space-s) / 2);
    left: 0;
    right: 0;
    position: absolute;
    transform: translate(0, -50%);
    background-color: var(--watt-color-secondary-light);
    pointer-events: none;
    border-radius: var(--watt-space-s);
  }
}
