@import './icon.scss';
@import "../../styles/themes/variable.scss";

#{$xh-prefix}-checkbox {
  display: flex;
  align-items: flex-start;
  font-size: 28px;
  &.center {
    align-items: center;
  }
  &.end {
    align-items: flex-end;
  }
  &.around {
    justify-content: space-around;
  }
  &.between {
    justify-content: space-between;
  }
  &.rtl {
    direction: rtl;
    #{$xh-prefix}-checkbox-label {
      margin-left: 0;
      margin-right: 10px;
      direction: ltr;
    }
  }
  &-input {
    display: none;
    &:checked + &-fake {
      background-color: var(--color-primary);
      border-color: transparent;
      &:after {
        border-right: 3px solid #FFF;
        border-bottom: 5px solid #FFF;
      }
    }
    &:disabled + &-fake {
      background-color: var(--border-color);
      border-color: var(--font-color-fifth);
      cursor: not-allowed;
    }
    &[checked] + &-fake{
      background-color: var(--color-primary);
      border-color: transparent;
      &:after {
        border-right: 3px solid #FFF;
        border-bottom: 5px solid #FFF;
      }
    }
    &[checked="true"] {
      display: block;
    }
    &[checked="true"] + &-fake{
      background-color: var(--color-primary);
      &:after {
        border-right: 3px solid #FFF;
        border-bottom: 5px solid #FFF;
      }
    }
    &[disabled] + &-fake {
      background-color: var(--border-color);
      border-color: var(--font-color-fifth);
      cursor: not-allowed;
    }
    &.checked + &-fake {
      background-color: var(--color-primary);
      border-color: transparent;
      &:after {
        border-right: 3px solid #FFF;
        border-bottom: 5px solid #FFF;
      }
    }
  }
  &-input-fake{
    width: 32px;
    height: 32px;
    display: inline-block;
    vertical-align: middle;
    border: 1px solid #E0E0E0;
    border-radius: 3px;
    position: relative;
    flex-shrink: 0;
    transition: background-color .2s;
    box-sizing: border-box;
    &.circle {
      border-radius: 50%;
    }
    &-icon{
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }
    // &:after {
    //   content: "";
    //   display: inline-block;
    //   width: 8px;
    //   height: 18px;
    //   border-right: 3px solid transparent;
    //   border-bottom: 5px solid transparent;
    //   position: absolute;
    //   left: 50%;
    //   top: 45%;
    //   transform: translate(-50%, -50%) rotate(45deg);
    // }

  }
  &.h5 {
    #{$xh-prefix}-checkbox-label {
      line-height: 1.2;
    }
  }
  &-label {
    margin-left: 10px;
  }
}


#{$xh-prefix}-checkbox-group {
  &.padding {
    #{$xh-prefix}-checkbox {
      padding: 30px 0;
    }
  }
  &.border {
    #{$xh-prefix}-checkbox {
      border-bottom: 1px solid #EEE;
    }
  }
}
