/* Agent Collaboration Visualization */

.collaboration-view {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.collab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.collab-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.collab-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.25rem;
}

.status-dot.active {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-dot.idle {
  background: var(--warning);
}

.status-dot.offline {
  background: var(--text-tertiary);
}

.collab-content {
  display: grid;
  gap: 1.5rem;
}

/* Agent Cards Grid */
.agent-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.agent-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  transition: all 0.2s;
}

.agent-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.agent-card.active {
  border-left: 3px solid var(--success);
}

.agent-card.idle {
  border-left: 3px solid var(--warning);
  opacity: 0.8;
}

.agent-card.offline {
  border-left: 3px solid var(--text-tertiary);
  opacity: 0.6;
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.agent-role-emoji {
  font-size: 1.5rem;
}

.agent-info {
  flex: 1;
}

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

.agent-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.agent-status-dot.active {
  background: var(--success);
  animation: pulse 2s infinite;
}

.agent-status-dot.idle {
  background: var(--warning);
}

.agent-status-dot.offline {
  background: var(--text-tertiary);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
}

.agent-stats {
  display: flex;
  justify-content: space-around;
  margin: 0.75rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.agent-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.agent-last-seen {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 0.5rem;
}

/* Collaboration Graph */
.collab-graph {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
}

.graph-header {
  margin-bottom: 1.5rem;
}

.graph-header h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.graph-header p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.graph-viz {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
  min-height: 200px;
}

.graph-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.graph-column-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.graph-node {
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

.graph-node:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.graph-node.hunter {
  border-left: 4px solid #3b82f6;
}

.graph-node.validator {
  border-left: 4px solid #22c55e;
}

.node-count {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.graph-edges {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}

.graph-edge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.edge-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6 0%, #22c55e 100%);
  position: relative;
}

.edge-line::after {
  content: '→';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  color: #22c55e;
  font-size: 1rem;
}

.edge-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-2);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
}

/* Activity Feed */
.collab-activity {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
}

.collab-activity h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.collab-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-2);
  border-radius: 4px;
  border-left: 3px solid var(--border);
  transition: border-color 0.2s;
}

.activity-item:hover {
  border-left-color: var(--accent);
}

.activity-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-message {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.activity-message strong {
  color: var(--accent);
  font-weight: 600;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.activity-empty {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.875rem;
  padding: 2rem;
}

/* Empty States */
.collab-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.collab-error {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--error);
  background: var(--surface-1);
  border: 1px solid var(--error);
  border-radius: 6px;
}

/* Responsive */
@media (max-width: 768px) {
  .agent-cards-grid {
    grid-template-columns: 1fr;
  }
  
  .graph-viz {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .graph-edges {
    display: none;
  }
}
