/* BayesGWL - page-specific styles, built on theme.css tokens */

.gwl-app {
  padding: 56px 24px 96px;
}

.gwl-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  padding: 14px 18px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(16, 48, 77, 0.06);
  position: sticky;
  top: 76px;
  z-index: 10;
}

.gwl-steps a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-900);
  background: var(--slate-100);
}

.gwl-steps a:hover {
  background: var(--teal-400);
  color: var(--navy-950);
}

.gwl-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(16, 48, 77, 0.06);
  margin-bottom: 28px;
  scroll-margin-top: 130px;
}

.gwl-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--navy-900);
}

.gwl-hint {
  margin: 0 0 20px;
  font-size: 14.5px;
  color: var(--slate-500);
}

.gwl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.gwl-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--slate-500);
}

.gwl-row input[type="number"],
.gwl-row select {
  padding: 8px 10px;
  border: 1px solid rgba(16, 48, 77, 0.14);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--navy-900);
  background: var(--slate-50);
  width: 110px;
}

.gwl-slider-label input[type="range"] {
  width: 260px;
}

/* Wide enough to show the full option text (e.g. "Local (mean of nearest
   neighbors)") without truncation. */
.gwl-row select.gwl-select-wide {
  width: auto;
  min-width: 260px;
}

/* theme.css styles .btn-ghost for the dark hero band (white text on a
   translucent white fill), which renders invisible on these white cards.
   Restyle it for a light background wherever it appears inside the app. */
.gwl-card .btn-ghost {
  background: #fff;
  color: var(--navy-900);
  border-color: rgba(16, 48, 77, 0.25);
}

.gwl-card .btn-ghost:hover {
  background: var(--slate-100);
  color: var(--navy-900);
}

.gwl-card .btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gwl-slider-row {
  align-items: center;
}

/* Fixed column widths for the name / track / readout, so every slider in a
   group is the same length and they line up as a column - regardless of
   label length or whether the row also carries a "max" spin box. */
.gwl-slider-row .gwl-slider-label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.gwl-slider-name {
  flex: 0 0 140px;
  width: 140px;
}

.gwl-slider-row .gwl-slider-label input[type="range"] {
  flex: 0 0 320px;
  width: 320px;
  min-width: 0;
}

.gwl-slider-row .gwl-slider-max {
  flex: 0 0 auto;
  white-space: nowrap;
}

.gwl-slider-row .gwl-slider-max input[type="number"] {
  width: 90px;
}

/* Fixed (not min-) width so the trailing "max" spin boxes line up too. */
.gwl-slider-row output {
  flex: 0 0 56px;
  width: 56px;
  text-align: right;
  font-weight: 700;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
}

#krig-order,
#nga-elevation-source,
#grid-mode {
  width: 230px;
}

.gwl-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--slate-100);
  color: var(--navy-900);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.gwl-file input[type="file"] {
  max-width: 180px;
}

.gwl-count,
.gwl-status {
  font-size: 13px;
  color: var(--slate-500);
  font-weight: 600;
}

.gwl-table-wrap {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid rgba(16, 48, 77, 0.1);
  border-radius: 10px;
}

.gwl-table {
  width: 100%;
  border-collapse: collapse;
}

.gwl-table th,
.gwl-table td {
  padding: 6px 10px;
  font-size: 13.5px;
  text-align: left;
  border-bottom: 1px solid var(--slate-100);
}

.gwl-table th {
  position: sticky;
  top: 0;
  background: var(--slate-100);
  color: var(--navy-900);
}

.gwl-table input[type="number"] {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(16, 48, 77, 0.12);
  border-radius: 6px;
  font-size: 13.5px;
}

.gwl-row-del {
  border: 0;
  background: none;
  color: var(--slate-500);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.gwl-row-del:hover {
  color: #d33;
}

.gwl-canvas {
  width: 100%;
  height: 320px;
  display: block;
  border-radius: 10px;
  background: var(--slate-50);
  border: 1px solid rgba(16, 48, 77, 0.08);
}

.gwl-map {
  width: 100%;
  height: 420px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(16, 48, 77, 0.08);
  background: var(--slate-50);
}

/* No container border here: each Plotly chart draws its own mirrored axis
   frame (see axisFrame() in charts.js), so a container border would sit
   away from the actual plot area - most visibly on the correlation plot,
   where a locked 1:1 aspect ratio leaves wide empty margins. */
.gwl-plot {
  width: 100%;
  height: 460px;
  border-radius: 10px;
  background: #fff;
}

.gwl-map.gwl-map--tall {
  height: 560px;
}

.gwl-basemap-select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  color: var(--navy-900);
  cursor: pointer;
}

.gwl-cross-marker svg {
  display: block;
  overflow: visible;
}

/* On-map gradient legend for the interpolated water level surface,
   styled to match the kriging legend in the AMSA dashboard. */
.gwl-map-legend {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(16, 48, 77, 0.2);
  font-size: 11.5px;
  color: var(--navy-900);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.gwl-map-legend-title {
  font-weight: 600;
}

.gwl-map-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gwl-map-legend-row canvas {
  border-radius: 2px;
  image-rendering: pixelated;
}

.gwl-colorbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--slate-500);
}

.gwl-colorbar-gradient {
  flex: 1;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(16, 48, 77, 0.1);
}

.gwl-summary {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--navy-900);
  background: var(--slate-100);
  padding: 10px 14px;
  border-radius: 8px;
  min-height: 20px;
}

.gwl-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--slate-100);
  overflow: hidden;
  margin-bottom: 16px;
}

.gwl-progress-bar {
  height: 100%;
  width: 0;
  background: var(--teal-400);
  transition: width 0.2s ease;
}

@media (max-width: 760px) {
  .gwl-steps {
    position: static;
  }

  .gwl-card {
    padding: 22px;
  }
}
