/* ===========================
   MAP + POPUPS
   =========================== */

#map {
  min-height: 480px;
}



.btr-aq-snowflake-marker img {
  display: none;
}

/* High-contrast AQ snow station marker */
.btr-aq-snowflake-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;                /* bright magenta (almost never in basemap) */
  border: 2px solid #009cff;          /* white border */
  color: #ffffff;                     /* white snowflake */
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;

  box-shadow:
    0 0 3px rgba(255, 255, 255, 0.9),
    0 0 6px rgba(255, 255,255 , 0.9);   /* slight glow */
}


.btr-av-popup {
  font-family:
    "Montserrat",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-size: 12px;
}

.btr-av-popup-name {
  font-weight: 600;
  margin-bottom: 3px;
}

.btr-av-popup-group {
  font-size: 11px;
  color: #a4a9b7;
  margin-bottom: 4px;
}

.btr-av-popup-meta {
  font-size: 11px;
  color: #8c91a2;
}

.leaflet-popup-content-wrapper {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===========================
   STATION PANEL
   =========================== */

#avalanche-container {
  margin-top: 12px;
}

#avalanche-container h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.station-header {
  margin-bottom: 6px;
}

.station-source {
  font-size: 12px;
  color: #a4a9b7;
  margin-top: 2px;
}

.station-meta {
  font-size: 12px;
  line-height: 1.4;
  color: #d0d3dd;
  margin-bottom: 6px;
}

#station-readings-panel {
  margin-top: 12px;
  max-width: 1600px;
  margin: auto;
  background: linear-gradient(145deg, #f7f7f7, #e6e6e6);
  border-radius: 12px;
  box-shadow: 5px 5px 10px #cccccc, -5px -5px 10px #ffffff;
}

#station-readings-panel .station-header {
  margin-bottom: 4px;
}

/* ===========================
   READINGS TABLE (CORE)
   =========================== */

.station-readings-table-wrapper {
  max-height: 260px;
  overflow-y: auto;
  overflow-x: auto; /* horizontal scroll on small screens */
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* 4 columns: Time | Temp | Snow | Precip */
.station-readings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: auto;   /* browser handles widths */
  min-width: 480px;     /* avoid columns collapsing */
}

/* Sticky header via th for better cross-browser support */
.station-readings-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(8, 10, 16, 0.95);
  backdrop-filter: blur(4px);
}

.station-readings-table th,
.station-readings-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.station-readings-table th:first-child,
.station-readings-table td:first-child {
  text-align: left; /* Time */
}

.station-readings-table th:not(:first-child),
.station-readings-table td:not(:first-child) {
  text-align: center; /* numeric columns */
}

.station-readings-table th {
  font-weight: 600;
  color: #c9cede;
}

.station-readings-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.station-readings-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Latest row highlight */
.station-readings-table tbody tr.latest-row {
  background: rgba(66, 184, 131, 0.12);
}

/* ===========================
   DAILY GROUPS (COLLAPSIBLE)
   =========================== */

/* Everything for one day lives in <tbody class="day-group"> */
.day-group.collapsed .day-row {
  display: none;
}

/* Day header row (one cell, colspan="4") */
.station-readings-table tr.day-header-row td {
  padding: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  white-space: normal; /* allow wrapping */
  cursor: pointer;
}

/* Inner layout for summary row */
.day-summary-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
}

.day-summary-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.day-title {
  font-weight: 600;
}

.day-toggle-indicator {
  font-size: 10px;
  display: inline-block;
}

/* Summary metrics on the right */
.day-summary-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.metric-pill {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Hover for header row */
.station-readings-table tr.day-header-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

/* Hourly rows */
.station-readings-table tr.day-row {
  font-size: 10px;
}

/* ===========================
   CHART
   =========================== */

.station-chart-wrapper {
  margin-top: 10px;
  height: 400px;
}

.station-chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ===========================
   RANGE BUTTONS
   =========================== */

.station-range-buttons {
  margin-top: 8px;
  font-size: 11px;
}

.station-range-buttons .range-label {
  margin-right: 6px;
  opacity: 0.8;
}

.station-range-buttons .range-btn-row {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

.station-range-buttons .range-btn {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}

.station-range-buttons .range-btn.active {
  background: rgba(255, 255, 255, 0.15);
}

/* ===========================
   HEADER TOTALS
   =========================== */

.station-header-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.station-header-left {
  flex: 1 1 230px;
}

.station-header-right {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  margin-top: 18px;
  margin-bottom: 10px;
  gap: 12px;
  font-size: 1.17em;
  text-align: right;
  color: #444;
}

.station-totals {
  min-width: 110px;
}

.station-meta-block.station-totals {
  font-size: 13px;       /* similar to left meta size */
  line-height: 1.4;
  color: #444;           /* dark grey, same vibe as left */
  text-align: right;
}

/* "New Snow" title */
.station-meta-title {
  font-size: 14px;       /* a bit bigger, like a small heading */
  font-weight: 600;
  color: #000;           /* black title, same as left headings */
  margin-bottom: 4px;
}

/* Each row: 24 h / 3 d / 7 d */
.station-meta-row {
  display: flex;
  justify-content: space-between; /* label left, value right */
  gap: 6px;
  margin: 1px 0;
}

/* Left label (24 h, 3 d, 7 d) */
.station-meta-label {
  font-weight: 600;      /* like "Location:", "Elevation:" */
  color: #555;           /* slightly lighter than value */
}

/* Right value (XX.X cm) */
.station-meta-value {
  font-weight: 500;
  color: #000;           /* dark text so it reads on light bg */
}

/* ===========================
   RESPONSIVE TWEAKS
   =========================== */

@media (max-width: 1024px) {
  .station-readings-table {
    font-size: 10px;
  }

  .station-readings-table th,
  .station-readings-table td {
    padding: 3px 4px;
  }

  .station-readings-table-wrapper {
    max-height: 220px;
  }
}

@media (max-width: 600px) {
  .station-readings-table {
    font-size: 9px;
    min-width: 420px; /* allow some horizontal scroll */
  }

  .station-readings-table th,
  .station-readings-table td {
    padding: 3px 3px;
  }

  .station-readings-table-wrapper {
    max-height: 220px;
  }

  .day-summary-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .day-summary-metrics {
    justify-content: flex-start;
  }
}