.ui-select-container {
  .ui-select-highlight {
    font-weight: bold;
  }

  .ui-select-offscreen {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    left: 0;
    margin: 0;
    outline: 0;
    overflow: hidden;
    padding: 0;
    position: absolute;
    top: 0;
    width: 1px;
  }
}

// Helper class to show styles when focus
.btn-default-focus {
  color: #333;
  background-color: #EBEBEB;
  border-color: $wk-primary-gray-tint6;
  text-decoration: none;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
}

.ui-select-bootstrap .ui-select-toggle {
  position: relative;

  > .caret {
    height: 10px;
    margin-top: -2px;
    position: absolute;
    right: 10px;
    top: 50%;
  }
}


// Fix Bootstrap dropdown position when inside a input-group
.input-group > .ui-select-bootstrap.dropdown {
  // Instead of relative
  position: static;
}

.ui-select-match {

  > .btn {
    // Instead of center because of .btn
    text-align: left;
  }

  > .caret {
    position: absolute;
    right: 15px;
    top: 45%;
  }
}


// See Scrollable Menu with Bootstrap 3 http://stackoverflow.com/questions/19227496
.ui-select-choices {
  width: 100%;
  height: auto;
  max-height: 200px;
  overflow-x: hidden;
  margin-top: -1px;

  .ui-select-choices-row-inner{
    > input,
    > div {
      display: inline;
    }
  }
}

body > .ui-select-bootstrap.open {
  z-index: 1000; // Standard Bootstrap dropdown z-index
}

.ui-select-multiple {
  height: auto;
  padding: 3px 3px 0 3px;

  input.ui-select-search {
    background-color: transparent !important; // To prevent double background when disabled
    border: none;
    height: 1.666666em;
    margin-bottom: 3px;
    outline: none;
  }

  .ui-select-match-item {
    background-color: $wk-primary-blue;
    color: $wk-primary-white;
    margin: 0 3px 3px 0;
    outline: 0;
    padding: 5px;

    .close {
      color: inherit;
      font-weight: normal;
      float: right;
      opacity: 1;
    }

    > span:last-of-type {
      text-align: center;
      font-size: 14px;
    }

    .dropping-before{
      &::before {
        border-left: 1px solid $wk-primary-blue;
        content: "";
        height: 100%;
        margin-right: 2px;
        position: absolute;
        top: 0;
        right: 100%;
      }

    }
    .dropping-before{
      &::after {
        border-right: 1px solid $wk-primary-blue;
        content: "";
        height: 100%;
        left: 100%;
        margin-left: 2px;
        position: absolute;
        top: 0;
      }
    }
  }
}

.ui-select-choices-row {
  color: $wk-primary-gray;
  padding: 3px 20px;
  white-space: nowrap;

  &:hover,
  &:focus {
    background-color: $wk-primary-gray-tint5;
    text-decoration: none;
  }

  .active > a {
    background-color: $wk-primary-blue;
    color: $wk-primary-white;
    text-decoration: none;
    outline: 0;
  }
}

.ui-select-choices-row.disabled > a,
.ui-select-choices-row.active.disabled > a {
  color: $wk-primary-gray-tint3;
  cursor: not-allowed;
  background-color: $wk-primary-white;
}

// fix hide/show angular animation
.ui-select-match.ng-hide-add,
.ui-select-search.ng-hide-add {
  display: none;
}


//.ui-select-multiple:first-child::after {
//  color: $wk-primary-gray;
//  @include extend-icon('\e916');
//}
// Handle up direction Bootstrap
.ui-select-container[theme='bootstrap'].direction-up .ui-select-dropdown {
  box-shadow: 0 -4px 8px rgba(0, 0, 0, .25);
}
