/* ========================================
   AGENT SELECTOR - LocalDevGptCoder
   Sélecteur d'agents IA dans la zone de chat
   ======================================== */

.agent-selector-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.agent-selector-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.813rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.agent-selector-btn:hover,
.agent-selector-btn.is-open {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.agent-selector-label {
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-selector-arrow {
  transition: transform 0.2s ease;
}

.agent-selector-btn.is-open .agent-selector-arrow {
  transform: rotate(180deg);
}

.agent-selector-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  max-width: 320px;
  max-height: 320px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 8px 0;
  display: none;
  flex-direction: column;
  z-index: 4000;
  overflow: hidden;
}

.agent-selector-dropdown.is-visible {
  display: flex;
}

.agent-selector-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 4px 16px 8px;
}

.agent-selector-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 300px;
}

.agent-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.agent-option:hover {
  background: var(--bg-hover);
}

.agent-option.is-active {
  background: var(--bg-secondary);
}

.agent-option-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.agent-option-desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.3;
}

.agent-selector-empty,
.agent-selector-error {
  padding: 16px;
  font-size: 0.813rem;
  color: var(--text-tertiary);
  text-align: center;
}

.agent-selector-error {
  color: var(--danger);
}

@media (max-width: 640px) {
  .agent-selector-container {
    flex-wrap: wrap;
  }

  .agent-selector-dropdown {
    left: 0;
    right: 0;
    min-width: 0;
    width: 100%;
  }
}
