/**
 * nv-select — custom dropdown (DS chip trigger + floating menu)
 */

.nv-select-wrap {
  position: relative;
  display: inline-flex;
  width: auto;
  flex-shrink: 0;
}

.nv-select-wrap--chip {
  --nv-select-height: 32px;
}

select.nv-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nv-select__trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--nv-select-height, var(--control-height-md, 41px));
  padding: 0 32px 0 14px;
  border: none;
  border-radius: 999px;
  background: var(--dash-surface);
  color: var(--dash-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dash-transition), color var(--dash-transition);
}

.nv-select__trigger:hover {
  background: var(--dash-surface-hover);
  color: var(--dash-text);
}

.nv-select-wrap.is-open .nv-select__trigger {
  background: var(--dash-surface-hover);
  color: var(--dash-text);
}

.nv-select__trigger:focus-visible {
  outline: 2px solid var(--dash-accent-focus);
  outline-offset: 2px;
}

.nv-select__chev {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  opacity: 0.5;
  pointer-events: none;
  transition: transform 150ms ease, opacity 150ms ease;
}

.nv-select-wrap.is-open .nv-select__chev {
  transform: translateY(-50%) rotate(180deg);
  opacity: 0.85;
}

.nv-select__chev svg {
  display: block;
  width: 14px;
  height: 14px;
}

.nv-select__menu {
  position: fixed;
  z-index: var(--dash-popover-z, 1600);
  min-width: 180px;
  max-height: min(52vh, 340px);
  padding: 6px;
  margin: 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--dash-popover-bg, #222222);
  box-shadow: var(--dash-popover-shadow, 0 16px 48px rgba(0, 0, 0, 0.45));
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 150ms ease, visibility 150ms ease;
}

/* Menu may live in body when open — do not rely on .nv-select-wrap ancestor */
.nv-select__menu:not([hidden]),
.nv-select__menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nv-select__menu-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(52vh, 328px);
  overflow-y: auto;
  background: var(--dash-popover-bg, #222222);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.nv-select__option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: var(--dropdown-option-padding-y, 10px) var(--dropdown-option-padding-x, 14px);
  padding-right: var(--dropdown-option-selected-padding-right, 36px);
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--dash-text);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background 150ms ease;
}

.nv-select__option:hover,
.nv-select__option.is-focused {
  background: rgba(255, 255, 255, 0.06);
}

.nv-select__option.is-selected {
  background: rgba(255, 255, 255, 0.06);
}

.nv-select__option.is-selected::after {
  content: '';
  position: absolute;
  right: var(--dropdown-check-right, 14px);
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}

.nv-select__menu:not([hidden]) .nv-select__option.is-selected,
.nv-select__menu.is-open .nv-select__option.is-selected {
  display: none;
}
