/* Outer layout for dash dropdown */
div.dash-dropdown {
  background-color: var(--field-enabled);
  border: none;
  border-radius: 0;
  box-shadow: var(--elevation-0);
  font-size: 0.875rem;
}

/* Dropdown menu when clicking on expand arrow */
div.Select-menu-outer {
  background-color: var(--field-enabled);
  border: none;
  border-radius: 0;
  box-shadow: var(--elevation-0);
  font-size: 0.875rem;
  line-height: 1.5rem;
  margin-top: 4px;
}

/* Dropdown menu options */
div.VirtualizedSelectOption {
  color: var(--text-primary);
  font-weight: 400;
}

/* Dropdown menu hover effect */
div.VirtualizedSelectFocusedOption {
  background-color: var(--stateOverlays-hover);
}

/* Input box for existing values and user input */
div.Select-control {
  background-color: inherit;
  border: inherit;
  border-radius: inherit;
  height: 32px;
}

div.Select.is-focused > .Select-control {
  background-color: var(--field-enabled);
}

/* User input */
div.dash-dropdown .Select-input {
  display: block;
  height: 24px;
  margin-left: unset;
}

div.Select-input > input {
  height: 100%;
  padding: 0 !important; /* Required so tags don't jump caused by adding table (it was padding-bottom in branch) */
}

/* Border on focus */
div.is-focused:not(.is-open) > .Select-control {
  box-shadow: 0 0 0 2px var(--focus) inset;
}

/* Single-select dropdown only ------------------- */
div.Select--single .Select-value {
  padding-left: 0.5rem;
}

/* Tags --------------------------- */
div.Select--multi .Select-value {
  background-color: var(--dropdown-label-bg);
  border: 0;
  border-radius: 0;
  box-shadow: var(--elevation-0);
  color: var(--text-secondary);
  font-size: 0.875rem;
  height: 100%;
  letter-spacing: -0.112px;
  margin: 0;
  padding: 0 0.25rem;
  vertical-align: baseline;
}

/* Tag: Label */
div.Select--multi .Select-value-label {
  color: var(--text-primary);
  line-height: 1.5rem;
  padding: 0 4px;
}

/* Tag: Cross */
div.Select--multi .Select-value-icon {
  background: inherit;
  border: none;
  color: var(--text-secondary);
  line-height: inherit;
  margin: 0;
  padding: 0;
}

/* Tag: Cross on hover */
div.Select--multi .Select-value-icon:hover {
  background: inherit;
  color: var(--text-secondary);
}

/* Tag: Arrow */
span.Select-arrow-zone {
  padding-right: 8px;
  width: 16px;
}

div.has-value.Select--single
  > .Select-control
  .Select-value
  .Select-value-label,
div.has-value.is-pseudo-focused.Select--single
  > .Select-control
  .Select-value
  .Select-value-label {
  color: var(
    --text-primary
  ) !important; /* Required so text color don't change caused by adding table */
}

/* Page Selector Dropdown */
div.dash-dropdown .Select-menu-outer {
  margin-top: 0;
}

div.Select-menu-outer .VirtualizedSelectSelectedOption > a {
  pointer-events: none;
}

div.dash-dropdown .Select-menu-outer .VirtualizedSelectOption > a {
  height: 100%;
  width: 100%;
}

div.Select--multi .Select-clear-zone {
  display: none;
}

/** spacing for tag elements only when elements are present inside
wrapper **/

div.Select-multi-value-wrapper,
div.Select--multi .Select-multi-value-wrapper {
  align-items: center;
  display: flex;
  min-height: 32px;
}

div.Select--multi .Select-multi-value-wrapper {
  padding-left: 8px;
}

div.Select--multi.has-value .Select-multi-value-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 90px;
  overflow: auto;
  padding: 4px 8px;
}

div.dropdown .VirtualizedSelectOption:nth-child(1):has(> div) {
  border-bottom: 1px solid var(--border-subtleAlpha01);
  padding: 8px 4px;
}

.dropdown-select-all {
  display: flex;
  gap: 8px;
}

.dropdown .form-label {
  align-items: baseline;
}

/* When you click "Select All", it flashes up very quickly in the selected items before update_dropdown_select_all
 is executed to remove it. So we hide the option altogether to prevent this flicker. */
div.Select--multi .Select-value:has(.dropdown-select-all) {
    display: none;
}

.dash-dropdown .Select.is-focused:not(.is-open) > .Select-control {
  background: inherit;
}

.dash-dropdown .Select-clear-zone:hover {
  color: var(--text-primaryHover);
}
