/* ==========================================================================
   VORTEX-SDN Pure Canvas & SVG Charts
   Cisco NOC / SOC Operations Telemetry Visuals
   ========================================================================== */

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
}

.chart-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

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

.legend-color-box {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* ==========================================================================
   Semi-Circular Radial Health Score Gauges — Enterprise NOC/SOC Style
   ========================================================================== */
.gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  position: relative;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.gauge-container:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.gauge-hero {
  padding: 10px 14px;
}

.gauge-hero .gauge-svg-wrap {
  width: 190px;
  height: 105px;
}

.gauge-hero .gauge-number {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.gauge-secondary .gauge-svg-wrap {
  width: 135px;
  height: 75px;
}

.gauge-secondary .gauge-number {
  font-size: 20px;
  font-weight: 800;
}

.gauge-secondary .gauge-sublabel {
  font-size: 9.5px;
}

.gauge-svg-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-center-val {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
}

.gauge-number {
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.1;
  transition: color 0.3s ease;
}

.gauge-sublabel {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

.gauge-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 10px;
}

.gauge-status-badge {
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.gauge-delta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
}

.gauge-delta.up {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.gauge-delta.down {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.gauge-delta.stable {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
}

.gauge-updated-pulse {
  animation: gaugePulse 0.45s ease-out;
}

@keyframes gaugePulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 242, 254, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(0, 242, 254, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 242, 254, 0); }
}

/* Donut & Distribution Bars */
.dist-bar-row {
  margin-bottom: 10px;
}

.dist-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.dist-bar-track {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.dist-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Gauge SVG Background Track */
.gauge-bg-track {
  stroke: var(--gauge-bg-track, #172033);
}

/* ==========================================================================
   Light Mode Chart & Gauge Overrides
   ========================================================================== */
[data-theme="light"] .gauge-bg-track {
  stroke: #e2e8f0;
}

[data-theme="light"] .gauge-container {
  background: #ffffff;
  border: 1px solid #d8e1ec;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .gauge-container:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .gauge-number {
  color: #0f172a;
}

[data-theme="light"] .gauge-sublabel {
  color: #64748b;
}

[data-theme="light"] .gauge-delta.stable {
  color: #475569;
  background: #f1f5f9;
}

[data-theme="light"] .gauge-delta.up {
  color: #15803d;
  background: #dcfce7;
}

[data-theme="light"] .gauge-delta.down {
  color: #b91c1c;
  background: #fee2e2;
}

[data-theme="light"] .chart-legend {
  color: #64748b;
}

[data-theme="light"] .dist-bar-track {
  background: #e2e8f0;
}

[data-theme="light"] .dist-bar-labels {
  color: #475569;
}

[data-theme="light"] .dist-bar-labels strong {
  color: #0f172a;
}
