@import "../badge/index.less";
@import "../checkbox/index.less";
@import "../input/index.less";

@select-lg: 44px;
@select-md: 38px;
@select-sm: 32px;
@select-xs: 26px;
@select-lg-badge:32px;
@select-md-badge:26px;
@select-sm-badge:20px;
@select-xs-badge:14px;
@select-lg-width: 260px;
@select-md-width: 220px;
@select-sm-width: 180px;
@select-xs-width: 140px;

.set-size(@size,@badge-size,@width) {
  & {
    width: @width;
    height: @size;
    .layui-input {
      height: @size;
      line-height: @size;
    }
    .layui-badge{
      height: @badge-size;
      line-height: @badge-size;
      box-sizing: border-box;
    }
  }
}

dl.layui-anim-upbit > dd input[type="checkbox"] {
  display: none;
}

dl.layui-anim-upbit > dd .layui-form-checkbox,
.layui-form-item dl.layui-anim-upbit > dd .layui-form-checkbox[lay-skin] {
  margin-top: -3px;
}

.layui-multiple-select-row {
  position: absolute;
  height: 100%;
  top: 0;
  left: 0;
  right: 34px;
  padding: 5px 0 5px 6px;
  box-sizing: border-box;
  overflow: hidden;
  overflow-x: scroll;
  cursor: pointer;
  background-color: #fff;
  border: 1px solid var(--input-border-color);
  border-right: unset;
  .layui-multiple-select-badge {
    width: ms-max-content;
    width: max-content;
    .layui-badge {
      margin-left: 5px;
      height: 25px;
      line-height: 25px;
      border:1px solid #f0f0f0;
      &:first-of-type {
        margin-left: 0;
      }
    }
    .layui-icon {
      font-size: 12px;
      padding-left: 3px;
    }
  }
  &::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
  &::-webkit-scrollbar-thumb {
    height: 50px;
    background-color: whitesmoke;
    border-radius: 6px;
    opacity: 0.5;
  }
  &::-webkit-scrollbar-thumb:hover {
    height: 50px;
    background-color: whitesmoke;
    border-radius: 6px;
  }
}

.layui-select {
  height: 38px;
  line-height: 1.3;
  line-height: 38px\9;
  border-width: 1px;
  border-style: solid;
  background-color: #fff;
  border-color: #eee;
  color: rgba(0, 0, 0, 0.85);
  border-radius: 2px;
  padding: 0 10px;
}

.layui-select::-webkit-input-placeholder {
  line-height: 1.3;
}

.layui-form-select {
  position: relative;
}

.layui-select-title{
  height: 100%;
}

.layui-select-title .layui-input {
  padding-right: 36px;
  padding-left: 10px;
  cursor: pointer;
}

.layui-form-select .layui-edge {
  position: absolute;
  right: 10px;
  top: 50%;
  margin-top: -3px;
  cursor: pointer;
  border-width: 6px;
  border-top-color: var(--global-neutral-color-8);
  border-top-style: solid;
  transition: all 0.3s;
  -webkit-transition: all 0.3s;
}

.layui-input-icon-area{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  cursor: pointer;
  .layui-icon-close-fill{
    margin-left: 10px;
    color: rgba(0, 0, 0, 0.45);
  }
}

.layui-form-select .layui-icon-triangle-d {
  display: inline-block;
  transition: all 0.3s;
  -webkit-transition: all 0.3s;
  color:var(--global-neutral-color-8);
}

.layui-form-select dl {
  display: none;
  position: absolute;
  left: 0;
  top: 42px;
  padding: 5px 0;
  z-index: 899;
  min-width: 100%;
  border: 1px solid var(--global-neutral-color-3);
  max-height: 300px;
  overflow-y: auto;
  background-color: #fff;
  border-radius: var(--global-border-radius);
  box-sizing: border-box;
  box-shadow: 1px 1px 4px rgb(0 0 0 / 8%);
}

.layui-form-select dl dd,
.layui-form-select dl dt {
  padding: 0 10px;
  line-height: 36px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.layui-form-select dl dt {
  font-size: 12px;
  color: #999;
}

.layui-form-select dl dd {
  cursor: pointer;
}

.layui-form-select dl dd:hover {
  background-color: var(--global-neutral-color-2);
  -webkit-transition: 0.5s all;
  transition: 0.5s all;
}

.layui-form-select .layui-select-group dd {
  padding-left: 20px;
}

.layui-form-select dl dd.layui-select-tips {
  padding-left: 10px !important;
  color: #999;
}

.layui-form-select dl dd.layui-this {
  background-color: var(--global-neutral-color-2);
  color: var(--global-checked-color);
  font-weight: 700;
}

.layui-form-checkbox,
.layui-form-select dl dd.layui-disabled {
  background-color: #fff;
}

.layui-form-selected dl {
  display: block;
}

.layui-multiple-select-input {
  margin-bottom: 5px;
  padding: 0 10px;
  cursor: pointer;

  .layui-input {
    height: 30px !important;
    line-height: 30px !important;
  }
}
.layui-form-select{
  &[size="lg"] {
    .set-size(@select-lg, @select-lg-badge, @select-lg-width);
  }
  &[size="md"] {
    .set-size(@select-md, @select-md-badge, @select-md-width);
  }
  &[size="sm"] {
    .set-size(@select-sm, @select-sm-badge, @select-sm-width);
  }
  &[size="xs"] {
    .set-size(@select-xs, @select-xs-badge, @select-xs-width);
  }
}