$breadcrumbBg: #f5f5f5;
$breadcrumbBorder: #E6E6E6;
$gray: #939393;
$emptyColor: #B3B3B3;
$optionBG: #f5f5f5;
$iconColor: #808080;
$errorBG: #D93A3C;
$focusBorder: #3397ff;
$focusShadow: #dcedff;

.root {
  position: relative;
  display: inline-block;
}

.is--open {
  composes: root;
}

.trigger {
  display: flex;
  align-items: center;
  padding: 16px;
  min-height: 50px;
  border: 1px solid $gray;
  user-select: none;
  cursor: pointer;
}

.triggerCaret {
  display: inline-block;
  background: transparent none repeat scroll 0 0;
  border: 5px solid transparent;
  border-top-color: $gray;
  margin-top: 5px;
  margin-left: 16px;

  .is--open & {
    margin-top: -5px;
    transform: rotate(180deg);
  }
}

.positionContainer {
  position: absolute;
  top: 100%;
  left: 50%;
  min-width: 400px;
  transform: translateX(-50%);
  z-index: 1;
}

.popover {
  min-width: 100%;

  .positionContainer & {
    // one-off for popover style in header
    // 0020 need to win when core-css loads after
    margin-top: 0px;
  }
}

.searchWrap {
  padding: 12px;
  position: relative;
}

// 0020 need to win when core-css loads after
.searchWrap .search {
  width: 100%;
  padding-right: 32px;
}

.search:disabled + .searchIconPosition {
  pointer-events: none;
}

.inputIconPosition {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.searchIcon,
.clearIcon {
  margin-top: -1px;
  font-size: 16px;
  color: $iconColor;
}

.clearTarget {
  display: flex;
  justify-content: center;
  height: 16px;
  width: 16px;
  padding: 0;
  line-height: 16px;
  border: 1px solid transparent;
  border-radius: 100%;
  cursor: pointer;
  background-color: inherit;

  &:focus {
    border-color: $focusBorder;
    box-shadow: 0 0 0 2px $focusShadow;
    outline: none;
  }

  &:hover {
    background-color: $iconColor;

    .clearIcon {
      color: white;
    }
  }
}

.crumbs {
  padding: 8px 12px;
  background-color: $breadcrumbBg;
  border-top: 1px solid $breadcrumbBorder;
  border-bottom: 1px solid $breadcrumbBorder;
}

.list {
  max-height: 350px;
  overflow-y: auto;
}

.listItem {
  display: block;
  text-decoration: none;
  color: inherit;
  list-style-type: none;
  cursor: pointer;
  padding: 8px 16px;
  font-size: 12px;

  &:hover {
    text-decoration: none;
    color: inherit;
  }
}

.listItemHighlight {
  composes: listItem;
  background-color: $optionBG;
}

.noResults {
  padding: 16px;
  font-size: 11px;
  font-style: italic;
  color: $emptyColor;
}

.clippedResults {
  padding: 16px;
  font-size: 11px;
  font-style: italic;
  color: $emptyColor;
}

.errorRow {
  position: absolute;
  width: 100%;
  height: 36px;
  max-height: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-left: 24px;
  padding-right: 24px;
  font-size: 12px;
  background-color: $errorBG;
  color: white;
  transition: max-height 0.5s linear;
}

.errorRowShow {
  composes: errorRow;
  max-height: 36px;
}

.errorTitle {
  font-weight: bold;
  margin-right: 4px;
}

.errorMessage {
}
