/* Custom Global Select styles */
.custom-select-container {
  position: relative;
  display: inline-block;
  width: 100%;
}

.custom-select-trigger-global {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-color);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-color);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  height: 44px;
}

.custom-select-trigger-global:hover {
  border-color: var(--primary-color);
}

.custom-select-trigger-global .selected-content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.custom-select-trigger-global .selected-content span,
.custom-option-global span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-option-icon {
  flex: 0 0 auto;
}

.custom-select-options-global {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background: var(--bg-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--card-border);
  z-index: 1001;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s, transform 0.2s, pointer-events 0.2s;
  max-height: 200px;
  overflow-y: auto;
}

[data-theme="dark"] .search-results,
[data-theme="dark"] .custom-select-options-global {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  background: #222224;
}

.custom-select-options-global.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  display: flex !important;
}

.group-selection-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 100px;
  overflow-y: auto;
}

.group-select-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--card-border);
  border-radius: 20px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.18s;
  flex-shrink: 0;
}

.group-select-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.group-select-btn.active {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: var(--bg-color);
  font-weight: 500;
}

[data-theme="dark"] .group-select-btn.active {
  color: #111112;
}

.group-select-btn.new-group {
  border-style: dashed;
  color: var(--text-secondary);
}

.group-select-btn.new-group:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.custom-option-global {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-color);
  transition: background 0.15s;
}

.custom-option-global:hover, .custom-option-global.active {
  background: var(--item-hover-bg);
}

/* Specific styling for the engine select in the search bar */
.search-container .custom-select-container {
  width: auto;
  height: 100%;
}

.search-container .custom-select-trigger-global {
  background: transparent;
  border: none;
  border-right: 1px solid var(--card-border);
  border-radius: 26px 0 0 26px;
  padding: 0 16px;
  height: 52px;
  gap: 8px;
}

.search-container .custom-select-trigger-global:hover {
  background: var(--item-hover-bg);
  border-color: transparent;
  border-right-color: var(--card-border);
}

.search-container .custom-select-options-global {
  width: 160px;
  left: 0;
}

