/* ==========================================================================
   AllCalci.com — charts.css
   Custom SVG chart styling (theme-aware, no external libraries)
   ========================================================================== */

.ac-chart { font-family: var(--font-sans); overflow: visible; }

/* Axes & grid */
.ac-grid-line { stroke: var(--color-border); stroke-width: 1; shape-rendering: crispEdges; }
.ac-grid-line--dashed { stroke-dasharray: 3 4; }
.ac-axis-line { stroke: var(--color-border-strong); stroke-width: 1; shape-rendering: crispEdges; }
.ac-axis-label {
  fill: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.ac-axis-title {
  fill: var(--color-text-muted);
  font-size: 11px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
}

/* Pie / donut */
.ac-arc {
  stroke: var(--color-bg-card);
  stroke-width: 2;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  transform-origin: center;
  cursor: pointer;
}
.ac-arc:hover { opacity: .85; }
.ac-donut-center-value {
  fill: var(--color-text);
  font-family: var(--font-mono);
  font-size: 18px; font-weight: 700;
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
}
.ac-donut-center-label {
  fill: var(--color-text-muted);
  font-size: 10px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  text-anchor: middle;
}

/* Bars */
.ac-bar {
  transition: opacity var(--dur-fast) var(--ease);
  cursor: pointer;
}
.ac-bar:hover { opacity: .82; }
.ac-bar-label {
  fill: var(--color-text-secondary);
  font-size: 11px; font-weight: 500;
}
.ac-bar-value {
  fill: var(--color-text);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Lines & areas */
.ac-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ac-area { opacity: .14; }
.ac-point { stroke: var(--color-bg-card); stroke-width: 2; }
.ac-hover-line { stroke: var(--color-text-faint); stroke-width: 1; stroke-dasharray: 3 3; }

/* Gauge */
.ac-gauge-track { fill: none; stroke: var(--color-bg-sunken); stroke-linecap: round; }
.ac-gauge-zone { fill: none; stroke-linecap: butt; }
.ac-gauge-needle { stroke: var(--color-text); stroke-width: 2.5; stroke-linecap: round; }
.ac-gauge-hub { fill: var(--color-text); }
.ac-gauge-value {
  fill: var(--color-text);
  font-family: var(--font-mono); font-size: 26px; font-weight: 700;
  text-anchor: middle; font-variant-numeric: tabular-nums;
}
.ac-gauge-band {
  fill: var(--color-text-muted);
  font-size: 11px; font-weight: 600; text-anchor: middle;
}

/* Legend */
.ac-legend {
  display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-4);
  margin-top: var(--sp-4);
  font-size: var(--text-sm);
}
.ac-legend-item { display: flex; align-items: center; gap: var(--sp-2); color: var(--color-text-secondary); }
.ac-legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.ac-legend-value {
  font-family: var(--font-mono); font-weight: 600; color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

/* Tooltip */
.ac-tooltip {
  position: absolute; z-index: 30;
  padding: var(--sp-2) var(--sp-3);
  background: var(--color-text); color: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs); line-height: 1.5;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0; transform: translate(-50%, -100%);
  transition: opacity var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.ac-tooltip.is-visible { opacity: 1; }
.ac-tooltip b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Entry animation */
@media (prefers-reduced-motion: no-preference) {
  .ac-animate-draw {
    stroke-dasharray: var(--len);
    stroke-dashoffset: var(--len);
    animation: acDraw 900ms var(--ease-out) forwards;
  }
  @keyframes acDraw { to { stroke-dashoffset: 0; } }

  .ac-animate-rise { transform-origin: bottom; animation: acRise 500ms var(--ease-out) backwards; }
  @keyframes acRise { from { transform: scaleY(0); } }

  .ac-animate-fade { animation: acFade 400ms var(--ease-out) backwards; }
  @keyframes acFade { from { opacity: 0; } }
}

.chart-note {
  margin-top: var(--sp-3);
  font-size: var(--text-xs); color: var(--color-text-faint); text-align: center;
}
