:host {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

.model {
  position: relative;
  cursor: pointer;

  .connect {
    overflow: hidden;
    position: relative;
    z-index: 1;
    height: 16px;
    margin: 4px 6px;
    border-radius: 50px;

    &:before {
      content: '';
      z-index: 1;
      position: absolute;
      top: 0;
      right: 1%;
      bottom: 0;
      left: 1%;
      border-radius: 50px;
      background-color: #ff544d;
    }

    .off,
    .on {
      position: absolute;
      z-index: 2;
      top: 0;
      bottom: 0;
      border-radius: 50px;
      transition: right 250ms ease-in-out, left 250ms ease-in-out;
      will-change: right, left;

      .label {
        padding: 0 9px;
        font-family: Roboto;
        font-size: 10px;
        font-weight: normal;
        font-style: normal;
        font-stretch: normal;
        line-height: 16px;
        letter-spacing: normal;
        color: #ffffff;
      }
    }

    .off {
      left: 0;
      right: 50%;
      background-color: #ff544d;

      .label {
        text-align: left;
      }
    }

    .on {
      left: 50%;
      right: 0;
      background-color: #21deab;

      .label {
        text-align: right;
      }
    }

  }

  .handle {
    z-index: 3;
    position: absolute;
    top: -1px;
    left: calc(50% - 9px);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.24), 0 0 2px 0 rgba(0, 0, 0, 0.12);
    transition: left 250ms ease-in-out;
    will-change: left;
  }

  &.off {
    .connect {
      &:before {
        background-color: #21deab;
      }

      .on {
        left: 100%;
        right: 0;
        color: transparent;

        .label {
          display: none;
        }
      }

      .off {
        z-index: 3;
        left: 0;
        right: 0;
        color: transparent;

        .label {
          text-align: right;
        }
      }


    }

    .handle {
      left: 0;
    }
  }

  &.on {
    .connect {
      &:before {
        background-color: #ff544d;
      }

      .on {
        z-index: 3;
        left: 0;
        right: 0;
        color: transparent;

        .label {
          text-align: left;
        }
      }

      .off {
        left: 0;
        right: 100%;
        color: transparent;

        .label {
          display: none;
        }
      }

    }

    .handle {
      left: calc(100% - 18px);
    }
  }
}
