/* ================================================================
   CHARTS SECTION — shared/css/charts.css
   Premium chart styling with glassmorphism and modern aesthetics.
   ================================================================ */

/* ── ANALYTICS SECTION CONTAINER ─────────────────────────────── */
.analytics-section {
  margin-top: 28px;
  margin-bottom: 28px;
  width: 100%;
}

.analytics-section .section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
}

.analytics-section .section-title::before {
  content: "";
  width: 4px;
  height: 20px;
  background: var(--gradient-accent);
  border-radius: 4px;
}

/* ── CHARTS GRID ─────────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
}

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

/* ── CHART CARD ──────────────────────────────────────────────── */
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  position: relative;
  overflow: hidden;
}

.chart-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.chart-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.chart-card:hover::after {
  opacity: 1;
}

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

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chart-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.chart-card-subtitle {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
  background: rgba(212, 187, 255, 0.06);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ── CHART CANVAS WRAPPER ────────────────────────────────────── */
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 200px;
  max-height: 280px;
}

.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-canvas-wrap.chart-tall {
  min-height: 240px;
  max-height: 320px;
}

.chart-canvas-wrap.chart-short {
  min-height: 160px;
  max-height: 220px;
}

/* ── CHART LEGEND ────────────────────────────────────────────── */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 8px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── CHART STAT BADGES ───────────────────────────────────────── */
.chart-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

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

.chart-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.chart-stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  font-family: var(--font-display);
}

/* ── NO DATA STATE ───────────────────────────────────────────── */
.chart-no-data {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0.7;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .charts-grid.three-col {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .analytics-section {
    margin-top: 18px;
    margin-bottom: 18px;
  }

  .charts-grid,
  .charts-grid.three-col {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .chart-card {
    padding: 16px;
    border-radius: var(--r-sm);
  }

  .chart-canvas-wrap {
    min-height: 180px;
    max-height: 240px;
  }

  .chart-canvas-wrap.chart-tall {
    min-height: 200px;
    max-height: 280px;
  }

  .chart-card-title {
    font-size: 0.8rem;
  }

  .chart-legend {
    gap: 6px 10px;
  }

  .chart-legend-item {
    font-size: 0.68rem;
  }
}

@media (max-width: 480px) {
  .chart-card {
    padding: 14px;
  }

  .chart-canvas-wrap {
    min-height: 150px;
    max-height: 200px;
  }

  .chart-stat-value {
    font-size: 0.95rem;
  }
}
