/* ============================================
   UNIFIED DROPDOWN COMPONENT
   Searchable dropdowns with fuzzy matching
   ============================================ */

.unified-dropdown-wrapper {
  position: relative;
  width: 100%;
  display: inline-block;
  overflow: visible;
}

/* Trigger Button */
.unified-dropdown-trigger {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #dde3ee;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  transition: all 0.2s;
  position: relative;
}

.unified-dropdown-trigger:hover {
  border-color: #063970;
  background: #f9fafb;
}

.unified-dropdown-trigger:focus {
  outline: none;
  border-color: #063970;
  box-shadow: 0 0 0 3px rgba(6, 57, 112, 0.1);
}

.unified-dropdown-trigger::after {
  content: '';
  position: absolute;
  right: 12px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #9ca3af;
  border-bottom: 1.5px solid #9ca3af;
  transform: rotate(-45deg);
  pointer-events: none;
  transition: transform 0.2s;
}

.unified-dropdown-wrapper.open .unified-dropdown-trigger::after {
  transform: rotate(135deg);
  top: -1px;
}

/* Dropdown Menu */
.unified-dropdown-menu {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 100%;
  background: #fff;
  border: 1px solid #dde3ee;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 300px;
  overflow: hidden;
  flex-direction: column;
  display: none;
}

/* Search Input */
.unified-dropdown-search {
  padding: 8px;
  border-bottom: 1px solid #e8edf5;
  background: #f9fafb;
}

.unified-dropdown-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #dde3ee;
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: #374151;
  transition: all 0.2s;
  box-sizing: border-box;
}

.unified-dropdown-search-input:focus {
  outline: none;
  border-color: #063970;
  box-shadow: 0 0 0 3px rgba(6, 57, 112, 0.1);
}

.unified-dropdown-search-input::placeholder {
  color: #9ca3af;
}

/* Options List */
.unified-dropdown-options {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0;
  padding: 4px 0;
  min-width: max-content;
  max-width: 600px;
}

.unified-dropdown-options::-webkit-scrollbar {
  width: 6px;
}

.unified-dropdown-options::-webkit-scrollbar-track {
  background: transparent;
}

.unified-dropdown-options::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.unified-dropdown-options::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Option Item */
.unified-dropdown-option {
  padding: 10px 14px;
  cursor: pointer;
  color: #374151;
  transition: all 0.1s;
  border-left: 3px solid transparent;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.4;
  min-height: auto;
}

.unified-dropdown-option:hover {
  background: #f3f4f6;
  color: #063970;
}

.unified-dropdown-option.selected {
  background: #eff6ff;
  color: #063970;
  border-left-color: #063970;
  font-weight: 600;
}

.unified-dropdown-option.selected:hover {
  background: #e0f2fe;
}

/* Highlighted matching characters */
.unified-dropdown-option mark {
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
  padding: 0 2px;
  border-radius: 2px;
}

/* No results message */
.unified-dropdown-no-results {
  padding: 12px 14px;
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
  font-style: italic;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .unified-dropdown-trigger {
    padding: 10px 12px;
    font-size: 14px;
  }

  .unified-dropdown-menu {
    max-height: 250px;
  }

  .unified-dropdown-option {
    padding: 12px 14px;
    font-size: 14px;
  }
}

/* ============================================
   FORM INTEGRATION
   ============================================ */

/* When unified dropdown is in a form-group */
.form-group .unified-dropdown-wrapper {
  width: 100%;
}

.form-group .unified-dropdown-trigger {
  font-size: 13px;
}

