/* ═══════════════════════════════════════════════════════════
   AI AGENT INTEGRATION STYLES
   ═══════════════════════════════════════════════════════════ */

.agent-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.agent-panel-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.agent-stat-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
}

.agent-stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.agent-stat-value {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
}

.status-running {
  color: #4caf50;
}

.status-stopped {
  color: #f44336;
}

.health-good {
  color: #4caf50;
}

.health-warning {
  color: #ff9800;
}

.health-critical {
  color: #f44336;
}

.ws-connected {
  color: #4caf50;
}

.ws-disconnected {
  color: #f44336;
}

/* Agent Controls */
.agent-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.agent-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.agent-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.agent-btn-start {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
}

.agent-btn-start:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.agent-btn-stop {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
  color: white;
}

.agent-btn-stop:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

/* Mode Selector */
.mode-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.mode-selector label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.mode-selector select {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-selector select:hover {
  border-color: rgba(102, 126, 234, 0.5);
}

.mode-selector select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Pending Decisions */
.pending-decisions-section {
  margin-top: 24px;
}

.pending-decisions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.pending-count {
  background: #667eea;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

#pendingDecisionsContainer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.no-pending {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
}

.pending-decision {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s;
}

.pending-decision:hover {
  border-color: rgba(102, 126, 234, 0.5);
  transform: translateY(-2px);
}

.decision-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.decision-action {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.decision-action.open_long {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.5);
}

.decision-action.open_short {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.5);
}

.decision-action.close_position {
  background: rgba(255, 152, 0, 0.2);
  color: #ff9800;
  border: 1px solid rgba(255, 152, 0, 0.5);
}

.decision-asset {
  font-weight: 600;
  color: #fff;
  font-size: 14px;
}

.decision-confidence {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-left: auto;
}

.decision-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-row span:first-child {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-row span:last-child {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
}

.urgency-high {
  color: #f44336;
}

.urgency-medium {
  color: #ff9800;
}

.urgency-low {
  color: #4caf50;
}

.decision-reasoning {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid #667eea;
  border-radius: 4px;
}

.decision-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.approve-btn,
.reject-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.approve-btn {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
}

.approve-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.reject-btn {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.5);
}

.reject-btn:hover {
  background: rgba(244, 67, 54, 0.3);
  transform: translateY(-1px);
}

.decision-timeout {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  text-align: right;
}

/* Agent Toggle Button */
.agent-toggle-btn {
  position: relative;
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.agent-toggle-btn::before {
  content: '🤖';
  font-size: 16px;
}

.agent-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  animation: pulse 2s infinite;
}

.agent-indicator.stopped {
  background: #f44336;
  animation: none;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .agent-status-grid {
    grid-template-columns: 1fr;
  }
  
  .decision-details {
    grid-template-columns: 1fr;
  }
  
  .decision-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .decision-confidence {
    margin-left: 0;
  }
}
