/* @group Base */
.chzn-container {
  position: relative;
  display: inline-block;
}
.chzn-container .chzn-drop {
  background: #fff;
  border: 1px solid #aaa;
  border-top: 0;
  position: absolute;
  top: 29px;
  left: 0;
  .box-shadow(0 4px 5px rgba(0,0,0,.15)); 
  z-index: 1010;
}
/* @end */

/* @group Single Chosen */
.chzn-container-single .chzn-single {
  #gradient > .vertical-three-colors(#ffffff, #eeeeee, 50%, #f4f4f4);
  border-radius: 5px;
  .background-clip(padding-box);
  border: 1px solid #aaaaaa;
  .box-shadow(~'0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1)');
  @transition: border linear .2s, box-shadow linear .2s;
  .transition(@transition);
  display: block;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  height: 23px;
  line-height: 24px;
  padding: 0 0 0 8px;
  color: #444444;
  text-decoration: none;
}
.chzn-container-single .chzn-default {
  color: #999;
}
.chzn-container-single .chzn-single span {
  margin-right: 26px;
  display: block;
  .text-overflow()
}
.chzn-container-single .chzn-single abbr {
  position: absolute;
  top: 0;
  right: 30px;
  color: #444;
  &:before {
    content: '\00D7';
    font-weight: bold;
    font-size: 20px;
    line-height: @baseLineHeight;
  }
}
.chzn-container-single .chzn-single abbr:hover,
.chzn-container-single.chzn-disabled .chzn-single abbr:hover {
  color: #000;
}

.chzn-container-single .chzn-single div {
  position: absolute;
  right: 3px;
  top: 0;
  display: block;
  height: 100%;
  width: 18px;
}

.chzn-container-single .chzn-single div b {
  &:after {
    content: '\f107';
    font-family: FontAwesome;
  }
  display: block;
  width: 100%;
  height: 100%;
}
.chzn-container-single .chzn-search {
  padding: 3px 4px;
  position: relative;
  margin: 0;
  white-space: nowrap;
  z-index: 1010;
  color: #555;
  &:after {
    content: '\f002';
    font-family: FontAwesome;
    position: relative;
    right: 20px;
  }
}
.chzn-container-single .chzn-search input {
  #gradient > .vertical(#eee, #fff);
  margin: 1px 0;
}
.chzn-container-single .chzn-drop {
  border-radius: 0 0 4px 4px;
  .background-clip(padding-box);
}
/* @end */

.chzn-container-single-nosearch .chzn-search input {
  position: absolute;
  left: -9000px;
}

/* @group Multi Chosen */
.chzn-container-multi .chzn-choices {
  background-color: @inputBackground;
  border: 1px solid @inputBorder;
  border-radius: @inputBorderRadius;
  .box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
  @transition: border linear .2s, box-shadow linear .2s;
  .transition(@transition);
  margin: 0;
  padding: 0;
  cursor: text;
  overflow: hidden;
  height: auto !important;
  position: relative;
}
.chzn-container-multi .chzn-choices li {
  float: left;
  list-style: none;
}
.chzn-container-multi .chzn-choices .search-field {
  white-space: nowrap;
  margin: 0;
  padding: 0;
}
.chzn-container-multi .chzn-choices .search-field input {
  color: #666;
  background: transparent !important;
  border: 0 !important;
  font-size: 100%;
  height: 15px;
  padding: 5px;
  margin: 1px 0;
  outline: 0;
  .box-shadow(none);
}
.chzn-container-multi .chzn-choices .search-field .default {
  color: #999;
}
.chzn-container-multi .chzn-choices .search-choice {
  .border-radius(3px);
  .background-clip(padding-box);
  #gradient > .vertical-three-colors(#f4f4f4, #f0f0f0, 50%, #eeeeee);
  .box-shadow(~'0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05)');
  color: #333;
  border: 1px solid #aaaaaa;
  line-height: 13px;
  padding: 3px 20px 3px 5px;
  margin: 3px 0 3px 5px;
  position: relative;
  cursor: default;
}
.chzn-container-multi .chzn-choices .search-choice.search-choice-disabled {
  color: #999;
  border: 1px solid #cccccc;
  padding-right: 5px;
}
.chzn-container-multi .chzn-choices .search-choice-focus {
  background: #d4d4d4;
}
.chzn-container-multi .chzn-choices .search-choice .search-choice-close {
  position: absolute;
  right: 3px;
  top: 0;
  color: #999;
  &:before {
    content: '\00D7';
    font-size: 20px;
    font-weight: bold;
    line-height: 14px;
    text-shadow: 0 1px 0 #fff;
  }
}
.chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover,
.chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close {
  text-decoration: none;
  cursor: pointer;
  color: #333;
}
/* @end */

/* @group Results */
.chzn-container .chzn-results {
  margin: 0 4px 4px 0;
  max-height: 240px;
  padding: 0 0 0 4px;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.chzn-container-multi .chzn-results {
  margin: -1px 0 0;
  padding: 0;
}
.chzn-container .chzn-results li {
  display: none;
  line-height: 15px;
  padding: 5px 6px;
  margin: 0;
  list-style: none;
}
.chzn-container .chzn-results .active-result {
  cursor: pointer;
  display: list-item;
}
.chzn-container .chzn-results .highlighted {
  #gradient > .vertical ( lighten(@linkColor, 5%), darken(@linkColor, 5%) );
  color: #fff;
}
.chzn-container .chzn-results li em {
  background: #feffde;
  font-style: normal;
}
.chzn-container .chzn-results .highlighted em {
  background: transparent;
}
.chzn-container .chzn-results .no-results {
  background: #f4f4f4;
  display: list-item;
}
.chzn-container .chzn-results .group-result {
  cursor: default;
  color: #999;
  font-weight: bold;
}
.chzn-container .chzn-results .group-option {
  padding-left: 15px;
}
.chzn-container-multi .chzn-drop .result-selected {
  display: none;
}
/* @end */

/* @group Active  */
.chzn-container-active .chzn-single {
  border-color: rgba(82,168,236,.8);
  .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)");
}
.chzn-container-active .chzn-single-with-drop {
  border: 1px solid #aaa;
  .box-shadow(0 1px 0 #fff inset);
  #gradient > .vertical(#eee, #fff);
  .border-bottom-radius(0);
}
.chzn-container-active .chzn-single-with-drop div {
  background: transparent;
  border-left: none;
}
.chzn-container-active .chzn-single-with-drop div b:after {
  content: '\f106';
}
.chzn-container-active .chzn-choices {
  .border-bottom-radius(0);
  border-color: rgba(82,168,236,.8);
  .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)");
}
.chzn-container-active .chzn-choices .search-field input {
  color: #111 !important;
}
/* @end */

/* @group Disabled Support */
.chzn-disabled {
  cursor: default;
  opacity:0.5 !important;
}
.chzn-disabled .chzn-single {
  cursor: default;
}
.chzn-disabled .chzn-choices .search-choice .search-choice-close {
  cursor: default;
}
/* @end */

/* @group error & success  */
.chosenFieldState(@color) {
  .chzn-container .chzn-single,
  .chzn-container .chzn-drop,
  .chzn-container .chzn-choices {
    border-color:  @color;
  }
  .chzn-container-active {
    .chzn-single,
    .chzn-drop,
    .chzn-choices {
      border-color: darken(@color, 10%);
    }
    .chzn-single,
    .chzn-choices {
      @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@color, 20%);
      .box-shadow(@shadow);
    }
  }
  .chzn-container {
    .chzn-single,
    .chzn-choices .search-choice,
    .chzn-choices .search-field input {
      color: @color;
    }
  }
}
.control-group.success {
  .chosenFieldState(@successText);
}
.control-group.error {
  .chosenFieldState(@errorText);
}
.control-group.info {
  .chosenFieldState(@infoText);
}
.control-group.warning {
  .chosenFieldState(@warningText);
}
/* @end */

//
// bootstrap-chosen.less
//
// An alternate stylesheet for Chosen (http://harvesthq.github.com/chosen/).
// This one is supposed to integrate better with Bootstrap.
//
// Submit bugfixes to: http://github.com/alxlit/bootstrap-chosen
//

@chznBackground: @inputBackground;
@chznBorder: @inputBorder;
@chznBorderRadius: @inputBorderRadius;
@chznBoxShadow: ~"inset 0 1px 1px rgba(0, 0, 0, .075)";
@chznDropBorder: @grayLight;
@chznDropBoxShadow: ~"0 8px 8px rgba(0, 0, 0, .25)";
@chznDropZIndex: 1060;
@chznFocusBorder: rgba(82, 168, 236, .8);
@chznFocusBoxShadow: ~"0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, 168, 236, .6)";
@chznFocusTransition: ~"border linear .2s, box-shadow linear .2s";
@chznHeight: @baseLineHeight + 8px; // 4px padding

.chosen            { width: 220px; }
.chosen-mini       { width: 70px; }
.chosen-small      { width: 100px; }
.chosen-medium     { width: 160px; }
.chosen-large      { width: 220px; }
.chosen-xlarge     { width: 280px; }
.chosen-xxlarge    { width: 540px; }

.chzn-container {
  display: inline-block;
  .ie7-inline-block;
  font-size: @baseFontSize;
  position: relative;
  vertical-align: middle;

  .chzn-drop {
    background: @chznBackground;
    border: 1px solid @chznDropBorder;
    border-top-color: lighten(@chznDropBorder, 25%);
    .border-radius(@chznBorderRadius);
    -webkit-border-top-left-radius: 0;
    -webkit-border-top-right-radius: 0;
    -moz-border-radius-topleft: 0;
    -moz-border-radius-topright: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    .box-shadow(@chznDropBoxShadow);
    margin-top: -1px;
    position: absolute;
    top: @chznHeight + 1px; // set dynamically
    left: 0;
    z-index: @chznDropZIndex;
  }

  .chzn-results {
    color: @gray;
    margin: 0 4px 4px 0;
    max-height: 240px;
    padding: 0 0 0 4px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    li {
      display: none;
      line-height: @baseLineHeight; // 15px;
      list-style: none;
      margin: 0;
      padding: 5px 6px;

      em {
        background: #feffde;
        font-style: normal;
      }
    }

    // &:empty {
    // border: none;
    // }

    .active-result {
      cursor: pointer;
      display: list-item;
    }

    .highlighted {
      background-color: @linkColor;
      color: @white;

      em {
        background: transparent;
      }
    }

    .no-results {
      background: @grayLighter;
      display: list-item;
    }

    .group-result {
      cursor: default;
      color: #999;
      font-weight: bold;
    }

    .group-option {
      padding-left: 15px;
    }
  }

  .chzn-results-scroll {
    background: @white;
    margin: 0 4px;
    position: absolute;
    text-align: center;
    width: 321px;
    z-index: 1;

    span {
      display: inline-block;
      height: @baseLineHeight; // 17px;
      text-indent: -5000px;
      width: 9px;
    }
  }

  .chzn-results-scroll-down {
    bottom: 0;
  }
}

.chzn-container-single {
  .chzn-single {
    background-color: @chznBackground;
    #gradient > .vertical(@white, @grayLighter);
    //.border-radius(5px);
    -webkit-background-clip: padding-box;
       -moz-background-clip: padding;
            background-clip: padding-box;
    border: 1px solid @chznBorder;
    .box-shadow(@chznBoxShadow);
    color: @gray;
    display: block;
    height: @chznHeight;
    overflow: hidden;
    line-height: @chznHeight;
    padding: 0 0 0 8px;
    position: relative;
    text-decoration: none;
    white-space: nowrap;

    span {
      display: block;
      margin-right: 26px;
      .text-overflow();
    }

    abbr {
      display: block;
      font-size: 1px;
      height: 10px;
      position: absolute;
      right: 26px;
      top: 8px;
      width: 12px;

      &:hover {
        background-position: right -11px;
      }
    }

    &.chzn-disabled .chzn-single abbr:hover {
      background-position: right 2px;
    }

    div {
      display: block;
      height: 100%;
      position: absolute;
      top: 0;
      right: 0;
      width: 18px;

      b {
        display: block;
        height: 100%;
        width: 100%;
      }
    }
  }

  .chzn-default {
    color: @grayLight;
  }

  .chzn-search {
    margin: 0;
    padding: 3px 4px;
    position: relative;
    white-space: nowrap;
    z-index: @zindexDropdown;

    input {

      border: 1px solid @chznBorder;
      .border-radius(@chznBorderRadius);
      .box-shadow(@chznBoxShadow);
      margin: 1px 0;
      padding: 4px 20px 4px 4px;
    }
  }

  .chzn-drop {
    .border-radius(@chznBorderRadius);
    -webkit-border-top-left-radius: 0;
    -webkit-border-top-right-radius: 0;
    -moz-border-radius-topleft: 0;
    -moz-border-radius-topright: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    -webkit-background-clip: padding-box;
       -moz-background-clip: padding;
            background-clip: padding-box;
  }
}

.chzn-container-single-nosearch {
  .chzn-search {
    input {
      position: absolute;
      left: -9000px;
    }
  }
}

.chzn-container-multi {
  .chzn-choices {
    background-color: @chznBackground;
    border: 1px solid @chznBorder;
    .border-radius(@chznBorderRadius);
    .box-shadow(@chznBoxShadow);
    cursor: text;
    height: auto !important;
    height: 1%;
    margin: 0;
    overflow: hidden;
    padding: 0;
    position: relative;

    li {
      float: left;
      list-style: none;
    }

    .search-field {
      margin: 0;
      padding: 0;
      white-space: nowrap;

      input {
        background: transparent !important;
        border: 0 !important;
        .box-shadow(none);
        color: @gray;
        height: @chznHeight - 8px;
        margin: 0;
        padding: 4px;
        outline: 0;
      }

      .default {
        color: #999;
      }
    }

    .search-choice {
      -webkit-background-clip: padding-box;
         -moz-background-clip: padding;
              background-clip: padding-box;
      background-color: @grayLighter;
      border: 1px solid @chznBorder;
      .border-radius(@chznBorderRadius);
      #gradient > .vertical(@white, @grayLighter);
      .box-shadow(@chznBoxShadow);
      color: @grayDark;
      cursor: default;
      line-height: 13px;
      margin: 3px 0 3px 5px;
      padding: 3px 20px 3px 5px;
      position: relative;

      .search-choice-close {
        display: block;
        font-size: 1px;
        height: 13px;
        position: absolute;
        right: 3px;
        top: 4px;
        width: 12px;

        &:hover {
          background-position: right -11px;
        }
      }
    }

    .search-choice-focus {
      background: #d4d4d4;

      .search-choice-close {
        background-position: right -11px;
      }
    }
  }

  .chzn-results {
    margin: 0 0 0 0;
    padding: 0;
  }

  .chzn-drop {
    .result-selected {
      display: none;
    }
  }
}

.chzn-container-active {
  .chzn-single {
    border: 1px solid @chznFocusBorder;
    .box-shadow(@chznFocusBoxShadow);
    .transition(@chznFocusTransition);
  }

  .chzn-single-with-drop {
    background-color: @grayLighter;
    border: 1px solid @chznFocusBorder;
    .box-shadow(@chznFocusBoxShadow);
    .transition(@chznFocusTransition);

    div {
      background: transparent;
      border-left: none;

      b {
        background-position: -18px 2px;
      }
    }
  }

  .chzn-choices {
    border: 1px solid @chznFocusBorder;
    -webkit-border-bottom-left-radius: 0;
    -webkit-border-bottom-right-radius: 0;
       -moz-border-radius-bottomleft: 0;
       -moz-border-radius-bottomright: 0;
            border-bottom-left-radius: 0;
            border-bottom-right-radius: 0;
    .box-shadow(@chznFocusBoxShadow);
    .transition(@chznFocusTransition);

    .search-field input {
      color: #111 !important;
    }
  }
}

.chzn-disabled {
  cursor: default;
  opacity: 0.5 !important;

  .chzn-single {
    cursor: default;
  }

  .chzn-choices .search-choice .search-choice-close {
    cursor: default;
  }
}

.chzn-rtl {
  text-align: right;

  .chzn-single {
    padding: 0 8px 0 0;
    overflow: visible;

    span {
      margin-left: 26px;
      margin-right: 0;
      direction: rtl;
    }

    div {
      left: 3px;
      right: auto;
    }

    abbr {
      left: 26px;
      right: auto;
    }
  }

  .chzn-choices {
    .search-field input {
      direction: rtl;
    }

    li {
      float: right;
    }

    .search-choice {
      margin: 3px 5px 3px 0;
      padding: 3px 5px 3px 19px;

      .search-choice-close {
        background-position: right top;
        left: 4px;
        right: auto;
      }
    }
  }

  &.chzn-container-single .chzn-results {
    margin: 0 0 4px 4px;
    padding: 0 4px 0 0;
  }

  .chzn-results .group-option {
    padding-left: 0;
    padding-right: 15px;
  }

  &.chzn-container-active .chzn-single-with-drop div {
    border-right: none;
  }

  .chzn-search input {
    direction: rtl;
    padding: 4px 5px 4px 20px;
  }
}


