/* Dropdown Menu Styles - Consistent with button styling */
.dropdown {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  font-size: clamp(10px, 2vw, 13px);
  font-weight: normal;
  border: none;
  cursor: pointer;
  border-radius: 0.5em;
  background: var(--primary);
  padding: 0;
  transition: all 0.1s ease;
}

.dropdown-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  border: 2px solid var(--primary);
  border-radius: 0.5em;
  padding: 0.4em 0.8em;
  background: var(--surface);
  color: var(--text-main);
  transform: translateY(-0.15em);
  transition: transform 0.1s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.dropdown-label::after {
  content: "▼";
  font-size: 0.75em;
  margin-left: 0.5em;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.dropdown:hover .dropdown-label {
  transform: translateY(-0.25em);
}

.dropdown.is-active .dropdown-label {
  transform: translateY(0);
}

.dropdown.is-active .dropdown-label::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.3em);
  left: 0;
  right: 0;
  z-index: 1000;
  opacity: 0;
  width: 100%;
  overflow: hidden;
  max-height: 0;
  text-align: start;
  transform: translateY(-4px);
  border-radius: 0.5em;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
  border: 2px solid var(--primary);
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown.is-active .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  max-height: 240px;
  overflow-y: auto;
}

.dropdown-item {
  font-family: inherit;
  font-size: 0.95em;
  font-weight: normal;
  line-height: 1.4;
  padding: 0.6em 0.8em;
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
  background: var(--surface);
  color: var(--text-main);
}

.dropdown-item:first-child {
  border-radius: 0.4em 0.4em 0 0;
}

.dropdown-item:last-child {
  border-bottom: none;
  border-radius: 0 0 0.4em 0.4em;
}

.dropdown-item:hover {
  background: var(--surface-hover);
  padding-left: 1em;
}

.dropdown-item.active {
  background: var(--primary);
  color: #121212;
  font-weight: 600;
}

.dropdown-item.active:hover {
  background: var(--primary-hover);
  color: #121212;
}

/* Scrollbar styling for dropdown menu */
.dropdown-menu::-webkit-scrollbar {
  width: 8px;
}

.dropdown-menu::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 0.5em;
}

.dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 0.5em;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: #525252;
}
