@import "../../settings/includes/colors";

.c-toggle-switch {
  margin-bottom: 24px;

  &__label {
    cursor: pointer;
  }

  &__input {
    opacity: 0;
    position: absolute;
    z-index: -1;

    &:checked:not(:disabled) {
      + .c-toggle-switch__state::before {
        left: 26px;
        background-color: $Pacific;
      }
    }

    &:disabled {
      + .c-toggle-switch__state {
        cursor: not-allowed;

        .c-toggle-switch__state-text {
          display: none;
        }
      }
    }
  }

  &__state {
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    padding: 4px;
    transition: border-color, 0.3s;
    line-height: 1em;
    border-radius: 20px;
    width: 48px;
    height: 24px;

    &-text {
      user-select: none;
    }

    &::before {
      background-color: map-get($MonoPalette, 60);
      transition: background-color, 0.3s;
      content: '';
      width: 16px;
      height: 16px;
      border-radius: 50em;
      position: absolute;
      left: 2px;
      top: 2px;
    }
  }

  &__label-text {
    margin-left: 8px;
  }
}
