/* Agent Sidebar Styles */

#agent-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #12121a;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.agent-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.agent-sidebar-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f97316;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#agent-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 8px;
  margin: 0;
}

.agent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  cursor: pointer;
}

.agent-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.agent-item.active {
  background: rgba(249, 115, 22, 0.15);
  border-left: 3px solid #f97316;
  color: #fff;
}

.agent-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.agent-item.active .agent-avatar {
  border-color: #f97316;
}

.agent-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.agent-name {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-type {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
}

.agent-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-status.online {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.agent-status.offline {
  background: #64748b;
}

#agent-status {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #0a0a0f;
  font-size: 0.75rem;
  color: #64748b;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.status-item:last-child {
  margin-bottom: 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
}

.status-dot.connected {
  background: #22c55e;
}

/* Mention Dropdown */
.mention-dropdown {
  position: fixed;
  background: #1a1a25;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  max-height: 200px;
  overflow-y: auto;
  z-index: 2000;
}

.mention-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.mention-option:hover,
.mention-option.selected {
  background: rgba(249, 115, 22, 0.15);
}

.mention-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.mention-name {
  flex: 1;
  font-size: 0.875rem;
  color: #fff;
}

.mention-type {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
}

/* Highlighted mentions in chat */
.mention {
  color: #7aa2ff;
  font-weight: 600;
}

/* Tool & Agent Call Visualization */

/* Agent Call Message */
.message-agent-call {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  max-width: 100%;
}

.agent-call-arrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
}

.agent-call-arrow .agent-name {
  color: #c9d1d9;
  font-weight: 500;
}

.agent-call-arrow .agent-name.target {
  color: #f97316;
}

.agent-call-arrow .arrow {
  color: #64748b;
}

/* Tool Call Message */
.message-tool-call {
  background: #1a1a25;
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  margin: 8px 0;
  max-width: 100%;
}

.tool-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.tool-badge {
  background: #f59e0b;
  color: #000;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.tool-badge.result {
  background: #22c55e;
  color: #000;
}

.tool-header .tool-name {
  color: #f59e0b;
  font-weight: 600;
  font-size: 0.875rem;
}

.tool-params {
  padding-left: 8px;
}

.tool-param {
  font-family: monospace;
  font-size: 0.8125rem;
  margin-bottom: 4px;
  color: #94a3b8;
}

.param-name {
  color: #7aa2ff;
}

.param-value {
  color: #c9d1d9;
  word-break: break-all;
}

/* Tool Result Message */
.message-tool-result {
  background: #0f1419;
  border-left: 3px solid #22c55e;
  border-radius: 8px;
  margin: 8px 0;
  max-width: 100%;
}

.message-tool-result .tool-name {
  color: #22c55e;
}

.tool-output {
  font-family: monospace;
  font-size: 0.8125rem;
  color: #94a3b8;
  white-space: pre-wrap;
  line-height: 1.5;
  max-height: 300px;
  overflow-y: auto;
}

/* Agent Result Message */
.message-agent-result {
  border-left: 3px solid #f97316;
}

.message-sender {
  font-size: 0.75rem;
  color: #f97316;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* System Message */
.message.system-message {
  background: transparent;
  border: none;
}

.system-text {
  color: #64748b;
  font-style: italic;
  font-size: 0.8125rem;
  text-align: center;
}

/* Upload Button */
.upload-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.upload-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f97316;
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* File Chips */
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  font-size: 0.8125rem;
  color: #cbd5e1;
  margin: 4px 8px;
}

.file-chip-icon {
  font-size: 0.875rem;
}

.file-chip-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip-remove {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 2px;
  line-height: 1;
}

.file-chip-remove:hover {
  color: #f97316;
}

/* Message Files */
.message-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.message-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.message-file-chip .file-chip-name {
  max-width: 100px;
}
