@use "00-base/configure" as *;

$margin: 20px;
%transition {
  transition-duration: 0.2s;
}

.ma__input-slider {
  left: 13px;
  margin-left: $margin;
  margin-right: $margin;

  .ma__slider {
    &-rail {
     background-color: $c-gray-light;
     position: absolute;
    }
    &-track {
      background-color: $c-primary-lighter;
      position: absolute;
      z-index: 1;
      cursor: pointer;
    }
    &-handle {
      border: 1px solid $c-white;
      width: 26px;
      height: 26px;
      box-shadow: 0 2px 4px 0 rgba(0,0,0,0.5);
      background-color: $c-primary;
      color: transparent;
      position: absolute;
      cursor: pointer;
      border-radius: 50%;
      z-index: 2;
      transition-property: all;
      @extend %transition;

      &:hover {
        transform: scale(1.1);
      }

      &:focus {
        outline: none;
        box-shadow: 0 0 2px 2px $c-focus;
      }

      &-value {
        font-size: $fonts-smaller;
        margin: -30px auto 0;
        position: absolute;
         left: 0;
        color: $c-primary;
        font-weight: 500;
      }
    }
  }

  &--disabled {
    opacity: 0.5;
    .ma__slider {
      &-track {
        background-color: $c-gray;
        cursor: not-allowed;
      }
      &-handle {
        background-color: $c-gray-dark;
        cursor: not-allowed;
        opacity: 1;
        &:hover {
          transform: none;
        }

        &-value {
          color: $c-black;
        }
      }
    }
  }

  &-x {
    height: 120px;
    width: calc(100% - #{$margin*2});
    .ma__slider {
      position: relative;
      width: 100%;
      height: 80px;
      &-rail {
        width: 100%;
        height: 10px;
        margin-top: 35px;
      }
      &-handle {
        margin-left: -15px;
        margin-top: 25px;
        text-align: center;
      }
      &-track {
        height: 10px;
        margin-top: 35px;
        transition-property: width;
        @extend %transition;
      }
      &-tick {
        position: absolute;
        font-size: 0.75em;

        &--top {
          margin-top: 52px;
          margin-left: -0.5px;
          width: 1px;
          height: 8px;
          background-color: $c-gray-light;
        }
        &--bottom {
          margin-top: 60px;
          font-size: 0.8em;
          text-align: center;
        }
      }
    }
  }
  &-y {
    height: 520px;
    width: calc(100% - #{$margin*2});
    .ma__slider {
      position: relative;
      height: 400px;
      margin-left: 45%;
      &-rail {
        width: 14px;
        height: 100%;
        cursor: pointer;
        margin-left: -1px;
      }
      &-handle {
        margin-left: -6px;
        margin-top: -12px;
      }
      &-track {
        width: 14px;
        margin-left: -1px;
        transition-property: height;
        @extend %transition;
      }
      &-tick {
        position: absolute;
        font-size: 0.75em;

        &--top {
          margin-top: -0.5px;
          margin-left: 10px;
          height: 1px;
          width: 6px;
          background-color: $c-gray-light;
        }
        &--bottom {
         margin-top: -5px;
         margin-left: 20px;
        }
      }
    }
  }
}
