/* ChartContainer Component Styles */

.mint-chart {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Dark --border-light equals --bg-card; header hairline and Plotly grid need --border-color there. */
:where(html.dark) .mint-chart {
  --border-light: var(--border-color);
}

.mint-chart--frame {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg-card);
}

/* One header for both variants (9a): 13px 600 title + 12px description on one line,
   legend items, then tools. */
.mint-chart__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.mint-chart__header-text {
  display: flex;
  flex: 1;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}

.mint-chart__title {
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
}

.mint-chart__description {
  overflow: hidden;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
}

/* Header legend: each item toggles its series. */
.mint-chart__header-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.125rem;
}

.mint-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 1.5rem;
  padding: 0 0.5rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary-strong);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.mint-chart__legend-item:hover {
  background-color: var(--bg-hover);
}

.mint-chart__legend-item:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring-offset);
}

.mint-chart__legend-item--hidden {
  opacity: 0.45;
}

.mint-chart__legend-swatch {
  flex-shrink: 0;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 3px;
}

.mint-chart__toolbar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* Legend and tools stay right-aligned when a custom #header slot replaces the flex:1 title block. */
.mint-chart__header-legend,
.mint-chart__toolbar {
  margin-left: auto;
}

.mint-chart__header-legend + .mint-chart__toolbar {
  margin-left: 0;
}

/* Tools are 28px IconButtons (ghost). */
.mint-chart__toolbar .mint-icon-button {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.375rem;
}

.mint-chart__body {
  position: relative;
  min-height: 12rem;
}

.mint-chart--frame .mint-chart__body {
  flex: 1;
  min-height: 0;
}

.mint-chart__loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  z-index: 1;
}

.mint-chart--frame .mint-chart__loading-overlay {
  z-index: 10;
  padding: 1.5rem;
}

.mint-chart--frame .mint-chart__body > .mint-empty-state {
  position: absolute;
  inset: 0;
  z-index: 10;
  max-width: none;
  padding: 1.5rem;
  background: var(--bg-card);
}

.mint-chart--frame .mint-empty-state__icon-wrapper {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.5rem;
  background: transparent;
}

.mint-chart--frame .mint-empty-state__title {
  font-size: 0.8125rem;
}

.mint-chart__legend {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.mint-chart__footer {
  padding: 0.625rem 0.875rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.mint-chart--frame .mint-chart__footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4375rem 0.875rem;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  flex-shrink: 0;
}
