/* Multi-select dropdown styles */
.multi-select-dropdown {
  position: relative;
  width: 100%;
}

.multi-select-input {
  min-height: 42px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 36px 8px 12px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.multi-select-input:hover {
  border-color: #9ca3af;
}

.multi-select-input:focus,
.multi-select-input.open {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.selected-items {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 24px;
  align-items: center;
}

.placeholder {
  color: #9ca3af;
  font-size: 14px;
}

.selected-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: #1e40af;
  padding: 4px 6px 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  border: 1px solid #bfdbfe;
}

.selected-item-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-item {
  background: none;
  border: none;
  color: #3b82f6;
  cursor: pointer;
  padding: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: background-color 0.2s ease;
}

.remove-item:hover {
  background: rgba(59, 130, 246, 0.1);
}

.dropdown-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.multi-select-input.open .dropdown-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  margin-top: 4px;
}

.search-container {
  position: relative;
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.search-input {
  width: 100%;
  padding: 8px 36px 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: #2563eb;
}

.search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.filter-section {
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
  background: #f9fafb;
}

.filter-label {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
  display: block;
}

.filter-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
  background: white;
}

.items-list {
  max-height: 300px;
  overflow-y: auto;
}

.dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s ease;
}

.dropdown-item:hover {
  background: #f9fafb;
}

.dropdown-item.selected {
  background: #eff6ff;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.item-checkbox {
  margin-top: 2px;
}

.item-checkbox input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  margin-bottom: 2px;
}

.item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-email {
  font-size: 12px;
  color: #6b7280;
}

.item-workspace {
  font-size: 11px;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 10px;
  display: inline-block;
  max-width: fit-content;
}

.no-items {
  padding: 24px 12px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

/* Loading state */
.multi-select-dropdown.loading .dropdown-panel {
  opacity: 0.7;
}

.multi-select-dropdown.loading .items-list {
  position: relative;
}

.multi-select-dropdown.loading .items-list::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .selected-item-name {
    max-width: 80px;
  }

  .dropdown-panel {
    position: fixed;
    top: auto !important;
    left: 8px !important;
    right: 8px !important;
    bottom: 8px;
    border-radius: 12px 12px 0 0;
    max-height: 60vh;
  }

  .items-list {
    max-height: calc(60vh - 140px);
  }
}
