.dropdownContainer {
  position: relative;
  display: inline-block;
}

.dropdownButton {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--color-primary);
  border-radius: 25px;
  font-size: 14px;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: var(--color-bg);
  color: var(--color-text);
  min-width: 100%;
  box-sizing: border-box;
}

.dropdownButton:hover:not(.disabled):not(:disabled) {
  border-color: var(--color-secondary);
  background-color: var(--color-secondary);
  color: white;
}

.dropdownButton:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb, 0, 123, 255), 0.1);
}

.dropdownButton.disabled,
.dropdownButton:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--color-bg-disabled, #f5f5f5);
}

.dropdownButton.loading {
  cursor: wait;
}

/* Button variants */
.buttonPrimary {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.buttonPrimary:hover:not(.disabled):not(:disabled) {
  background-color: var(--color-primary);
  color: white;
}

.buttonSecondary {
  border-color: var(--color-secondary);
  color: var(--color-text);
}

.buttonSecondary:hover:not(.disabled):not(:disabled) {
  background-color: var(--color-secondary);
  color: white;
}

.buttonDanger {
  border-color: #ef4444;
  color: var(--color-text);
}

.buttonDanger:hover:not(.disabled):not(:disabled) {
  background-color: #ef4444;
  color: white;
}

.buttonSuccess {
  border-color: #10b981;
  color: var(--color-text);
}

.buttonSuccess:hover:not(.disabled):not(:disabled) {
  background-color: #10b981;
  color: white;
}

.buttonWarning {
  border-color: #f59e0b;
  color: var(--color-text);
}

.buttonWarning:hover:not(.disabled):not(:disabled) {
  background-color: #f59e0b;
  color: white;
}

/* Button sizes */
.buttonSm {
  padding: 8px 12px;
  font-size: 13px;
}

.buttonMd {
  padding: 12px 16px;
  font-size: 14px;
}

.buttonLg {
  padding: 16px 20px;
  font-size: 16px;
}

.buttonIcon {
  font-size: 16px;
  flex-shrink: 0;
}

.buttonText {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevronIcon {
  font-size: 16px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.chevronOpen {
  transform: rotate(180deg);
}

.clearIcon {
  font-size: 18px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.clearIcon:hover {
  transform: scale(1.1);
}

.buttonSpinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.dropdownMenu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: var(--color-bg);
  border: 1px solid var(--color-primary);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
  min-width: 100%;
}

.dropdownHeader {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdownItems {
  max-height: inherit;
  overflow-y: auto;
}

.dropdownEmpty {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--color-text);
  font-style: italic;
  text-align: center;
}

.dropdownItem {
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-family);
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--color-primary);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dropdownItem:last-child {
  border-bottom: none;
}

.dropdownItem:hover {
  background-color: var(--color-secondary);
  color: white;
}

.dropdownItemSelected {
  background-color: var(--color-primary);
  color: white;
  font-weight: 500;
}

.dropdownItemSelected:hover {
  background-color: var(--color-primary);
  opacity: 0.9;
}

.itemLabel {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selectedIndicator {
  font-size: 16px;
  font-weight: bold;
  flex-shrink: 0;
}

/* Dark theme support */
[data-theme="dark"] .dropdownButton {
  border-color: var(--color-primary);
  background-color: var(--color-bg);
}

[data-theme="dark"] .dropdownMenu {
  background-color: var(--color-bg);
  border-color: var(--color-primary);
}

[data-theme="dark"] .dropdownItem {
  color: var(--color-text);
}

/* Responsive design */
@media (max-width: 640px) {
  .dropdownButton {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

