@import "../styles/common";
@color:rgba(0,0,0,0.65);
@disabledColor:#666;

@scrollBarWidth:12px;
@scrollBarHeight:12px;

.w-select {
  position: relative;
  user-select: none;
  width: 100%;
  height: 100%;
  min-height: 34px;
  background: #F5F6F6;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;

  .w-select-close {
    position: absolute;
  }

  .w-select-caret {
    position: absolute;
    top: 50%;
    right: 11px;
    transform: translate(0, -50%) rotate(0deg);
    color: rgba(0, 0, 0, 0.25);
    transition: transform 250ms linear;
    cursor: pointer;
    font-size: 12px;
  }

  &:hover {
    .w-select-close {
      opacity: 0.8;

      &:hover {
        opacity: 1;
      }
    }
  }

  &.open {
    .w-select-caret {
      transform: translate(0, -50%) rotate(180deg);
    }
  }

  .w-select-remove{
    //background: #d8d8d8;
    color:rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    font-size: 12px;
    opacity: 0.8;
    cursor: pointer;

    &:hover{
      opacity: 1;
    }
  }

  .text_tooltip{
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
  }

  .w-select-selected-list{
    position: absolute;
    left: 0;
    top: 0;
    width: calc(100% - 30px);
    height: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 0 10px;

    .w-select-selected-item{
      margin-right: 10px;
      display: flex;
      align-items: center;
      white-space: nowrap;
    }

    &.single{
      .w-select-remove{
        display: none;
      }
      .w-select-input-box{
        width: 100% !important;
      }
    }

    &.close{
      .w-select-input-box{
        width: 100% !important;
      }
    }
  }

  &.disabled{
    background: #D9D9D9;
    color: #666;
    cursor: not-allowed;

    .w-select-close{
      display: none;
    }
  }

  .w-select-input-box{
    min-width: 30px;
    flex:0 0 auto;
  }

  .w-select-input{
    width: 100% !important;
    //min-width: 120px;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border: 0 !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer;
  }

}

.w-select-dropdown {

  .w-select-dropdown-content{
    //min-width: 343px !important;
    min-width: 0;
  }

  .w-select-dropdown-header{
    opacity: 1;
    background: #e5e5e5;
    display: flex;
    align-items: center;
    padding: 0 5px;
    justify-content: space-between;
  }

  @activeColor:rgba(91,151,238,1);

  .w-select-dropdown-header-item{
    color: @color;
    font-size: 12px;
    margin: 0 2px;
    cursor: pointer;
    height: 32px;
    line-height: 30px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    padding: 0 5px;

    &.active{
      color:#5b97ee;
      border-color:#5b97ee;
    }
  }

  .w-select-dropdown-check{
    display: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translate(0,-50%);
    font-size: 16px;
  }

  .w-select-dropdown-text{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ant-select-dropdown-menu-item{
    padding-right: 40px;
    position: relative;
    padding-left: 10px;

    &.w-select-dropdown-item-pinyin{
      padding-left: 30px;
    }

    .w-select-first-char{
      position: absolute;
      left: 10px;
      top: 50%;
      transform: translate(0,-50%);
      color:@activeColor;
    }
  }

  .ant-select-dropdown-menu-item-selected{
    background-color: transparent !important;
    color:@activeColor;
    font-weight: normal;
    .w-select-dropdown-check{
      display: block;
    }
  }

  .ant-select-dropdown-menu{
    max-height: 300px;
    overflow: auto;
    padding: 10px 0;
  }

  .w-select-alert{
    line-height: 37px;
    color: #999999;
    font-size: 12px;
    position: relative;
    padding:0 15px;

    .w-select-dropdown-close{
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translate(0,-50%);
      font-size: 16px;
      opacity: 0.8;
      &:hover{
        opacity: 1;
      }
    }
  }

  .w-select-nodata{
    padding: 20px 0;
    text-align: center;
  }

  .w-select-loading{
    padding: 10px 10px 5px 10px;
  }


  .w-select-dropdown-footer{
    display: flex;
    padding: 12px 14px;
    border-top: 1px solid rgba(246,246,246,1);

    .w-select-dropdown-check-all{
      position: relative;
      cursor: pointer;

      &:after{
        content:'';
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
      }
    }


    .ant-radio-wrapper{
      color:@activeColor;
    }
    .ant-radio-inner{
      border-color: @activeColor;
    }
  }
}


