/* Visualization Styles */

:root {
  --chart-color-0: #0ea5e9;
  --chart-color-1: #f59e0b;
  --chart-color-2: #10b981;
  --chart-color-3: #8b5cf6;
  --chart-color-4: #ef4444;
}

.visualization-section {
  padding: 3rem 0;
  background: linear-gradient(to bottom, rgba(241, 245, 249, 0.5), rgba(248, 250, 252, 0.8));
}

.visualization-section .section-header {
  margin-bottom: 2rem;
}

.visualization-controls {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
}

.visualization-controls .btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.visualization-controls .btn:hover {
  transform: translateY(-2px);
}

.visualization-controls .btn-outline {
  border: 1px solid var(--border);
  color: var(--foreground);
}

.visualization-controls .btn-outline:hover {
  border-color: var(--error);
  color: var(--error);
  background-color: rgba(239, 68, 68, 0.1);
}

.visualization-controls .btn-primary {
  background: var(--gradient-blue);
}

.visualization-controls .btn-primary:hover {
  box-shadow: var(--shadow-glow);
}

#visualization-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.chart-container {
  background-color: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.chart-container:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}

.chart-container h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--foreground);
  position: relative;
  padding-bottom: 0.75rem;
}

.chart-container h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--gradient-blue);
  border-radius: 2px;
}

.chart {
  width: 100%;
  height: 100%;
  min-height: 200px;
}

/* Confidence Chart */
.confidence-bar-chart {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.chart-label {
  width: 80px;
  font-weight: 600;
  font-size: 0.875rem;
  text-align: right;
}

.chart-bar-container {
  flex-grow: 1;
  height: 12px;
  background-color: rgba(14, 165, 233, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.chart-bar {
  height: 100%;
  background: linear-gradient(to right, #0ea5e9, #38bdf8);
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.chart-value {
  width: 60px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Distribution Chart */
.distribution-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.pie-chart {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
}

.pie-segment {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-label {
  font-weight: 600;
}

.legend-value {
  color: var(--foreground);
  opacity: 0.7;
}

/* Timeline Chart */
.timeline {
  position: relative;
  padding: 1rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 15px;
  width: 2px;
  background: linear-gradient(to bottom, rgba(14, 165, 233, 0.3), rgba(56, 189, 248, 0.3));
}

.timeline-item {
  position: relative;
  padding-left: 40px;
  margin-bottom: 1.5rem;
}

.timeline-point {
  position: absolute;
  left: 8px;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--primary);
  z-index: 1;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

.timeline-content {
  background-color: white;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--primary);
}

.timeline-label {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.timeline-confidence {
  font-size: 0.875rem;
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--foreground);
  opacity: 0.7;
}

.no-data {
  text-align: center;
  padding: 2rem;
  color: var(--foreground);
  opacity: 0.7;
  font-style: italic;
}

/* Responsive */
@media (min-width: 768px) {
  #visualization-container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .chart-container:first-child {
    grid-column: span 2;
  }
}