/* ============================================================
   NEO-DROPDOWN — Modern Custom Select Component
   Auto-wraps every <select class="form-input|form-select">.
   Native <select> stays in DOM (visually hidden), so
   .value / change events / DOM observers keep working.
   ============================================================ */

.neo-select {
  --neo-bg:            #ffffff;
  --neo-bg-hover:      #f8fafc;
  --neo-bg-open:       #ffffff;
  --neo-border:        rgba(0, 0, 0, .10);
  --neo-border-hover:  rgba(0, 0, 0, .18);
  --neo-border-open:   var(--neo-accent);
  --neo-text:          #1A1A1A;
  --neo-muted:         #94A3B8;
  --neo-accent:        #E0813F;
  --neo-accent-2:      #FF934A;
  --neo-accent-soft:   rgba(224, 129, 63, .08);
  --neo-accent-ring:   rgba(224, 129, 63, .14);
  --neo-radius:        8px;
  --neo-radius-sm:     8px;
  --neo-radius-lg:     10px;
  --neo-shadow-soft:   none;
  --neo-shadow-pop:    0 8px 24px -8px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .04);

  position: relative;
  user-select: none;
  outline: none;
  font-family: 'Cairo', sans-serif;
  width: 100%;
  display: block;
}

/* �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
   TRIGGER (closed state)
   �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�? */
.neo-select__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 6px 10px 6px 12px;
  border-radius: var(--neo-radius);
  background: var(--neo-bg);
  border: 1px solid var(--neo-border);
  cursor: pointer;
  box-shadow: var(--neo-shadow-soft);
  transition:
    border-color .15s ease,
    background   .15s ease,
    box-shadow   .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.neo-select__trigger:hover {
  background: var(--neo-bg-hover);
  border-color: var(--neo-border-hover);
}

/* Open state */
.neo-select--open .neo-select__trigger {
  background: var(--neo-bg-open);
  border-color: var(--neo-border-open);
  box-shadow: 0 0 0 3px var(--neo-accent-ring);
}

/* Keyboard focus */
.neo-select:focus-visible {
  outline: none;
}
.neo-select:focus-visible .neo-select__trigger {
  border-color: var(--neo-accent);
  box-shadow: 0 0 0 3px var(--neo-accent-ring);
}

/* ── Left icon — minimal, neutral, only shown when explicitly opted in ──
   Hidden by default to keep dropdowns calm. Add .neo-select--with-icon
   on the host to bring it back for special-purpose selects. */
.neo-select__icon {
  display: none;
}
.neo-select--with-icon .neo-select__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neo-muted);
  box-shadow: none;
}
.neo-select--with-icon .neo-select__icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
}

/* ── Value label ── */
.neo-select__value {
  flex: 1;
  min-width: 0;
  font-size: .875rem;
  font-weight: 500;
  color: var(--neo-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .15s;
  text-align: start;
}
.neo-select--has-value .neo-select__value {
  color: var(--neo-text);
  font-weight: 500;
}

/* ── Chevron arrow ── */
.neo-select__chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: transparent;
  color: var(--neo-muted);
  transition:
    transform .22s cubic-bezier(.4, 0, .2, 1),
    color     .15s;
}
.neo-select__chevron svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}
.neo-select__trigger:hover .neo-select__chevron {
  color: var(--neo-text);
}
.neo-select--open .neo-select__chevron {
  transform: rotate(180deg);
  color: var(--neo-accent);
}

/* �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
   DROPDOWN PANEL
   �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�? */
.neo-select__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--neo-bg);
  border-radius: var(--neo-radius-lg);
  box-shadow: var(--neo-shadow-pop);
  border: 1px solid var(--neo-border);
  overflow: hidden;
  z-index: 500;
  max-height: min(340px, 60vh);
  display: flex;
  flex-direction: column;

  /* hidden / closed */
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  pointer-events: none;
  transition:
    opacity   .22s cubic-bezier(.4, 0, .2, 1),
    transform .22s cubic-bezier(.4, 0, .2, 1);
  transform-origin: top center;
}

.neo-select--open .neo-select__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Option list ── */
.neo-select__list {
  list-style: none;
  margin: 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Make the list scrollable within the panel's max-height */
  flex: 1 1 auto;
  min-height: 0;        /* required for flex children to allow shrinking + scrolling */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--neo-border) transparent;
}
.neo-select__list::-webkit-scrollbar { width: 6px; }
.neo-select__list::-webkit-scrollbar-thumb {
  background: var(--neo-border);
  border-radius: 3px;
}
.neo-select__list::-webkit-scrollbar-thumb:hover {
  background: var(--neo-muted);
}

/* ── Single option ── */
.neo-select__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--neo-radius-sm);
  cursor: pointer;
  font-size: .88rem;
  font-weight: 500;
  color: var(--neo-text);
  transition:
    background .14s ease,
    color      .14s ease,
    transform  .1s  ease;
  position: relative;
  min-height: 40px;
}

/* hover */
.neo-select__option:hover {
  background: var(--neo-accent-soft);
  color: var(--neo-accent);
}

/* keyboard-focused */
.neo-select__option--focused {
  background: var(--neo-accent-soft);
  color: var(--neo-accent);
  box-shadow: inset 0 0 0 1.5px var(--neo-accent-ring);
}

/* selected */
.neo-select__option--selected {
  background: var(--neo-accent-soft);
  color: var(--neo-accent);
  font-weight: 700;
  padding-right: 32px;
}
.neo-select__option--selected:hover {
  background: rgba(224, 129, 63, .15);
}

/* checkmark for selected option */
.neo-select__option--selected::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background: var(--neo-accent);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/contain no-repeat;
}
[dir="rtl"] .neo-select__option--selected {
  padding-right: 12px;
  padding-left: 32px;
}
[dir="rtl"] .neo-select__option--selected::after {
  right: auto;
  left: 12px;
}

/* ── Option emoji/icon ── */
.neo-select__opt-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

/* ── Option text ── */
.neo-select__opt-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Option sub-label (optional) ── */
.neo-select__opt-sub {
  font-size: .7rem;
  color: var(--neo-muted);
  font-weight: 400;
  margin-left: 6px;
}

/* �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
   EMPTY STATE
   �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�? */
.neo-select__empty {
  padding: 18px 14px;
  text-align: center;
  font-size: .82rem;
  color: var(--neo-muted);
  font-style: italic;
}

/* �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
   DISABLED STATE
   �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�? */
.neo-select--disabled {
  opacity: .55;
  pointer-events: none;
}
.neo-select--disabled .neo-select__trigger {
  background: var(--gray-50, #f9fafb);
  cursor: not-allowed;
}

/* �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
   MOBILE
   �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�? */
@media (max-width: 600px) {
  .neo-select__trigger {
    min-height: 42px;
    padding: 6px 10px 6px 12px;
  }
  .neo-select--with-icon .neo-select__icon { width: 24px; height: 24px; }
  .neo-select__chevron { width: 24px; height: 24px; }
  .neo-select__option {
    min-height: 42px;
    padding: 10px 12px;
    font-size: .9rem;
  }
  .neo-select__panel {
    max-height: min(50vh, 320px);
  }
}

/* �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
   DARK THEME
   �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�? */
[data-theme="dark"] .neo-select {
  --neo-bg:           #0B0B0B;
  --neo-bg-hover:     #161616;
  --neo-bg-open:      #161616;
  --neo-border:       rgba(255, 255, 255, .10);
  --neo-border-hover: rgba(224, 129, 63, .55);
  --neo-text:         #FFFFFF;
  --neo-muted:        #9A9A9A;
  --neo-accent-soft:  rgba(224, 129, 63, .12);
  --neo-accent-ring:  rgba(224, 129, 63, .22);
  --neo-shadow-soft:  0 1px 2px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .04);
  --neo-shadow-pop:   0 18px 40px -8px rgba(0, 0, 0, .65), 0 4px 12px rgba(0, 0, 0, .35);
}
[data-theme="dark"] .neo-select__option:hover,
[data-theme="dark"] .neo-select__option--focused,
[data-theme="dark"] .neo-select__option--selected {
  background: rgba(224, 129, 63, .15);
  color: #FF934A;
}
[data-theme="dark"] .neo-select__list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .15);
}

/* �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
   REDUCED MOTION
   �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�? */
@media (prefers-reduced-motion: reduce) {
  .neo-select__trigger,
  .neo-select__panel,
  .neo-select__chevron,
  .neo-select__option,
  .neo-select__icon {
    transition: none !important;
  }
  .neo-select__option:hover,
  .neo-select__trigger:active {
    transform: none !important;
  }
}
