/* Type-to-search on the procedure boxes (js/procedure-search.js). */

/* The search box sits in the same .form-group as the real select; the menu is
   positioned inside that group, so it goes away with its row. */
.gps-procsearch-wrap {
  position: relative;
}

/* The real select is hidden VISUALLY only: still 1px "visible" to jQuery, so
   the required check, the red highlight and "Please Select a Procedure" keep
   working on it. Never display:none. Only added by the script, so without
   JavaScript the plain select shows as before. */
select.form-control.gps-procsearch-native,
.gps-procsearch-native {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  opacity: 0 !important;
  pointer-events: none;
}

/* The box is a one-row textarea that grows to the whole procedure name,
   wrapped over as many lines as it takes (js/procedure-search.js fitBox), so
   a long name is never cut off, on a phone too. One line tall when empty,
   the height of the other boxes. */
textarea.form-control.gps-procsearch-input {
  resize: none;
  overflow: hidden;
  height: auto;
  min-height: calc(1.5em + .75rem + 2px);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gps-procsearch-input.gps-procsearch-unresolved {
  border-color: #f0ad4e;
}

.gps-procsearch-hint {
  color: #8a6d3b;
  font-size: 0.875rem;
  margin-top: 4px;
}

.ui-autocomplete.gps-procsearch-menu {
  max-height: 50vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1060;
  box-sizing: border-box;
  padding: 0;
  list-style: none;
  font-size: 1rem;
  font-family: inherit; /* the jQuery UI theme would set Arial */
}

.ui-autocomplete.gps-procsearch-menu .ui-menu-item-wrapper {
  white-space: normal;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  min-height: 44px;
  padding: 10px 12px;
  box-sizing: border-box;
}

.ui-autocomplete.gps-procsearch-menu .gps-procsearch-name {
  display: block;
}

.ui-autocomplete.gps-procsearch-menu .gps-procsearch-note {
  display: block;
  font-size: 0.8rem;
  color: #6c757d;
}

.ui-autocomplete.gps-procsearch-menu .ui-state-active .gps-procsearch-note {
  color: inherit;
}

.ui-autocomplete.gps-procsearch-menu .gps-procsearch-section {
  padding: 6px 12px 4px;
  font-size: 0.8rem;
  font-weight: bold;
  color: #495057;
  background: #f1f3f5;
  border-top: 1px solid #dee2e6;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: default;
}

.ui-autocomplete.gps-procsearch-menu .gps-procsearch-section:first-child {
  border-top: 0;
}
