/**
 * This file is part of the drip-table project.
 * @link     : https://drip-table.jd.com/
 * @author   : Emil Zhai (root@derzh.com)
 * @modifier : Emil Zhai (root@derzh.com)
 * @copyright: Copyright (c) 2021 JD Network Technology Co., Ltd.
 */

@import url("../../../styles/theme/default.less");

@prefixCls: jfe-drip-table-rc-checkbox;

.@{prefixCls} {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  color: @drip-table-text-color;
  font-size: 14px;
  font-variant: tabular-nums;
  list-style: none;
  font-feature-settings: "tnum", "tnum";
  position: relative;
  top: .2em;
  line-height: 1;
  white-space: nowrap;
  outline: none;
  cursor: pointer;
}

.@{prefixCls}-input:focus+.@{prefixCls}-inner,.@{prefixCls}-wrapper:hover .@{prefixCls}-inner,.@{prefixCls}:hover .@{prefixCls}-inner {
  border-color: @drip-table-primary-color;
}

.@{prefixCls}-checked:after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 1px solid @drip-table-primary-color;
  border-radius: 2px;
  visibility: hidden;
  animation: antCheckboxEffect .36s ease-in-out;
  animation-fill-mode: backwards;
  content: "";
}

.@{prefixCls}-wrapper:hover .@{prefixCls}:after,.@{prefixCls}:hover:after {
  visibility: visible;
}

.@{prefixCls}-span {
  padding: 0 8px;
}

.@{prefixCls}-inner {
  position: relative;
  top: 0;
  left: 0;
  display: block;
  width: 16px;
  height: 16px;
  direction: ltr;
  background-color: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  border-collapse: separate;
  transition: all .3s;
}

.@{prefixCls}-inner:after {
  position: absolute;
  top: 50%;
  left: 21.5%;
  display: table;
  width: 5.7142px;
  height: 9.1428px;
  border: 2px solid #ffffff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg) scale(0) translate(-50%, -50%);
  opacity: 0;
  transition: all .1s cubic-bezier(.71, -.46, .88, .6), opacity .1s;
  content: " ";
}

.@{prefixCls}-input {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.@{prefixCls}-checked .@{prefixCls}-inner:after {
  position: absolute;
  display: table;
  border: 2px solid #ffffff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg) scale(1) translate(-50%, -50%);
  opacity: 1;
  transition: all .2s cubic-bezier(.12, .4, .29, 1.46) .1s;
  content: " ";
}

.@{prefixCls}-checked .@{prefixCls}-inner {
  background-color: @drip-table-primary-color;
  border-color: @drip-table-primary-color;
}

.@{prefixCls}-disabled {
  cursor: not-allowed;
}

.@{prefixCls}-disabled.@{prefixCls}-checked .@{prefixCls}-inner:after {
  border-color: #00000040;
  animation-name: none;
}

.@{prefixCls}-disabled .@{prefixCls}-input {
  cursor: not-allowed;
}

.@{prefixCls}-disabled .@{prefixCls}-inner {
  background-color: #f5f5f5;
  border-color: #d9d9d9 !important;
}

.@{prefixCls}-disabled .@{prefixCls}-inner:after {
  border-color: #f5f5f5;
  border-collapse: separate;
  animation-name: none;
}

.@{prefixCls}-disabled+span {
  color: #00000040;
  cursor: not-allowed;
}

.@{prefixCls}-disabled:hover:after,.@{prefixCls}-wrapper:hover .@{prefixCls}-disabled:after {
  visibility: hidden;
}

.@{prefixCls}-wrapper {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  color: @drip-table-text-color;
  font-size: 14px;
  font-variant: tabular-nums;
  list-style: none;
  font-feature-settings: "tnum", "tnum";
  display: inline-flex;
  align-items: baseline;
  line-height: unset;
  cursor: pointer;
}

.@{prefixCls}-wrapper:after {
  display: inline-block;
  width: 0;
  overflow: hidden;
  content: "\a0";
}

.@{prefixCls}-wrapper.@{prefixCls}-wrapper-disabled {
  cursor: not-allowed;
}

.@{prefixCls}-wrapper+.@{prefixCls}-wrapper {
  margin-left: 8px;
}

.@{prefixCls}+span {
  padding-right: 8px;
  padding-left: 8px;
}

.@{prefixCls}-group {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  color: @drip-table-text-color;
  font-size: 14px;
  font-variant: tabular-nums;
  line-height: 1.5715;
  list-style: none;
  font-feature-settings: "tnum", "tnum";
  display: inline-block;
}

.@{prefixCls}-group-item {
  margin-right: 8px;
}

.@{prefixCls}-group-item:last-child {
  margin-right: 0;
}

.@{prefixCls}-group-item+.@{prefixCls}-group-item {
  margin-left: 0;
}

.@{prefixCls}-indeterminate .@{prefixCls}-inner {
  background-color: #ffffff;
  border-color: #d9d9d9;
}

.@{prefixCls}-indeterminate .@{prefixCls}-inner:after {
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background-color: @drip-table-primary-color;
  border: 0;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  content: " ";
}

.@{prefixCls}-indeterminate.@{prefixCls}-disabled .@{prefixCls}-inner:after {
  background-color: #00000040;
  border-color: #00000040;
}

.@{prefixCls}-rtl {
  direction: rtl;
}

.@{prefixCls}-group-rtl .@{prefixCls}-group-item {
  margin-right: 0;
  margin-left: 8px;
}

.@{prefixCls}-group-rtl .@{prefixCls}-group-item:last-child {
  margin-left: 0 !important;
}

.@{prefixCls}-group-rtl .@{prefixCls}-group-item+.@{prefixCls}-group-item {
  margin-left: 8px;
}
