/**
 * AFI Dashboard Styles
 * Interactive visualization styles
 */

/* Dashboard styles integrated with main theme */
#dashboard {
  background: var(--section-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px 20px;
  margin: 40px 20px;
}

/* Real-time indicator */
.real-time-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

.real-time-status {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-section {
  margin-bottom: 3rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#dashboard .dashboard-section h2,
#dashboard .dashboard-section h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* Portfolio Composition */
.portfolio-composition {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portfolio-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.portfolio-bar {
  flex: 1;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.portfolio-fill {
  height: 100%;
  transition: width 0.5s ease;
  border-radius: 8px;
}

.portfolio-label {
  display: flex;
  justify-content: space-between;
  width: 200px;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.asset-name {
  font-weight: 500;
}

.asset-value {
  color: #9B9B9B;
}

/* Decision History Chart */
.decision-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 300px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow-x: auto;
}

.decision-bar {
  flex: 1;
  min-width: 8px;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  transition: opacity 0.2s;
}

.decision-bar:hover {
  opacity: 0.8;
}

/* Confidence Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.metric-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.metric-card h3 {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.confidence-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  transition: width 0.5s ease;
  border-radius: 4px;
}

.mode-description {
  margin: 0.5rem 0 0 0;
  color: #9B9B9B;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Performance Metrics */
.performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.performance-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.performance-card h3 {
  margin: 0 0 0.5rem 0;
  color: #9B9B9B;
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.performance-card .metric-value {
  font-size: 2rem;
  margin: 0;
}

.top-agents {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.top-agents h3 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 300;
}

.top-agents ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.top-agents li {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.top-agents li:last-child {
  border-bottom: none;
}

.agent-name {
  font-weight: 500;
}

.agent-score {
  color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 1rem;
  }

  .dashboard-section {
    padding: 1.5rem;
  }

  .metrics-grid,
  .performance-grid {
    grid-template-columns: 1fr;
  }

  .decision-chart {
    height: 200px;
  }

  .metric-value {
    font-size: 2rem;
  }
}

/* Loading State */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}
