@import './function';

.filter {
  padding:0 10px;
  input {
    width: 100%;
    height: 30px;
    display: block;
    box-sizing: border-box;
    border: 1px solid #eceaea;
    padding: 0 10px;
    margin:10px 0 0 0;
    line-height: 30px;
    color: $text2;
  }
}
.rui-select.disable {
  background-color: #ececec;
  cursor: not-allowed;
}
.rui-theme-1 {
  &.rui-select {
    border: 1px solid $border;
    border-radius: 6px 6px;
    &.active {
      border:1px solid $primary;
      border-radius:6px 6px;
      box-shadow: 0 0 0 2px $primary_border;

      .arrow {
        background:url(../img/icon/arrow_primary.png) no-repeat;
      }
    }

    &.noactive {
      border:1px solid $border;
      box-shadow:0 0 0 0;
    }
  }

}

// TODO theme-2 need to refactor
.rui-theme-2 {
  &.rui-select {
    text-align:center;

    &.active {
      .rui-select-options {
        margin-top:0px;
      }
    }
  }
}

.rui-theme-3 {
  &.rui-select {
    &.active {
      .rui-select-options {
        border-radius: 6px 6px;
      }

      .arrow {
        background:url(../img/icon/arrow_primary.png) no-repeat;
      }
    }
  }
}

.rui-select {
  position: relative;
  width:300px;
  height:32px;
  line-height:1.5;
  cursor: pointer;
  padding: 7px 9px;
  display: inline-block;
  box-sizing: border-box;
  background-color: #fff;
  vertical-align: middle;
  outline: 0;
    &.active{
      .rui-select-options-wrap {
        .rui-select-options {
          -webkit-transform: translate(0);
          transform: translate(0);
        }
      }

      .arrow {
        transform:rotate(180deg);
      }
    }

    .placeholder {
      color:$text3;
    }
    .rui-select-options-wrap {
      position: absolute;
      z-index: 1050;
      left: -13px;
      right: -13px;
      overflow: hidden;
      .rui-select-options {
        display:none;
        -webkit-transition: .45s;
        transition: .45s;
        -webkit-transform: translateY(-100%);
        transform: translateY(-100%);
        border: 1px solid $border;
        border-radius:6px 6px;
        box-shadow:0 0 2px $border;
        margin: 4px 12px 20px;
        background-color: #fff;
        //外层的border-radius是6px，由于li本身宽度小于外层宽度，所以如果继续用6px会导致出现白色的一层border-radius
        li:first-child{
          border-radius: 5px 5px 0 0;
          &:hover{
            a{
              border-radius: 5px 5px 0 0;
            }
          }

        }
        li:last-child{
          border-radius: 0 0 5px 5px;
          &:hover{
            a {
              border-radius: 0 0 5px 5px;
            }
          }
        }

        .choosed {
          background:#f5f5f5;
        }

        &.one {
          display: block;
          -webkit-transform: translateY(0);
          transform: translateY(0);
          margin-top:0px;
          box-shadow: none;
          border:1px solid $border;
        }
        ul {
          max-height: 120px;
          li {
            display:block;
            a {
              display:block;
              height:30px;
              line-height:30px;
              padding:0 9px;
              color:$text2;
              cursor: pointer;
              &:hover {
                color:$primary;
                background-color:#dbebfe;
              }
            }
          }
        }
      }
    }
  .arrow {
    position:absolute;
    display:block;
    width:16px;
    height:16px;
    top:7px;
    right:10px;
    background:url('../img/icon/arrow.png') no-repeat;
    transition:all .3s ease-out;
  }
}
