/**
 * VIRTUAL ECONOMY INTEGRITY AGENT
 * Anomaly detection dashboard styles
 */

/* View Toggle Buttons */
.view-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.view-btn:hover {
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

.view-btn.active {
  background: linear-gradient(135deg, #00d4ff, #0066ff);
  border-color: #00d4ff;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

/* Scene Controls (for immersive view) */
.scene-btn {
  background: rgba(26, 26, 26, 0.9);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #00d4ff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.scene-btn:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: #00d4ff;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.scene-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s;
}

.scene-dot.active {
  background: #00d4ff;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
}

.scene-dot:hover {
  background: #00d4ff;
  transform: scale(1.3);
}

/* Hero Section */
.hero-compact {
  padding: 80px 24px 40px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-compact h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 16px;
  font-weight: 600;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 300;
}

/* Dashboard Layout */
.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.stat-value.anomaly {
  color: #ef4444;
}

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

/* Visualization Grid */
.viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.viz-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
}

.viz-card.full-width {
  grid-column: 1 / -1;
}

.viz-card h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text-primary);
  font-weight: 600;
}

.viz-card canvas {
  max-height: 300px;
}

/* Category Heatmap */
#categoryHeatmap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  min-height: 200px;
}

.category-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.category-cell:hover {
  transform: scale(1.05);
}

.category-cell .name {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
}

.category-cell .count {
  font-size: 0.7rem;
  opacity: 0.8;
}

/* Network Graph */
#networkGraph {
  min-height: 400px;
  position: relative;
}

#networkGraph svg {
  width: 100%;
  height: 400px;
}

/* Anomaly List */
.anomaly-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
}

.anomaly-section h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text-primary);
  font-weight: 600;
}

.anomaly-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 500px;
  overflow-y: auto;
}

.anomaly-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid #ef4444;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.3s ease;
}

.anomaly-item:hover {
  border-color: #ef4444;
  transform: translateX(4px);
}

.anomaly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.anomaly-id {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.anomaly-severity {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.severity-high {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.severity-medium {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.severity-low {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.anomaly-details {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.anomaly-details strong {
  color: var(--text-primary);
}

/* Tech Stack Card */
.tech-card {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.tech-card-trigger {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.tech-card-trigger:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.tech-card-content {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  min-width: 300px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.tech-card:hover .tech-card-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tech-card-content p {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tech-card-content p:last-child {
  margin-bottom: 0;
}

.tech-card-content strong {
  color: var(--text-primary);
}

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
  .viz-grid {
    grid-template-columns: 1fr;
  }
  
  .viz-card.full-width {
    grid-column: 1;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
