/* Analytics Dashboard Styles */

.chart-container {
  min-height: 400px;
  width: 100%;
  overflow-x: auto;
}

/* D3 Chart Styles */
.chart-container svg {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* Axis styles */
.chart-container .axis path,
.chart-container .axis line {
  stroke: currentColor;
  opacity: 0.2;
}

.chart-container .axis text {
  fill: currentColor;
  font-size: 12px;
}

/* Grid lines */
.chart-container .grid line {
  stroke: currentColor;
  stroke-opacity: 0.1;
  shape-rendering: crispEdges;
}

.chart-container .grid path {
  stroke-width: 0;
}

/* Tooltips */
.d3-tooltip {
  position: absolute;
  padding: 12px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  border-radius: 8px;
  pointer-events: none;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 1000;
  max-width: 300px;
}

.d3-tooltip.dark {
  background: rgba(255, 255, 255, 0.95);
  color: #18181b;
}

.d3-tooltip strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

/* Line chart styles */
.line-chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.line-chart-area {
  opacity: 0.1;
}

.line-chart-dot {
  stroke: white;
  stroke-width: 2;
}

.line-chart-dot:hover {
  r: 6;
  stroke-width: 3;
}

/* Bar chart styles */
.bar-chart-bar {
  transition: opacity 0.2s;
}

.bar-chart-bar:hover {
  opacity: 0.8;
}

/* Heatmap styles */
.heatmap-cell {
  stroke: rgba(0, 0, 0, 0.1);
  stroke-width: 1;
  transition: opacity 0.2s;
}

.heatmap-cell:hover {
  opacity: 0.8;
  stroke: rgba(0, 0, 0, 0.3);
  stroke-width: 2;
}

/* Legend styles */
.legend-item {
  cursor: pointer;
  transition: opacity 0.2s;
}

.legend-item:hover {
  opacity: 0.7;
}

.legend-item.inactive {
  opacity: 0.3;
}

.legend-rect {
  rx: 2;
}

.legend-text {
  font-size: 13px;
  fill: currentColor;
}

/* Loading state */
.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: #a1a1aa;
  font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .chart-container {
    min-height: 300px;
  }

  .d3-tooltip {
    font-size: 12px;
    padding: 10px;
  }

  .chart-container .axis text {
    font-size: 10px;
  }
}

/* Dark mode specific adjustments */
.dark .d3-tooltip {
  background: rgba(255, 255, 255, 0.95);
  color: #18181b;
}

.dark .heatmap-cell {
  stroke: rgba(255, 255, 255, 0.1);
}

.dark .heatmap-cell:hover {
  stroke: rgba(255, 255, 255, 0.3);
}
