/* ============================================================
   MALA OS v2 — Chart Styles
   ============================================================ */

@import url('../tokens.css');

/* ── Chart Container ── */
.chart-container {
  position: relative;
  width: 100%;
  height: 260px;
}

.chart-container.tall {
  height: 320px;
}

.chart-container.wide {
  height: 200px;
}

/* ── Chart Legend (custom) ── */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin-top: var(--space-3);
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

/* ── Mini Stat Row below chart ── */
.chart-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--surface-glass-border);
}

.chart-stat {
  text-align: center;
}

.chart-stat-value {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.chart-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Chart Grid Layouts ── */
.chart-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.chart-row.three {
  grid-template-columns: repeat(3, 1fr);
}

/* ── Tooltip Customization ── */
.chartjs-tooltip {
  background: var(--surface-elevated) !important;
  border: 1px solid var(--surface-glass-border) !important;
  border-radius: var(--radius-md) !important;
  padding: var(--space-2) var(--space-3) !important;
  box-shadow: var(--shadow-lg) !important;
}

.chartjs-tooltip .tooltip-label {
  color: var(--text-secondary) !important;
  font-size: var(--text-xs) !important;
}

.chartjs-tooltip .tooltip-value {
  color: var(--text-primary) !important;
  font-weight: var(--weight-bold) !important;
  font-size: var(--text-sm) !important;
}

/* ── Responsive Charts ── */
@media (max-width: 1100px) {
  .chart-row,
  .chart-row.three {
    grid-template-columns: 1fr;
  }

  .chart-container {
    height: 220px;
  }
}

@media (max-width: 767px) {
  .chart-container {
    height: 200px;
  }

  .chart-container.tall {
    height: 260px;
  }
}
