/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com

Version 1.5.1
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011-2016 Harvest http://getharvest.com

MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
*/

.chosen-container {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  text-align: left;

  a {
    cursor: pointer;
  }

  .chosen-drop {
    position: absolute;
    top: 100%;
    left: -9999px;
    z-index: 1010;
    width: 100%;
    border: 1px solid $neutral-600;
    border-top: 0;
    background: $white;
  }

  .search-choice, .chosen-single {
    .group-name {
      margin-right: 4px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      font-weight: normal;
      color: $neutral-600;

      &:after {
        content: ":";
        padding-left: 2px;
        vertical-align: top;
      }
    }
  }

  .chosen-results {
    color: $neutral-800;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0 4px 4px 0;
    padding: 0 0 0 4px;
    max-height: 240px;
    -webkit-overflow-scrolling: touch;

    li {
      display: none;
      margin: 0;
      padding: 5px 6px;
      list-style: none;
      line-height: 13px;
      word-wrap: break-word;
      -webkit-touch-callout: none;

      &.active-result {
        display: list-item;
        cursor: pointer;
      }

      &.disabled-result {
        display: list-item;
        color: $neutral-400;
        cursor: default;
      }

      &.highlighted {
        background: $form-accent;
        color: $white;
      }
    }
  }

  &.chosen-with-drop {
    .chosen-drop {
      left: 0;
    }
  }
}

.chosen-container-single {
  .chosen-single {
    position: relative;
    display: block;
    overflow: hidden;
    padding: 2px 5px;
    height: $input-height;
    border: 1px solid $neutral-600;
    border-radius: $input-border-radius;
    background-color: $white;
    background-clip: padding-box;
    // color: $neutral-800;
    text-decoration: none;
    white-space: nowrap;
    // line-height: 24px;
    display: flex;
    align-items: center;

    div {
      margin-left: auto;

      b {
        display: block;
        width: 100%;
        height: 100%;
        background: url('[{$dir_images}]chosen/chosen-sprite.png') no-repeat 0px 2px;
      }
    }

    span {
      display: block;
      overflow: hidden;
      margin-right: 26px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    abbr {
      position: absolute;
      top: 6px;
      right: 26px;
      display: block;
      width: 12px;
      height: 12px;
      background: url('[{$dir_images}]chosen/chosen-sprite.png') -42px 1px no-repeat;
      font-size: 1px;

      &:hover {
        background-position: -42px -10px;
      }
    }
  }

  .chosen-default {
    color: $neutral-600;
  }

  .chosen-single-with-deselect {
    span {
      margin-right: 38px;
    }
  }

  .chosen-search {
    position: relative;
    z-index: 1010;
    margin: 0;
    padding: 3px 4px;
    white-space: nowrap;

    input[type="text"] {
      margin: 1px 0;
      padding: 4px 20px 4px 5px;
      width: 100%;
      height: auto;
      outline: 0;
      border: 1px solid #aaa;
      background: white url('[{$dir_images}]chosen/chosen-sprite.png') no-repeat 100% -20px;
      background: url('[{$dir_images}]chosen/chosen-sprite.png') no-repeat 100% -20px;
      font-size: 1em;
      font-family: sans-serif;
      line-height: normal;
      border-radius: 0;
    }
  }

  &.chosen-disabled .chosen-single abbr:hover {
    background-position: -42px -10px;
  }
}

.chosen-container-single .chosen-drop {
  margin-top: -1px;
  border-radius: 0 0 4px 4px;
  background-clip: padding-box;
}

.chosen-container-single.chosen-container-single-nosearch .chosen-search {
  position: absolute;
  left: -9999px;
}

.chosen-container .chosen-results li.no-results {
  color: $neutral-600;
  display: list-item;
  background: $neutral-200;
}

.chosen-container .chosen-results li.group-result {
  display: list-item;
  font-weight: bold;
  cursor: default;
}

.chosen-container .chosen-results li.group-option {
  padding-left: 15px;
}

.chosen-container .chosen-results li em {
  font-style: normal;
  text-decoration: underline;
}

.chosen-container-multi {
  .chosen-choices {
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 2px 5px;
    width: 100%;
    min-height: $input-height;
    height: auto !important;
    border: 1px solid $neutral-600;
    background-color: $white;
    cursor: text;

    li {
      float: left;
      list-style: none;

      &.search-field {
        margin: 0;
        padding: 0;
        white-space: nowrap;

        input[type="text"] {
          margin: 0;
          padding: 0;
          height: 26px;
          outline: 0;
          border: 0 !important;
          background: transparent !important;
          box-shadow: none;
          color: $neutral-600;
          // font-size: 100%;
          // font-family: sans-serif;
          // line-height: normal;
          // border-radius: 0;
        }
      }

      &.search-choice {
        position: relative;
        margin: 1px 5px 1px 0;
        padding: 2px 20px 2px 5px;
        border: 1px solid #aaa;
        max-width: 100%;
        border-radius: 3px;
        background-color: $neutral-200;
        background-size: 100% 19px;
        background-repeat: repeat-x;
        background-clip: padding-box;
        // color: #333;
        line-height: 18px;
        cursor: default;

        span {
          word-wrap: break-word;
        }

        .search-choice-close {
          position: absolute;
          top: 6px;
          right: 3px;
          display: block;
          width: 12px;
          height: 12px;
          background: url('[{$dir_images}]chosen/chosen-sprite.png') -42px 1px no-repeat;
          font-size: 1px;

          &:hover {
            background-position: -42px -10px;
          }
        }
      }

      &.search-choice-disabled {
        padding-right: 5px;
        border: 1px solid #ccc;
        background-color: $neutral-200;
        color: #666;
      }

      &.search-choice-focus {
        background: #d4d4d4;

        .search-choice-close {
          background-position: -42px -10px;
        }
      }
    }
  }
}

.chosen-container-multi .chosen-results {
  margin: 0;
  padding: 0;
}

.chosen-container-multi .chosen-drop .result-selected {
  display: list-item;
  color: #ccc;
  cursor: default;
}

.chosen-container-active {
  .chosen-single {
    border: 1px solid $form-accent;
  }

  .chosen-choices {
    border: 1px solid $form-accent;

    li.search-field input[type="text"] {
      color: #222 !important;
    }
  }

  &.chosen-with-drop .chosen-single {
    // border: 1px solid #aaa;
    // -moz-border-radius-bottomright: 0;
    // border-bottom-right-radius: 0;
    // -moz-border-radius-bottomleft: 0;
    // border-bottom-left-radius: 0;

    div {
      border-left: none;
      background: transparent;

      b {
        background-position: -18px 2px;
      }
    }
  }
}

.chosen-disabled {
  opacity: 0.5 !important;
  cursor: default;

  .chosen-single {
    cursor: default;
  }

  .chosen-choices .search-choice .search-choice-close {
    cursor: default;
  }
}

@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) {
  .chosen-container-single .chosen-single abbr,
  .chosen-container-single .chosen-single div b,
  .chosen-container-single .chosen-search input[type="text"],
  .chosen-container-multi .chosen-choices .search-choice .search-choice-close,
  .chosen-container .chosen-results-scroll-down span,
  .chosen-container .chosen-results-scroll-up span {
    background-image: url('[{$dir_images}]chosen/chosen-sprite@2x.png') !important;
    background-size: 52px 37px !important;
    background-repeat: no-repeat !important;
  }
}
