@import 'core/main_dependencies';

/* The switch - the box around the slider */

.bb-toggle-switch {
  position: relative;
  display: inline-block;
  width: 100px;
  height: 30px;
  margin: 0 5px;
  cursor: pointer;
  border: solid 1px #ccc;
  border-radius: 4px;
  vertical-align: middle;
  /* Hide default HTML checkbox */
  input.toggler {
    display: none;
  }
  /* The slider */
  .slider,
  .ats-switch.switch-primary span.switch-left {
    position: absolute;
    cursor: pointer;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    transition: .4s;
    border-radius: 4px;
    background: $brand-primary;
    .slide-no,
    .slide-checked {
      margin: 5px 10px 0;
      float: left;
      color: #0a0a0a;
    }
    .slide-checked {
      color: #fff;
      margin-left: 15px;
    }
    .slide-no {
      float: right;
      margin-right: 10px;
    }
  }
  .slider:before {
    position: absolute;
    content: "";
    height: 28px;
    width: 50px;
    right: 0px;
    bottom: 0px;
    background: #fff;
    transition: .4s;
    border-radius: 4px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
  input:checked+.slider {
    background-color: #eee;
  }
  input:checked+.slider:before {
    transform: translateX(-48px);
    border-radius: 4px;
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
  }
}


@mixin switch-variant($background-left, $text-color-left, $background-right, $text-color-right) {
  span.switch-left {
    background: $background-left;
    color: $text-color-left;
  }
  span.switch-right {
    background: $background-right;
    color: $text-color-right;
  }
}

div.switch-primary.ats-switch {
  @include switch-variant($brand-primary, #fff, $gray-lighter, $gray-base);
}

div.switch-success.ats-switch {
  @include switch-variant($brand-success, #fff, $gray-lighter, $gray-base);
}

div.switch-info.ats-switch {
  @include switch-variant($brand-info, #fff, $gray-lighter, $gray-base);
}

div.switch-warning.ats-switch {
  @include switch-variant($brand-warning, #fff, $gray-lighter, $gray-base);
}

div.switch-danger.ats-switch {
  @include switch-variant($brand-danger, #fff, $gray-lighter, $gray-base);
}
