/**
 * victron.css
 *
 * VRM-style hourly chart for /victron and the kiosk overlay (800x480 target).
 * Overlay layout mirrors forecast-overlay: location banner at top, glass chart lower down.
 */

.victronContent--overlay {
  pointer-events: none;
}

.victronRoot {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--forecast-overlay-fg, #e8f1ff);
}

.victronRoot--overlay {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  gap: 0;
  padding-top: calc(
    var(--forecast-overlay-inset-top, 12px) + var(--forecast-overlay-today-top-offset, 5vh)
  );
  box-sizing: border-box;
}

.victronSite--page {
  display: flex;
  justify-content: center;
  align-items: center;
}

.victronSite--overlay {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.victronOverlayStack {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.victronOverlayHeader {
  flex: 0 0 auto;
  text-align: center;
  width: 100%;
}

.victronOverlayLocationBanner {
  margin: 0 0 clamp(8px, 1.2vh, 12px);
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forecast-overlay-muted, #c8d6ef);
  text-align: center;
  text-shadow: var(--forecast-overlay-text-shadow, 0 1px 10px rgba(0, 0, 0, 0.85));
}

.victronChartZone {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
  width: 100%;
  padding-bottom: clamp(52px, 11vh, 80px);
  box-sizing: border-box;
}

.victronChartCard--overlay {
  width: min(100%, 800px);
  max-height: 100%;
  box-sizing: border-box;
  background: var(--forecast-overlay-today-glass, rgba(7, 14, 26, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  backdrop-filter: blur(4px);
  padding: 6px 8px 8px;
  overflow: hidden;
}

.victronChartSvg {
  display: block;
  max-width: 100%;
  height: auto;
}

.victronChartBg {
  fill: rgba(6, 12, 22, 0.92);
  stroke: rgba(120, 170, 255, 0.12);
}

.victronChartTitle {
  fill: #e8f1ff;
  font-size: 15px;
  font-weight: 700;
}

.victronChartSocBadge {
  fill: #5fd38d;
  font-size: 14px;
  font-weight: 700;
}

.victronChartSvg--overlay .victronChartSocBadge,
.victronChartSvg--overlay .victronAxisLabel,
.victronChartSvg--overlay .victronAxisTitle,
.victronChartSvg--overlay .victronLegendLabel {
  paint-order: stroke fill;
  stroke: rgba(0, 0, 0, 0.75);
  stroke-width: 2px;
  stroke-linejoin: round;
}

.victronGridLine {
  stroke: rgba(120, 170, 255, 0.12);
  stroke-width: 1;
}

.victronChartSvg--overlay .victronGridLine {
  stroke: rgba(255, 255, 255, 0.14);
}

.victronAxisLine {
  stroke: rgba(120, 170, 255, 0.28);
  stroke-width: 1;
}

.victronChartSvg--overlay .victronAxisLine {
  stroke: rgba(255, 255, 255, 0.22);
}

.victronAxisLabel {
  fill: #8ea4c7;
  font-size: 11px;
}

.victronChartSvg--overlay .victronAxisLabel {
  fill: var(--forecast-overlay-muted, #c8d6ef);
}

.victronAxisTitle {
  fill: #7f97b8;
  font-size: 11px;
  font-weight: 600;
}

.victronChartSvg--overlay .victronAxisTitle {
  fill: var(--forecast-overlay-muted, #c8d6ef);
}

.victronGridLine--soc {
  stroke: rgba(255, 255, 255, 0.08);
}

.victronGridLine--midnight {
  stroke: rgba(140, 140, 140, 0.35);
  stroke-dasharray: 2 3;
}

.victronChartSvg--overlay .victronGridLine--midnight {
  stroke: rgba(200, 200, 200, 0.22);
}

.victronGridLine--kwh {
  stroke: rgba(244, 185, 66, 0.22);
  stroke-dasharray: 4 4;
}

.victronBar--solar {
  fill: #f4b942;
}

.victronBar--consumption {
  fill: #e86a5a;
}

.victronSocLine {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.victronSocLine--high {
  stroke: #5fd38d;
}

.victronSocLine--mid {
  stroke: #f4b942;
}

.victronSocLine--low {
  stroke: #e86a5a;
}

.victronSocDot {
  stroke: rgba(6, 12, 22, 0.9);
  stroke-width: 1;
}

.victronSocDot--high {
  fill: #5fd38d;
}

.victronSocDot--mid {
  fill: #f4b942;
}

.victronSocDot--low {
  fill: #e86a5a;
}

.victronChartSvg--overlay .victronSocDot {
  stroke: rgba(0, 0, 0, 0.65);
}

.victronLegendSwatch--solar {
  fill: #f4b942;
}

.victronLegendSwatch--consumption {
  fill: #e86a5a;
}

.victronLegendLine {
  stroke: #5fd38d;
  stroke-width: 2.5;
}

.victronLegendDot {
  fill: #5fd38d;
}

.victronLegendLabel {
  fill: #9eb0cc;
  font-size: 11px;
}

.victronChartSvg--overlay .victronLegendLabel {
  fill: var(--forecast-overlay-fg, #e6eefc);
}

.victronEmpty {
  padding: 2rem;
  text-align: center;
  color: #9eb0cc;
}

.viewWithVictronOverlay > .victronContent {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 var(--forecast-overlay-inset-x, 14px) 10px;
  box-sizing: border-box;
  pointer-events: none;
}

.viewWithVictronOverlay > .victronContent .victronRoot {
  width: 100%;
  max-width: none;
}

.viewStage.mode-crossfade .viewWithVictronOverlay > .victronContent,
.viewStage.mode-slide .viewWithVictronOverlay > .victronContent,
.viewStage.mode-dip .viewWithVictronOverlay > .victronContent {
  transition: opacity 0.35s ease;
}

/* Battery page (/victron/battery) */

.victronBatteryRoot {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: #e8f1ff;
}

.victronBatteryRoot--overlay {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  gap: 0;
  padding-top: calc(
    var(--forecast-overlay-inset-top, 12px) + var(--forecast-overlay-today-top-offset, 5vh)
  );
  box-sizing: border-box;
}

.victronBatterySite--overlay {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.victronBatterySite--overlay .victronBatteryChargeBadge {
  margin: 0;
}

.victronChartCard--battery {
  padding: 0;
}

.victronChartCard--battery.victronChartCard--overlay,
.victronChartCard--solar.victronChartCard--overlay {
  background: transparent;
  border: none;
  backdrop-filter: none;
  overflow: visible;
}

.victronBatteryCharts--overlay {
  gap: clamp(18px, 3vw, 32px);
}

.viewWithVictronOverlay > .victronContent .victronBatteryRoot--overlay {
  width: 100%;
  max-width: none;
}

.victronBatterySite {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.victronBatteryHeader {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0 0.15rem;
}

.victronBatteryHub {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #9eb0cc;
}

.victronBatteryChargeBadge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #5fd38d;
  background: rgba(95, 211, 141, 0.12);
  border: 1px solid rgba(95, 211, 141, 0.28);
  line-height: 1.2;
  white-space: nowrap;
}

.victronBatteryChargeBadge--muted {
  color: #9eb0cc;
  background: rgba(158, 176, 204, 0.08);
  border-color: rgba(158, 176, 204, 0.2);
}

.victronBatteryChargeBadge--overlay {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.victronSeriesExtremaLabel {
  fill: #8ea4c7;
  font-size: 10px;
  font-weight: 600;
  paint-order: stroke fill;
  stroke: rgba(6, 12, 22, 0.9);
  stroke-width: 2px;
  stroke-linejoin: round;
}

.victronBatteryChartSvg--overlay .victronSeriesExtremaLabel,
.victronChartSvg--overlay .victronSeriesExtremaLabel {
  fill: var(--forecast-overlay-muted, #c8d6ef);
  stroke: rgba(0, 0, 0, 0.75);
}

.victronBatteryCharts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(18px, 3vw, 32px);
  width: 100%;
}

.victronChartPanel,
.victronBatteryChartCell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(4, 8, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 6px 4px;
  box-sizing: border-box;
}

.victronChartPanel--overlay,
.victronBatteryCharts--overlay .victronBatteryChartCell {
  background: rgba(5, 10, 20, 0.78);
  backdrop-filter: blur(5px);
}

.victronChartPanel .victronChartSvg {
  display: block;
  width: 100%;
  height: auto;
}

.victronAxisLabel--x {
  font-size: 10px;
}

.victronBatteryChartSvg--overlay .victronAxisLabel--x,
.victronChartSvg--overlay .victronAxisLabel--x {
  fill: var(--forecast-overlay-muted, #c8d6ef);
  paint-order: stroke fill;
  stroke: rgba(0, 0, 0, 0.75);
  stroke-width: 2px;
  stroke-linejoin: round;
}

.victronBatteryChartHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 2px 4px;
  min-height: 24px;
}

.victronBatteryChartHeaderMain {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex-wrap: wrap;
}

.victronBatteryChartHeader--overlay .victronBatteryChartTitle {
  color: var(--forecast-overlay-fg, #e6eefc);
}

.victronBatteryChartHeader--overlay .victronBatteryCurrent {
  color: var(--forecast-overlay-muted, #c8d6ef);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.victronBatteryChartSvg {
  display: block;
  width: 100%;
  height: auto;
}

.victronBatteryLine {
  fill: none;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.victronBatteryLine--powerPositive {
  stroke: #5fd38d;
}

.victronBatteryLine--powerNegative {
  stroke: #e86a5a;
}

.victronBatteryArea {
  stroke: none;
}

.victronBatteryArea--powerPositive {
  fill: #5fd38d;
  fill-opacity: 0.38;
}

.victronBatteryArea--powerNegative {
  fill: #e86a5a;
  fill-opacity: 0.38;
}

.victronBatteryArea--voltage {
  fill: #7eb8ff;
  fill-opacity: 0.38;
}

.victronBatteryLine--voltageOk {
  stroke: #7eb8ff;
}

.victronBatteryLine--voltageLow {
  stroke: #e86a5a;
}

.victronBatteryChartHeader--overlay .victronBatteryChartTitle {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.victronBatteryChartTitle {
  font-size: 13px;
  font-weight: 700;
  color: #e8f1ff;
}

.victronBatteryCurrent {
  font-size: 12px;
  font-weight: 600;
  color: #8ea4c7;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.victronBatteryChartSvg--overlay .victronAxisLabel,
.victronBatteryChartSvg--overlay .victronAxisTitle,
.victronBatteryChartSvg--overlay .victronLegendLabel {
  paint-order: stroke fill;
  stroke: rgba(0, 0, 0, 0.75);
  stroke-width: 2px;
  stroke-linejoin: round;
}

.victronBatteryChartSvg--overlay .victronGridLine {
  stroke: rgba(255, 255, 255, 0.14);
}

.victronBatteryChartSvg--overlay .victronAxisLine {
  stroke: rgba(255, 255, 255, 0.22);
}

.victronBatteryChartSvg--overlay .victronAxisLabel,
.victronBatteryChartSvg--overlay .victronAxisTitle {
  fill: var(--forecast-overlay-muted, #c8d6ef);
}

.victronBatteryDot {
  fill: #7eb8ff;
  stroke: rgba(6, 12, 22, 0.9);
  stroke-width: 1;
}

.victronBatteryChartSvg--overlay .victronBatteryDot {
  stroke: rgba(0, 0, 0, 0.65);
}

.victronBatteryLine--current {
  stroke: #e86a5a;
  stroke-dasharray: 5 3;
}

.victronBatteryDot--powerPositive {
  fill: #5fd38d;
}

.victronBatteryDot--powerNegative {
  fill: #e86a5a;
}

.victronBatteryDot--voltageOk {
  fill: #7eb8ff;
}

.victronBatteryDot--voltageLow {
  fill: #e86a5a;
}

.victronBatteryDot--current {
  fill: #e86a5a;
}

.victronBatteryLine--amphours {
  stroke: #e86a5a;
  stroke-dasharray: 5 3;
}

.victronBatteryZeroLine {
  stroke: rgba(158, 176, 204, 0.45);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

.victronAxisLabel--right {
  fill: #c98f84;
}

.victronAxisTitle--right {
  fill: #c98f84;
}

@media (max-width: 720px) {
  .victronBatteryCharts {
    grid-template-columns: 1fr;
  }
}
