/* Tom Select — GPH wizard theme overrides
   Scoped via wrapperClass "gph-ts" set in the init options.
   Matches the .form-group select visual spec in match/index.html:
     font: DM Sans 0.92rem / #1E293B
     padding: 12px 14px (vertical + left; right reserved via --ts-pr-caret for caret)
     border: 2px solid #E2E8F0
     radius: 10px
     focus ring: 0 0 0 3px rgba(45,125,111,.1) + border #2D7D6F

   NOTE on specificity: Tom Select's rule `.ts-wrapper.single.input-active .ts-control`
   (0,4,0) overrides `.gph-ts.single .ts-control` (0,3,0) via `background` shorthand,
   and its `.ts-control:not(.rtl)` rule uses `!important` for padding-right. We use:
     - longhand padding-left/top/bottom (so the `background` shorthand reset is irrelevant)
     - `--ts-pr-caret` CSS variable to reserve right-side space the Tom Select way
     - `.ts-wrapper.gph-ts` (0,2,0) base + compound selectors where extra specificity is needed
     - `::after` pseudo-element for the caret icon (sidesteps `background-image` reset)
*/

.ts-wrapper.gph-ts {
  font-family: 'DM Sans', sans-serif;
  font-size: .92rem;
  color: var(--charcoal, #1E293B);
  --ts-pr-caret: 26px;
}

.ts-wrapper.gph-ts .ts-control {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: #fff;
  border: 2px solid var(--border, #E2E8F0);
  border-radius: 10px;
  padding-top: 12px;
  padding-bottom: 12px;
  padding-left: 14px;
  min-height: 46px;
  box-shadow: none;
  transition: border-color .2s, box-shadow .2s;
  cursor: pointer;
  position: relative;
}

/* Beat the `.ts-wrapper.single.input-active .ts-control { background: #fff }` reset
   (specificity 0,4,0) by matching 0,4,0 and loading later. */
.ts-wrapper.gph-ts.single .ts-control,
.ts-wrapper.gph-ts.single.input-active .ts-control {
  background: #fff;
}

/* Caret as a pseudo-element so we don't fight the `background` shorthand reset. */
.ts-wrapper.gph-ts.single .ts-control::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 12px;
  height: 8px;
  margin-top: -4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%2364748B'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
  transition: transform .15s ease;
}

.ts-wrapper.gph-ts.dropdown-active.single .ts-control::after {
  transform: rotate(180deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%232D7D6F'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}

.ts-wrapper.gph-ts .ts-control > input {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.3 !important;
}

.ts-wrapper.gph-ts .ts-control > input::placeholder {
  color: var(--charcoal-light, #64748B);
  opacity: 1;
}

.ts-wrapper.gph-ts.focus .ts-control {
  border-color: var(--primary, #2D7D6F);
  box-shadow: 0 0 0 3px rgba(45, 125, 111, .1);
  outline: none;
}

/* Dropdown panel */
.ts-wrapper.gph-ts .ts-dropdown {
  font-family: inherit;
  font-size: inherit;
  background: #fff;
  border: 2px solid var(--border, #E2E8F0);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 24px rgba(30, 41, 59, .08);
  margin-top: -2px;
  padding: 4px 0;
}

.ts-wrapper.gph-ts.dropdown-active .ts-control {
  border-radius: 10px 10px 0 0;
  border-bottom-color: var(--border, #E2E8F0);
}

.ts-wrapper.gph-ts .ts-dropdown .option {
  padding: 10px 14px;
  color: var(--charcoal, #1E293B);
  cursor: pointer;
  border-radius: 0;
}

.ts-wrapper.gph-ts .ts-dropdown .option.active {
  background: rgba(45, 125, 111, .08);
  color: var(--primary, #2D7D6F);
}

.ts-wrapper.gph-ts .ts-dropdown .option.selected {
  background: rgba(45, 125, 111, .15);
  color: var(--primary, #2D7D6F);
  font-weight: 600;
}

.ts-wrapper.gph-ts .ts-dropdown .option.selected.active {
  background: rgba(45, 125, 111, .2);
}

/* Highlight of matched search text */
.ts-wrapper.gph-ts .ts-dropdown [data-selectable] .highlight {
  background: rgba(45, 125, 111, .18);
  color: var(--primary, #2D7D6F);
  border-radius: 2px;
  padding: 0 1px;
}

.ts-wrapper.gph-ts .ts-dropdown .no-results {
  padding: 12px 14px;
  color: var(--charcoal-light, #64748B);
  font-style: italic;
}

/* Clear button (plugin-clear_button): align vertically and soften color */
.ts-wrapper.gph-ts.plugin-clear_button .clear-button {
  opacity: 0;
  right: 34px;
  color: var(--charcoal-light, #64748B);
}

.ts-wrapper.gph-ts.plugin-clear_button.has-items .clear-button {
  opacity: .6;
}

.ts-wrapper.gph-ts.plugin-clear_button.has-items .clear-button:hover {
  opacity: 1;
  color: var(--primary, #2D7D6F);
}
