/* AIRSPACE STANDOFF: Custom 3D Frosty White Glass Dropdown */

.custom-dropdown {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  min-width: 0;
}

.custom-dropdown.open {
  z-index: 6000;
}

.has-open-dropdown {
  overflow: visible !important;
  z-index: 6000 !important;
}

.custom-dropdown-trigger {
  background: var(--glass-3d-btn-bg);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--liquid-glass-border-top);
  color: var(--text-main);
  font-family: var(--font-untitled-sans);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-btn);
  outline: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  white-space: nowrap;
  box-sizing: border-box;
  transition: all 0.16s ease;
  min-width: 0;
  box-shadow: var(--glass-3d-btn-shadow);
  touch-action: manipulation;
}

.custom-dropdown-trigger:hover:not(:disabled),
.custom-dropdown.open .custom-dropdown-trigger {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  background: var(--glass-3d-btn-bg-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.custom-dropdown.disabled .custom-dropdown-trigger,
.custom-dropdown-trigger:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: none;
}

.cdd-label {
  font-size: 0.60rem;
  color: var(--color-moon-mist);
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.cdd-val {
  color: var(--color-pure-white);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.cdd-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.custom-dropdown.open .cdd-arrow {
  transform: rotate(180deg);
}

.custom-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(320px, calc(100vw - 20px));
  max-height: min(280px, 52vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(14, 14, 14, 0.96);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--liquid-glass-border-top);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.95), var(--glass-shadow);
  z-index: 6500;
  flex-direction: column;
  padding: 4px;
  gap: 2px;
  box-sizing: border-box;
}

.custom-dropdown.open .custom-dropdown-menu {
  display: flex;
}

.custom-dropdown-opt {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-moon-mist);
  font-family: var(--font-untitled-sans);
  font-size: 0.66rem;
  font-weight: 500;
  padding: 5px 8px;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-badge);
  transition: all 0.14s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  touch-action: manipulation;
}

.custom-dropdown-opt:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}

.custom-dropdown-opt.active {
  background: rgba(2, 132, 199, 0.35);
  color: #ffffff;
  font-weight: 700;
  border-color: var(--theme-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.custom-dropdown-opt:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#cdd-budget {
  flex-shrink: 0;
}

#cdd-budget .custom-dropdown-trigger {
  min-width: 140px;
}

.me-dropdown-container {
  width: 100%;
  min-width: 0;
}

.me-dropdown-container .custom-dropdown {
  width: 100%;
}

.me-dropdown-container .custom-dropdown-trigger {
  width: 100%;
  height: 32px;
  justify-content: space-between;
  padding: 4px 10px;
}

.me-dropdown-container .cdd-val {
  flex: 1 1 auto;
  text-align: left;
}

.me-dropdown-container .custom-dropdown-menu {
  width: 100%;
  max-width: 340px;
}

.inspection-entity-dropdown {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 220px;
}

.inspection-entity-dropdown .custom-dropdown {
  width: 100%;
}

.inspection-entity-dropdown .custom-dropdown-trigger {
  width: 100%;
  height: 28px;
  font-size: 0.62rem;
  justify-content: space-between;
  padding: 3px 8px;
}

.inspection-entity-dropdown .custom-dropdown-menu {
  max-width: 280px;
  max-height: 260px;
  z-index: 9999;
}

@media (max-width: 1024px) {
  .custom-dropdown-trigger {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    font-size: 0.66rem;
    height: 26px;
    padding: 2px 7px;
  }
  .custom-dropdown-menu {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: #0e0e0e !important;
  }
  #cdd-budget .custom-dropdown-trigger {
    min-width: 125px;
  }
}

@media (max-height: 550px) {
  .custom-dropdown-menu {
    max-height: min(180px, 46vh);
  }
}