/* RDAS app styles. Loaded after Bootstrap and kwl-tokens.css. Use the --kwl-* / --bs-* variables, never hex values. */

/* Messages (success, errors) pinned top-right below the navbar; they stay until closed. */
.messages-container {
  position: fixed;
  top: 4.5rem;
  right: 1rem;
  z-index: 1090; /* above page content and charts, below modals' backdrop clicks */
  width: 24rem;
  max-width: calc(100% - 2rem);
}

/* Some alert colours are see-through tints (kwl-tokens.css: success = 12% green).
   Floating over the page they must be solid, so paint the tint on top of the page background. */
.messages-container .alert {
  background-color: var(--bs-body-bg);
  background-image: linear-gradient(var(--bs-alert-bg), var(--bs-alert-bg));
}

/* KWL logo in the navbar: a fixed height, width follows the file's own proportions (never stretched). */
.navbar-logo {
  height: 2rem;
  width: auto;
}

/* Full-page overlay with a spinner while a slow form (e.g. FlowWorks download) is submitting. */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(var(--bs-body-bg-rgb), 0.85);
}

/* "Full screen" on a chart card (charts.js, data-chart-fullscreen): the card fills the window,
   above the page (and the navbar) but below pop-up messages and modals. The chart takes most
   of the height; the legend and Baseline table stay underneath, scrolling if needed. */
.chart-card-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1045;
  margin: 0 !important;
  border-radius: 0;
  overflow-y: auto;
}

.chart-card-fullscreen .chart-container {
  height: 70vh;
}

/* Charts need a container with a fixed height to size themselves. */
.chart-container {
  position: relative;
  height: 360px;
}

/* Chart legend under the dye curve chart (dye_curve_chart.js): a short line sample per item,
   drawn as a top border in the channel's colour, faded / bold / dashed like the line it stands for. */
.chart-legend-item {
  color: var(--bs-body-color);
  border: 0;
}

.chart-legend-swatch {
  display: inline-block;
  width: 1.75rem;
  border-top: 2px solid currentColor;
}

.chart-legend-a { color: var(--kwl-chart-1); }
.chart-legend-b { color: var(--kwl-chart-2); }
.chart-legend-faded { border-top-width: 1px; opacity: 0.35; }
.chart-legend-bold { border-top-width: 3px; }
.chart-legend-dashed { border-top-width: 1px; border-top-style: dashed; }

/* Calibration table: scrolls inside the card once there are many rows. */
.calibration-readings {
  max-height: 480px;
  overflow-y: auto;
}

/* Bootstrap's error state adds a warning icon inside the box, with extra right padding to
   make room for it, which made the box (and its column) grow and shrink as errors came and
   went. Reserve the same padding on every box, so the icon fits without changing the size.
   (Same value Bootstrap uses for .form-control.is-invalid.) */
.calibration-readings .form-control {
  padding-right: calc(1.5em + 0.75rem);
}
