/* External Context Selector */
.claudian-external-context-selector {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 8px;
}

.claudian-external-context-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.claudian-external-context-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--text-faint);
  transition: color 0.15s ease;
}

.claudian-external-context-icon-wrapper:hover .claudian-external-context-icon {
  color: var(--text-normal);
}

.claudian-external-context-icon.active {
  color: var(--claudian-brand);
  animation: external-context-glow 2s ease-in-out infinite;
}

.claudian-external-context-icon svg {
  width: 16px;
  height: 16px;
}

.claudian-external-context-badge {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 9px;
  font-weight: 600;
  color: var(--claudian-brand);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.claudian-external-context-badge.visible {
  opacity: 1;
}

.claudian-external-context-dropdown {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 100%;
  margin-bottom: 4px;
  min-width: 260px;
  max-width: 320px;
  background: var(--background-secondary);
  border: 1px solid var(--background-modifier-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 100;
}

.claudian-external-context-selector:hover .claudian-external-context-dropdown {
  opacity: 1;
  visibility: visible;
}

.claudian-external-context-header {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--background-modifier-border);
}

.claudian-external-context-list {
  max-height: 200px;
  overflow-y: auto;
}

.claudian-external-context-empty {
  padding: 16px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}

.claudian-external-context-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
  border-bottom: 1px solid var(--background-modifier-border-focus);
}

.claudian-external-context-item:last-child {
  border-bottom: none;
}

.claudian-external-context-text {
  flex: 1;
  font-size: 12px;
  font-family: var(--font-monospace);
  color: var(--text-normal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.claudian-external-context-lock {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.4;
  transition: all 0.15s ease;
}

.claudian-external-context-lock:hover {
  background: var(--background-modifier-hover);
  opacity: 0.8;
}

.claudian-external-context-lock.locked {
  color: var(--claudian-brand);
  opacity: 0.9;
}

.claudian-external-context-lock.locked:hover {
  opacity: 1;
}

.claudian-external-context-lock svg {
  width: 12px;
  height: 12px;
}

.claudian-external-context-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.6;
  transition: all 0.15s ease;
}

.claudian-external-context-remove:hover {
  background: rgba(var(--claudian-error-rgb), 0.15);
  color: var(--claudian-error);
  opacity: 1;
}

.claudian-external-context-remove svg {
  width: 14px;
  height: 14px;
}
