/* ===== Multiselect styles for the provided HTML (genre-*) ===== */

.wpms-select-container {
  position: relative;
  width: 100%;
}
/* Container + label */
.genre-select-container {
  position: relative;
  width: 100%;
}
.genre-select-label {
  display: block;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
  font-size: 14px;
  padding: 12px 0; /* adjust as needed */
}

/* Trigger (closed/active) */
.genre-select-trigger {
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
  font-size: 14px;
}
.genre-select-trigger.active {
  box-shadow: 0 8px 24px rgba(241, 196, 15, 0.2),
    0 4px 12px rgba(241, 196, 15, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.genre-select-placeholder {
  color: #7f8c8d;
}

/* Arrow (chevron) */
.genre-select-arrow {
  width: 20px;
  height: 20px;
  fill: #7f8c8d;
  transition: transform 0.2s ease;
  flex: 0 0 20px;
}
.genre-select-trigger.active .genre-select-arrow {
  transform: rotate(180deg);
}

/* Selected tags */
.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-right: 12px;
  min-width: 0;
}
.selected-tag {
  background: linear-gradient(135deg, #e7da44 0%, #aaa138 100%);
  color: #fff;
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  animation: genreTagAppear 0.2s ease;
}
@keyframes genreTagAppear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.genre-tag-remove {
  background: rgba(255, 255, 255, 0.3);
  border: none !important;
  color: #fff !important;
  cursor: pointer !important;
  padding: 2px !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1;
  opacity: 0.9;
  transition: all 0.2s ease !important;
  flex-shrink: 0;
}
.genre-tag-remove:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

/* Ensure the multiselect is a positioning context */
[data-ms="multiselect"] {
  position: relative;
}

/* Dropdown (hidden by default; shown with .active) */
.genre-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 2px solid #e1e5e9;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 9999; /* stays above the card */
  pointer-events: auto;
}

.genre-dropdown .genre-option {
  pointer-events: auto;
}

.genre-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* When the dropdown is open, prevent clicks on tags behind it */
[data-ms="multiselect"].ms-open .selected-tags {
  pointer-events: none;
}

/* Options should also accept clicks */
.genre-options,
.genre-option {
  pointer-events: auto;
}

.genre-dropdown.active .genre-search {
  border-radius: 0 0 8px 8px;
  border-top: none;
  border-bottom: 1px solid #e1e5e9;
}

/* Search input */
.genre-search {
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid #e1e5e9;
  width: 100%;
  font-size: 14px;
  outline: none;
}
.genre-search::placeholder {
  color: #95a5a6;
}

/* Options container + items (injected by JS) */
.genre-options {
  padding: 0;
}
.genre-option {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color 0.2s ease;
  font-size: 14px;
}
.genre-option:hover {
  background: #f8f9fa;
}
.genre-option.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

/* Checkbox within options */
.genre-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #bdc3c7;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex: 0 0 18px;
}
.genre-option.selected .genre-checkbox {
  background: #fff;
  border-color: #fff;
}
.genre-checkbox svg {
  width: 12px;
  height: 12px;
  fill: #667eea;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.genre-option.selected .genre-checkbox svg {
  opacity: 1;
}

/* Hidden inputs bucket */
.genre-hidden-inputs {
  display: contents;
}

/* No results message */
.genre-no-results {
  padding: 20px;
  text-align: center;
  color: #7f8c8d;
  font-style: italic;
}

/* Scrollbar styling (WebKit) */
.genre-dropdown::-webkit-scrollbar {
  width: 6px;
}
.genre-dropdown::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.genre-dropdown::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}
.genre-dropdown::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Scoped svg reset to avoid theme/global overrides */
.genre-select-container svg {
  width: auto;
  height: auto;
  max-width: none;
}
