/* ============================================================
   Global dashboard search (header).

   Built on dcc.Dropdown so filtering + keyboard navigation come for free;
   everything here restyles it to read as a search field rather than a picker:
   a magnifier, a pill shape, no dropdown arrow, and a results menu that sits
   above the banner.
   ============================================================ */

.gsearch {
  position: absolute;
  top: 18px;
  right: 26px;
  width: 310px;
  max-width: 42vw;
  z-index: 30;
}

/* Magnifier, drawn as an inline SVG so there is no extra asset to ship. */
.gsearch::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  pointer-events: none;
  z-index: 3;
  opacity: 0.55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2333454d' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* The field itself */
.gsearch .Select-control {
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(10, 25, 20, 0.16);
  transition: box-shadow .16s ease, border-color .16s ease, background .16s ease;
  cursor: text;
}
.gsearch .Select-control:hover { background: #ffffff; }

.gsearch .Select-placeholder,
.gsearch .Select--single > .Select-control .Select-value {
  line-height: 36px;
  padding-left: 38px;
  padding-right: 14px;
  font-size: 13.5px;
  color: #6a767d;
}
.gsearch .Select-input {
  height: 36px;
  padding-left: 38px;
}
.gsearch .Select-input > input {
  padding: 9px 0;
  font-size: 13.5px;
  color: #2b383f;
}

/* It's a search box, not a picker: hide the arrow, keep the clear affordance. */
.gsearch .Select-arrow-zone { display: none; }

.gsearch.is-focused:not(.is-open) > .Select-control,
.gsearch .is-focused:not(.is-open) > .Select-control {
  border-color: #2db29b;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(45, 178, 155, 0.28);
}

/* Results menu */
.gsearch .Select-menu-outer {
  margin-top: 7px;
  border: 1px solid #e3e9e6;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(10, 25, 20, 0.22);
  z-index: 60;
}
.gsearch .Select-menu { max-height: 320px; }
.gsearch .Select-option {
  font-size: 13.5px;
  padding: 10px 15px;
  color: #33454d;
}
.gsearch .Select-option.is-focused {
  background: #eafaf5;
  color: #0b7d6a;
}
.gsearch .Select-option.is-selected { background: #f4faf8; }
.gsearch .Select-noresults {
  font-size: 13px;
  padding: 12px 15px;
  color: #8b9a93;
}

/* On narrow screens the absolute pill would collide with the logo/nav, so it
   drops into the flow as a full-width field instead. */
@media (max-width: 900px) {
  .gsearch {
    position: static;
    width: 100%;
    max-width: 100%;
    margin: 12px auto 4px;
    padding: 0 16px;
  }
  .gsearch::before { left: 30px; }
}
