/* Wrapper: Positionierungs-Referenz für das Panel */
.dropdown-wrapper {
  position: relative;
  max-width: 100%;
}

/* Auswahlfeld (Chips + Input) */
.dropdown-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  cursor: text;
  min-height: 40px;
  align-items: center;
  padding: 4px;
  border: 1px solid #ada6a6;
  border-radius: 4px;
  background-color: #212121;
  width: 100%;
  color: #f1f1f1;
}

/* Input */
.search-input {
  flex: 1 0 120px;
  min-width: 80px;
  font-size: 1em;
  padding: 4px 6px;
  border: none !important;
  outline: none;
    background-color: #212121 !important;
  color: #fff !important;
  box-sizing: border-box;
}
.search-input:focus {
  outline: 2px solid #fff;
  outline-offset: 0px;
}

.search-input::placeholder {
  color: #ffffff; /* oder dein gewünschter Farbwert */
  opacity: 1;     /* wichtig bei manchen Browsern */
}

/* === Dropdown-Panel: FESTE BOX, Liste scrollt DARIN === */
.dropdown-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  z-index: 10000;

  /* feste „Fenster“-Größe */
  max-height: min(50vh, 320px);
  min-height: 120px;       /* optional – damit es wie ein Fenster wirkt */
  overflow: hidden;        /* wichtig: Panel hält Inhalt, Liste übernimmt Scroll */

  background: #1f1f1f;
  border: 1px solid #2b3140;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
}

/* Scrollbare Liste im Panel */
.dropdown-list::before,
.dropdown-list::after { content: ""; display: table; } /* clearfix fallback */

.dropdown-list > .scroll-area {
  max-height: inherit;     /* übernimmt die Fensterhöhe */
  overflow-y: auto;        /* hier scrollt es vertikal */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
  overscroll-behavior: contain;      /* kein Scroll-Chaining zum Body */
  touch-action: pan-y;               /* nur vertikale Gesten */
}

/* Items */
.dropdown-item {
  padding: 10px 12px;
  cursor: pointer;
  color: #e8ecf4;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.dropdown-item:hover,
.dropdown-item.highlighted { background: #2a3244; }
.dropdown-item.disabled   { color: #7f8798; pointer-events: none; }

/* Chips */
.tag {
  background: #6ee7b7;
  color: #000;
  padding: 2px 12px;
  border-radius: 999px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: .95rem;
  line-height: 1;
  height: 30px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag button {
  margin-left: 2px;
  padding: 0;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tag button:hover { background: rgba(0,0,0,.1); }

.limit-hint { color: #aab2c5; font-size: .85rem; margin-top: 6px; }

/* Kleinere Geräte: etwas niedrigere Fensterhöhe */
@media (max-width: 480px) {
  .dropdown-list { max-height: min(45vh, 280px); }
}
