@import (reference) '../theme/variables/antdVariables.less';
@checkbox-prefix-cls: ~'@{ant-prefix}-checkbox';

@checkboxGroupPrefixCls: ~'ued-checkboxgroup';
// 复选框复选组，通用样式
label.@{checkbox-prefix-cls}-wrapper {
  line-height: @input-height-base;
}

// 分体按钮
.@{checkboxGroupPrefixCls}-SplitButton,
.@{checkboxGroupPrefixCls}-BackgroundButton,
.@{checkboxGroupPrefixCls}-CircleButton,
.@{checkboxGroupPrefixCls}-ColorButton,
.@{checkboxGroupPrefixCls}-BadgeButton {
  display: inline-flex;
  flex-wrap: wrap;
  .@{checkbox-prefix-cls}-wrapper {
    border-radius: 4px;
    position: relative;
    border: 1px solid @border-color-base;
    margin-right: 0;
    .@{checkbox-prefix-cls} {
      position: absolute;
      visibility: hidden;
      width: 100%;
      height: 100%;
      inset: 0;
      display: block;
      & + span {
        padding-left: 16px;
        padding-right: 16px;
      }
      &-checked::after {
        animation: none;
        border: none;
      }
    }
    &-checked {
      border-color: @primary-color;
      .@{checkbox-prefix-cls} + span {
        color: @primary-color;
      }
    }
  }
}
// 背景按钮
.@{checkboxGroupPrefixCls}-BackgroundButton {
  .@{checkbox-prefix-cls}-wrapper {
    border: none;
    background-color: rgba(247, 248, 250, 1);
    &-checked {
      .@{checkbox-prefix-cls} + span {
        font-weight: 500;
      }
      background-color: fade(@primary-color, 15%);
      border: none;
    }
  }
}
// 圆形按钮
.@{checkboxGroupPrefixCls}-CircleButton {
  .@{checkbox-prefix-cls}-wrapper {
    border-radius: 999px;
    background-color: rgba(247, 248, 250, 1);
    &-checked {
      background: fade(@primary-color, 10%);
      border-color: @primary-color;
      position: relative;
      &::before {
        display: inline-block;
        content: '';
        position: absolute;
        top: 0;
        right: -3px;
        width: 12px;
        height: 12px;
        background: @primary-color;
        border-radius: 50%;
        border: 1px solid white;
        left: unset;
        padding: 0;
        box-sizing: border-box;
      }
      &::after {
        border: 1px solid #fff;
        border-bottom-left-radius: 1px;
        content: "";
        display: inline-block;
        position: absolute;
        right: -0.5px;
        text-align: center;
        top: 3px;
        width: 6.5px;
        height: 4.5px;
        border-top: none;
        border-right: none;
        transform: rotate(-45deg);
      }
      .@{checkbox-prefix-cls} + span {
        font-weight: 500;
      }
    }
  }
}
// 彩色按钮
.@{checkboxGroupPrefixCls}-ColorButton {
  .@{checkbox-prefix-cls}-wrapper {
    border: none;
    background-color: fade(@primary-color, 10%);
    &-checked {
      .@{checkbox-prefix-cls} + span {
        font-weight: 500;
        color: white;
      }
      background: linear-gradient( 270deg, fade(@primary-color, 60%) 0%, @primary-color 100%);
      border: none;
    }
  }
}
// 角标按钮
.@{checkboxGroupPrefixCls}-BadgeButton {
  .@{checkbox-prefix-cls}-wrapper {
    border: none;
    background-color: rgba(247, 248, 250, 1);
    &-checked {
      .@{checkbox-prefix-cls} + span {
        font-weight: 500;
      }
      background-color: fade(@primary-color, 15%);
      border: none;
      &:hover {
        &::before {
          background-color: transparent;
        }
      }
      &::before {
        display: inline-block;
        content: '';
        position: absolute;
        bottom: 0;
        right: 0;
        border: 8px solid transparent;
        border-right-color: @primary-color;
        border-bottom-color: @primary-color;
        border-bottom-right-radius: 4px;
        left: unset;
        padding: 0;
        box-sizing: border-box;
        background-color: transparent;
        width: 0;
        height: 0;
        top: unset;
      }
      &::after {
        border: 1px solid #fff;
        border-bottom-left-radius: 1px;
        content: "";
        display: inline-block;
        position: absolute;
        right: 2px;
        text-align: center;
        bottom: 4px;
        width: 6px;
        height: 3.5px;
        border-top: none;
        border-right: none;
        transform: rotate(-45deg);
      }
    }
  }
}
