@import 'src/global/styles/var';

.glue-switch {
  position: relative;
  display: inline-block;
  box-sizing: content-box;
  width: @switch-width;
  height: @switch-height;
  font-size: @switch-size;
  background-color: @switch-background-color;
  border: @switch-border;
  border-radius: @switch-node-size;
  cursor: pointer;
  transition: background-color @switch-transition-duration;

  &__node {
    position: absolute;
    top: 0;
    left: 0;
    width: @switch-node-size;
    height: @switch-node-size;
    background-color: @switch-node-background-color;
    border-radius: 100%;
    box-shadow: @switch-node-box-shadow;
    transition: transform @switch-transition-duration
      cubic-bezier(0.3, 1.05, 0.4, 1.05);
  }

  &__loading {
    position: absolute !important;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  &--on {
    background-color: @switch-on-background-color;

    .glue-switch__node {
      transform: translateX(@switch-width - @switch-node-size);
    }

    .glue-switch__loading {
      color: @switch-on-background-color;
    }
  }

  &--disabled {
    cursor: not-allowed;
    opacity: @switch-disabled-opacity;
  }

  &--loading {
    cursor: default;
  }
}
