@use './styles/override';
@use './styles/input-tags';
@use '@jswork/react-codeflask/dist/style.scss';

.ac-checkable-tag {
  user-select: none;
  background: #ededed;

  &[disabled] {
    pointer-events: none;
    opacity: 0.7;
  }

  &.ant-tag-checkable-checked {
    background: #1677ff;
  }

  > [role='img'] {
    margin-left: 2px;
  }
}

.ac-checkable-tag-list {
  --ac-checkable-tag-list-active-bg: #1677ff;
  --ac-checkable-tag-list-inactive-bg: #ededed;

  .ac-is-aside {
    border-radius: 3px;
  }

  .ac-is-item {
    padding: 1px 7px;
    background: var(--ac-checkable-tag-list-inactive-bg);

    &.ant-tag-checkable-checked {
      background: var(--ac-checkable-tag-list-active-bg);
    }
  }
}

.ac-editable-tag-group {
  //display: inline-block;

  .ant-tag {
    //margin-bottom: 5px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
  }

  .ant-btn {
    position: relative;
    padding-left: 15px;
  }

  &__input {
    flex: 1;

    input {
      border-color: transparent;
      background: none;
      text-align: center;
    }
  }

  &__create {
    font-size: 12px;
    line-height: 22px;
  }

  &__plus {
    width: 10px;
    height: 10px;
    opacity: 0.3;
    cursor: pointer;
    position: relative;
    display: inline-block;

    &:hover {
      opacity: 1;
    }

    &:before,
    &:after {
      position: absolute;
      left: 0;
      content: '';
      height: 10px;
      width: 1px;
      background-color: #333;
    }

    &:before {
      transform: rotate(90deg);
    }

    &:after {
      transform: rotate(180deg);
    }
  }

  &__close {
    position: relative;
    margin-left: 3px;
    width: 10px;
    height: 10px;
    opacity: 0.3;
    cursor: pointer;

    &:hover {
      opacity: 1;
    }

    &:before,
    &:after {
      position: absolute;
      left: 0;
      content: '';
      height: 10px;
      width: 1px;
      background-color: #333;
    }

    &:before {
      transform: rotate(45deg);
    }

    &:after {
      transform: rotate(-45deg);
    }
  }
}

.ac-edit-tag-group2 {
  .ant-tag {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
  }

  .ant-btn {
    position: relative;
    padding-left: 15px;
  }

  &__input {
    flex: 1;

    input {
      border-color: transparent;
      background: none;
      text-align: center;
    }
  }

  &__create {
    font-size: 12px;
    line-height: 22px;
  }

  &__plus {
    width: 10px;
    height: 10px;
    opacity: 0.3;
    cursor: pointer;
    position: relative;
    display: inline-block;

    &:hover {
      opacity: 1;
    }

    &:before,
    &:after {
      position: absolute;
      left: 0;
      content: '';
      height: 10px;
      width: 1px;
      background-color: #333;
    }

    &:before {
      transform: rotate(90deg);
    }

    &:after {
      transform: rotate(180deg);
    }
  }

  &__close {
    position: relative;
    margin-left: 3px;
    width: 10px;
    height: 10px;
    opacity: 0.3;
    cursor: pointer;

    &:hover {
      opacity: 1;
    }

    &:before,
    &:after {
      position: absolute;
      left: 0;
      content: '';
      height: 10px;
      width: 1px;
      background-color: #333;
    }

    &:before {
      transform: rotate(45deg);
    }

    &:after {
      transform: rotate(-45deg);
    }
  }
}

.ac-upload-picture-card {
  /**
  定义 css 变量，可以改变 image-item 的大小
 */
  .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-container,
  .ant-upload.ant-upload-select {
    --ac-upload-images-size: 102px;
    border-width: 3px !important;
    width: var(--ac-upload-images-size) !important;
    height: var(--ac-upload-images-size) !important;
  }

  .ant-upload-list-item-container {
    user-select: none;

    &:hover {
      .ant-upload-list-item {
        border-width: 2px !important;
        border-style: dashed !important;
        border-color: orange !important;
      }
    }
  }

  &__modal {
    width: 800px;
    text-align: center;

    .is-img {
      width: 100%;
      height: 100%;
    }
  }
}

.ac-checkable-dropdown {
  &__btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;

    .is-label {
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
}

.ac-upload-picture {
  --ac-upload-picture-height: 120px;
}

.ac-input-token {
  &__token {
    user-select: none;
    cursor: pointer;
  }
}

.ac-input-copyable,
.ac-input-token {
  display: flex;
}
