@import '../base/variables';

.AknSwitch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;

  &-input {
    display: none;

    &:checked + .AknSwitch-slider {
      background-color: @AknGreen;
    }

    &:focus + .AknSwitch-slider {
      box-shadow: 0 0 1px @AknGreen;
    }

    &:checked + .AknSwitch-slider:before {
      -webkit-transform: translateX(26px);
      -ms-transform: translateX(26px);
      transform: translateX(26px);
    }
  }

  &-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: lighten(@AknSlateGrey, 20%);
    -webkit-transition: 0.4s;
    transition: 0.4s;
    border-radius: 34px;

    &:before {
      position: absolute;
      content: '';
      height: 32px;
      width: 32px;
      left: 1px;
      bottom: 1px;
      background-color: white;
      -webkit-transition: 0.4s;
      transition: 0.4s;
      border-radius: 50%;
    }
  }

  &--disabled {

    .AknSwitch-input {
      &:checked + .AknSwitch-slider {
        background-color: lighten(@AknGreen, 20%);
      }
    }


    .AknSwitch-slider {
      background-color: lighten(@AknSlateGrey, 40%);
      cursor: not-allowed;
    }
  }
}
