.global-select-wrapper {
  position: relative;
  width: 100%;
}

.global-select-native {
  position: absolute !important;
  inset: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 100% !important;
  height: 100% !important;
}

.global-select-display {
  position: relative;
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(107, 33, 168, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #faf7ff 100%);
  color: #6b21a8;
  font-weight: 600;
  padding: 10px 42px 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.global-select-wrapper:hover .global-select-display {
  border-color: rgba(124, 58, 237, 0.42);
}

.global-select-wrapper.is-open .global-select-display,
.global-select-wrapper:focus-within .global-select-display {
  border-color: #6b21a8;
  box-shadow: 0 0 0 3px rgba(107, 33, 168, 0.14);
}

.global-select-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.global-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  pointer-events: none;
  transition: transform 0.25s ease;
}

.global-select-wrapper.is-open .global-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.global-select-arrow::before,
.global-select-arrow::after {
  content: '';
  position: absolute;
  top: 45%;
  width: 8px;
  height: 2px;
  background: #6b21a8;
  border-radius: 2px;
}

.global-select-arrow::before {
  left: 0;
  transform: rotate(45deg);
}

.global-select-arrow::after {
  right: 0;
  transform: rotate(-45deg);
}

.global-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  /* At least as wide as the trigger, but grow so labels like “Published” are not clipped. */
  min-width: 100%;
  width: max-content;
  max-width: min(100vw - 1.5rem, 22rem);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 2px solid rgba(107, 33, 168, 0.2);
  box-shadow: 0 20px 60px rgba(107, 33, 168, 0.25), 0 0 30px rgba(190, 24, 93, 0.16);
  opacity: 0;
  visibility: hidden;
  /* Subtle nudge only — large translateY felt like the menu “flies in”. */
  transform: translateY(-3px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 1200;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.global-select-wrapper.is-open .global-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

/* Fixed-position menus (e.g. applicants table): fade only, no vertical slide. */
.global-select-wrapper.is-open .global-dropdown-menu.global-dropdown-menu--fixed-anchor {
  transform: translateY(0);
  transition: opacity 0.14s ease;
}

.global-select-wrapper:not(.is-open) .global-dropdown-menu.global-dropdown-menu--fixed-anchor {
  transform: translateY(0);
  transition: opacity 0.12s ease;
}

.global-dropdown-option {
  padding: 12px 14px;
  color: #6b21a8;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.global-dropdown-option:hover {
  background: linear-gradient(135deg, rgba(107, 33, 168, 0.08), rgba(190, 24, 93, 0.08));
  color: #7c3aed;
  transform: translateX(1px);
}

@media (prefers-reduced-motion: reduce) {
  .global-dropdown-menu {
    transform: none;
    transition: opacity 0.1s ease;
  }

  .global-select-wrapper.is-open .global-dropdown-menu {
    transform: none;
    transition: opacity 0.1s ease;
  }

  .global-dropdown-option {
    transition: none;
  }

  .global-dropdown-option:hover {
    transform: none;
  }
}

.global-dropdown-option.selected {
  background: linear-gradient(135deg, rgba(107, 33, 168, 0.16), rgba(190, 24, 93, 0.16));
  color: #6b21a8;
  font-weight: 700;
}

.global-dropdown-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Variant: cinematic hero (homepage search pill)
   Assign data-global-variant="cinematic" on the native select.
   -------------------------------------------------------------------------- */
.cinematic-search .global-select-variant--cinematic .global-select-display {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  min-height: unset;
  /* Reserve space for absolutely positioned .global-select-arrow (long labels ellipsis). */
  padding: 0 28px 0 0;
  color: #6b21a8;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.cinematic-search .global-select-variant--cinematic:hover .global-select-display {
  border: none;
  box-shadow: none;
}

.cinematic-search .global-select-variant--cinematic.is-open .global-select-display,
.cinematic-search .global-select-variant--cinematic:focus-within .global-select-display {
  border: none;
  box-shadow: none;
}

.cinematic-search .global-select-variant--cinematic .global-select-label {
  text-align: left;
}

.cinematic-search .global-select-variant--cinematic .global-select-arrow::before,
.cinematic-search .global-select-variant--cinematic .global-select-arrow::after {
  background: #6b21a8;
}

.cinematic-search .search-field--category-wrap:hover .global-select-variant--cinematic .global-select-arrow::before,
.cinematic-search .search-field--category-wrap:hover .global-select-variant--cinematic .global-select-arrow::after {
  background: #7c3aed;
}

.cinematic-search .global-select-variant--cinematic.is-open .global-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.cinematic-search .global-select-variant--cinematic .global-dropdown-menu {
  top: calc(100% + 14px);
  left: -55px;
  right: auto;
  width: calc(100% + 74px);
  max-width: none;
  max-height: 360px;
  border-radius: 20px;
  border-width: 1px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(107, 33, 168, 0.08);
  padding: 8px 7px;
}

.cinematic-search .global-select-variant--cinematic .global-dropdown-option {
  border-radius: 14px;
}
