/*
 * Charts & Data Visualization
 * Burndown, timeline, donut charts, heatmaps, sparklines
 */

/* Burndown Chart */
.chart-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
}

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

.chart-title {
  font-size: 16px;
  font-weight: 600;
}

.chart-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.chart-body {
  display: flex;
  gap: 12px;
}

.chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 0 8px;
  height: 200px;
}

.chart-area {
  flex: 1;
  height: 200px;
}

.burndown-svg {
  width: 100%;
  height: 100%;
}

.chart-x-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 8px;
  padding-left: 40px;
}

.chart-stats {
  display: flex;
  gap: 32px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.chart-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chart-stat-value {
  font-size: 20px;
  font-weight: 600;
}

.chart-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Timeline View */
.timeline-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
}

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

.timeline-title {
  font-size: 16px;
  font-weight: 600;
}

.timeline-controls {
  display: flex;
  gap: 4px;
}

.timeline-months {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.timeline-month {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.timeline-grid {
  position: relative;
  min-height: 200px;
}

.timeline-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #ef4444;
  z-index: 10;
}

.timeline-today::before {
  content: 'Today';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #ef4444;
  white-space: nowrap;
}

.timeline-row {
  position: relative;
  height: 40px;
  margin-bottom: 8px;
}

.timeline-bar {
  position: absolute;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-bar-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.timeline-bar-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.timeline-bar-green { background: linear-gradient(135deg, #10b981, #059669); }
.timeline-bar-orange { background: linear-gradient(135deg, #f97316, #ea580c); }

.timeline-milestones {
  position: relative;
  height: 40px;
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.timeline-milestone {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
}

.timeline-milestone-marker {
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 50%;
  margin-bottom: 4px;
}

.timeline-milestone-label {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Donut Chart */
.donut-chart {
  position: relative;
  width: 160px;
  height: 160px;
}

.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-value {
  display: block;
  font-size: 32px;
  font-weight: 700;
}

.donut-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Heatmap Calendar */
.heatmap-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}

.heatmap-months {
  display: flex;
  gap: 40px;
  margin-bottom: 8px;
  padding-left: 36px;
  font-size: 12px;
  color: var(--text-secondary);
}

.heatmap-grid {
  display: flex;
  gap: 8px;
}

.heatmap-day-labels {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  padding-top: 4px;
}

.heatmap-day-labels span {
  height: 12px;
}

.heatmap-days {
  display: grid;
  grid-template-columns: repeat(26, 12px);
  grid-template-rows: repeat(3, 12px);
  gap: 3px;
}

.heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.heatmap-level-0 {
  background-color: var(--bg-tertiary);
}

.heatmap-level-1 {
  background-color: #064E3B;
}

.heatmap-level-2 {
  background-color: #047857;
}

.heatmap-level-3 {
  background-color: #10B981;
}

.heatmap-level-4 {
  background-color: #34D399;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  justify-content: flex-end;
  font-size: 11px;
}

/* Sparklines */
.sparkline-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}

.sparkline-label {
  width: 140px;
  font-size: 12px;
  color: var(--text-primary);
}

.sparkline {
  width: 100px;
  height: 30px;
}

.sparkline-line {
  fill: none;
  stroke-width: 2;
}

.sparkline-up {
  stroke: #10B981;
}

.sparkline-down {
  stroke: #EF4444;
}

.sparkline-neutral {
  stroke: var(--text-secondary);
}

.sparkline-value {
  font-size: 12px;
  font-weight: 600;
  width: 50px;
  text-align: right;
}

.sparkline-value-up {
  color: #10B981;
}

.sparkline-value-down {
  color: #EF4444;
}

/* Velocity Chart */
.velocity-chart {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  gap: 12px;
}

.velocity-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  padding-bottom: 24px;
  height: 150px;
}

.velocity-bars {
  display: flex;
  gap: 16px;
  flex: 1;
}

.velocity-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.velocity-bar-stack {
  position: relative;
  width: 100%;
  height: 150px;
  display: flex;
  align-items: flex-end;
}

.velocity-bar {
  position: absolute;
  bottom: 0;
  width: 100%;
  border-radius: 4px 4px 0 0;
}

.velocity-committed {
  background-color: var(--bg-tertiary);
  z-index: 1;
}

.velocity-completed {
  background-color: var(--accent-primary);
  z-index: 2;
  width: 60%;
  left: 20%;
}

.velocity-label {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

.velocity-legend {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text-secondary);
}

.velocity-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.velocity-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.velocity-dot.velocity-committed {
  background-color: var(--bg-tertiary);
}

.velocity-dot.velocity-completed {
  background-color: var(--accent-primary);
}

