/* Chatterfy HeroUI-style Custom Select, Autocomplete & MultiSelect (Exact right-side checkmark) */

.cfy-dd {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-width: 0;
}

.cfy-dd-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  height: 36px;
  padding: 0 10px 0 12px;
  border-radius: 12px;
  border: 1px solid #ffffff26;
  background: #1c2236;
  color: #ecedee;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.cfy-dd-sm .cfy-dd-trigger {
  min-height: 32px;
  height: 32px;
  padding: 0 8px 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.cfy-dd-lg .cfy-dd-trigger {
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 14px;
}

.cfy-dd-trigger:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.34);
  background: #222940;
}

.cfy-dd-trigger.open {
  border-color: #0384f6;
  box-shadow: 0 0 0 2px rgba(3, 132, 246, 0.24);
}

.cfy-dd-trigger:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Status tinted variants (Active = green, Stopped = red) */
.cfy-dd-tone-active .cfy-dd-trigger {
  background: rgba(23, 201, 100, 0.14);
  border-color: rgba(23, 201, 100, 0.45);
  color: #17c964;
}

.cfy-dd-tone-active .cfy-dd-chev,
.cfy-dd-tone-active .cfy-dd-clear {
  color: #17c964;
}

.cfy-dd-tone-stopped .cfy-dd-trigger {
  background: rgba(243, 18, 96, 0.14);
  border-color: rgba(243, 18, 96, 0.45);
  color: #f31260;
}

.cfy-dd-tone-stopped .cfy-dd-chev,
.cfy-dd-tone-stopped .cfy-dd-clear {
  color: #f31260;
}

.cfy-dd-value {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cfy-dd-placeholder {
  color: #a1a1aa;
}

.cfy-dd-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.cfy-dd-clear {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #a1a1aa;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.cfy-dd-clear:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.cfy-dd-chev {
  display: inline-grid;
  place-items: center;
  color: #a1a1aa;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cfy-dd-trigger.open .cfy-dd-chev {
  transform: rotate(180deg);
}

/* Exact HeroUI Popover ListBox (var(--overlay) #0f1b2b, rounded-2xl, shadow) */
.cfy-dd-menu {
  position: fixed;
  z-index: 250;
  min-width: 180px;
  max-width: min(320px, calc(100vw - 24px));
  max-height: 320px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border-radius: 16px;
  background: #0f1b2b;
  border: 1px solid #ffffff26;
  box-shadow: 0 0 1px 0 #ffffff4d inset, 0 18px 44px rgba(0, 0, 0, 0.72);
  color: #ecedee;
  transform-origin: top center;
  animation: cfy-dd-in 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cfy-dd-menu.flip-up {
  transform-origin: bottom center;
  animation: cfy-dd-in-up 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cfy-dd-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cfy-dd-in-up {
  from { opacity: 0; transform: translateY(4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cfy-dd-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding: 2px 2px 8px;
  flex: none;
}

.cfy-dd-search-icon {
  position: absolute;
  left: 11px;
  color: #a1a1aa;
  pointer-events: none;
  display: inline-grid;
  place-items: center;
}

.cfy-dd-search {
  width: 100%;
  height: 34px;
  padding: 0 28px 0 32px;
  border-radius: 10px;
  border: 1px solid #ffffff26;
  background: #1c2236;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.cfy-dd-search::placeholder {
  color: #a1a1aa;
}

.cfy-dd-search:focus {
  border-color: #0384f6;
  box-shadow: 0 0 0 2px rgba(3, 132, 246, 0.25);
}

.cfy-dd-search-x {
  position: absolute;
  right: 8px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #a1a1aa;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.cfy-dd-search-x:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.cfy-dd-list {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
}

/* Exact HeroUI list-box-item: min-h 36px, right-side checkmark inside pe-9 */
.cfy-dd-opt {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 6px 36px 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #ecedee;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.cfy-dd-opt:hover {
  background: #2c3554;
  color: #fff;
}

.cfy-dd-opt.selected {
  color: #fff;
  font-weight: 500;
}

.cfy-dd-opt-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Right-side animated checkmark SVG matching HeroUI list-box-item__indicator */
.cfy-dd-ind {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  color: #ecedee;
  opacity: 0;
  transition: opacity 140ms ease;
}

.cfy-dd-opt.selected .cfy-dd-ind {
  opacity: 1;
}

.cfy-dd-ind svg polyline {
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  transition: stroke-dashoffset 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cfy-dd-opt.selected .cfy-dd-ind svg polyline {
  stroke-dashoffset: 0;
}

.cfy-dd-empty {
  padding: 16px 10px;
  text-align: center;
  font-size: 13px;
  color: #a1a1aa;
}
