/*
 * EvrSelect — custom dark-theme dropdown component.
 * Replaces every native <select> on the page with a styled <div> while
 * keeping the original <select> hidden for form-data parity.
 */

.evr-select {
  position: relative;
  display: block;
  width: 100%;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  user-select: none;
}

.evr-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-family: inherit;
  font-weight: 400;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
  text-align: left;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  line-height: 1.4;
}

.evr-select-trigger:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.evr-select-trigger:focus-visible {
  border-color: rgba(96, 165, 250, 0.5);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.12);
}

.evr-select.open > .evr-select-trigger {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.evr-select-value {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.evr-select-value.placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.evr-select-arrow {
  margin-left: 14px;
  flex-shrink: 0;
  color: rgba(96, 165, 250, 0.75);
  display: inline-flex;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.evr-select.open .evr-select-arrow {
  transform: rotate(180deg);
}

.evr-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #131319;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.02),
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
  padding: 6px;
  z-index: 1000;
  max-height: 320px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top center;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.evr-select.open > .evr-select-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* When the menu would open below the viewport, drop it upward instead */
.evr-select.menu-up > .evr-select-menu {
  top: auto;
  bottom: calc(100% + 6px);
  transform-origin: bottom center;
}

.evr-select-menu::-webkit-scrollbar {
  width: 8px;
}
.evr-select-menu::-webkit-scrollbar-track {
  background: transparent;
}
.evr-select-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  border: 2px solid #131319;
}
.evr-select-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.20);
}

/* optgroup section header */
.evr-select-group {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
  padding: 14px 12px 6px;
  margin: 0;
  pointer-events: none;
  user-select: none;
}
.evr-select-group:first-child {
  padding-top: 6px;
}

.evr-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
  line-height: 1.4;
}

.evr-select-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.95);
}

.evr-select-option.selected {
  background: rgba(52, 211, 153, 0.08);
  color: #34d399;
}

.evr-select-option.selected::after {
  content: '';
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 6l3 3 5-6' stroke='%2334d399' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
}

.evr-select-option.selected:hover {
  background: rgba(52, 211, 153, 0.14);
  color: #34d399;
}

.evr-select-option.focused {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.95);
}

.evr-select-option.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Hide the underlying native select but keep it in the form */
select.evr-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

/* ── EvrTip — body-attached tooltip ── */

.evr-tip {
  position: fixed;
  top: 0;
  left: 0;
  background: #0b0b10;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 400;
  padding: 10px 14px;
  border-radius: 9px;
  max-width: 280px;
  text-align: left;
  line-height: 1.55;
  pointer-events: none;
  opacity: 0;
  z-index: 99999;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: opacity 0.18s ease;
  letter-spacing: 0;
  white-space: normal;
  display: none;
}

.evr-tip.show {
  display: block;
  opacity: 1;
}

/* Arrow pointing down (default — tooltip is above the target) */
.evr-tip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #0b0b10;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.06));
}

.evr-tip.below::after {
  bottom: auto;
  top: -6px;
  border-top: none;
  border-bottom: 6px solid #0b0b10;
}

/* The little (?) circle that triggers the tooltip */
.help-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.10);
  color: rgba(96, 165, 250, 0.85);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  margin-left: 7px;
  cursor: help;
  border: 1px solid rgba(96, 165, 250, 0.22);
  vertical-align: middle;
  transition: all 0.15s ease;
  text-transform: none;
  letter-spacing: 0;
  user-select: none;
}

.help-q::before { content: '?'; }

.help-q:hover {
  background: rgba(96, 165, 250, 0.22);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.45);
  transform: scale(1.08);
}
