.dropdown-container {
  margin: 20px 0;
  position: relative;
  width: 100%;
  max-width: 280px;
  min-width: 200px;
}

.dropdown-header {
  color: black !important;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.3s;
  position: relative;
  z-index: 999;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-content: space-between;
}

.dropdown-header:hover {
  color: #3498db !important;
}

.dropdown-arrow {
  transition: transform 0.3s ease;
}

.dropdown-header.open .dropdown-arrow {
  transform: rotate(90deg);
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 7%;
  background: white;
  border: 1px solid black;
  border-top: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  margin-top: 10px;
  padding: 10px;
  z-index: 1000;
  max-height: 0;
  opacity: 0;
  transform: translateY(-10px);
  transition: max-height 0.4s ease, opacity 0.3s ease, transform 0.3s ease;
  overflow: auto;
}

.dropdown-content.show {
  max-height: 200px;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-content p {
  margin: 5px 0;
  cursor: pointer;
}

.dropdown-content p:hover {
  color: #3498db;
}

.svg-arrow {
  position: absolute;
  top: -9px;
  left: 0px;
  z-index: 2;
}

/* Specific styling for metrics dropdown to handle long text */
.dropdown-container[name="metrics"],
.dropdown-container[name="metrics_par"] {
  max-width: 320px;
}

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

.dropdown-arrow {
  flex-shrink: 0;
  margin-left: 8px;
}
/* Optgroup styling */
.optgroup {
  margin-bottom: 10px;
}

.optgroup:not(:first-child) {
  border-top: 1px solid #e0e0e0;
  padding-top: 8px;
}

.optgroup-label {
  font-weight: bold;
  color: #333;
  font-size: 0.9em;
  padding: 3px 0 5px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.optgroup p {
  margin: 3px 0;
  padding-left: 8px;
}
