@import "../../../style/values";

:host {
  &.mini {
    .customSwitch {
      transform: scale(0.8);
    }
  }

  .customSwitch {
    position: relative;
    display: inline-block;
    width: 65px !important;
    height: 30px;
    border-radius: 15px;
    background: #dcdcdc;
    border: 1px solid #dcdcdc;
    box-shadow: 0 0 5px #dcdcdc;
    overflow: hidden;
    vertical-align: middle !important;
    cursor: pointer;
    margin-bottom: 0 !important;

    &.disabled {
      pointer-events: none;
      opacity: 0.5;
    }

    input {
      visibility: hidden;
    }
    i {
      position: absolute;
      top: 0;
      left: 0;
      display: inline-block;
      width: 100%;
      height: 100%;
      border-radius: 100%;
      background: #fff;
      transition: transform 300ms;
    }
    i::before {
      content: " ";
      width: 100%;
      height: 100%;
      display: block;
      background: #dcdcdc;
      transition: background 300ms;
    }
    i::after {
      content: " ";
      position: absolute;
      left: 0;
      top: 0;
      z-index: 2;
      display: inline-block;
      width: 28px;
      height: 100%;
      border-radius: 100%;
      background: #fff;
      transition: transform 300ms;
    }
    input:checked + i:after {
      transform: translateX(35px);
    }
    input:checked + i:before {
      background: @default-color;
    }
    input:checked + i {
      span {
        right: 0;
        left: 0;
        color: #fff;
      }
    }
    span {
      color: #999;
      position: absolute;
      right: 0;
      top: 0;
      line-height: 28px;
      font-style: normal;
      font-size: 12px;
      width: 38px;
      text-align: center;
      user-select: none;
    }
  }
}