:root {
  --large-color: #ff5a3c;
  --reef-color: #2f8fd6;
  --macro-color: #7c4fd6;
  --muted-color: #9aa5aa;
  --ink: #16232b;
  --bg: #f6f8f9;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--ink);
  color: white;
}

header .brand {
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  color: white;
}

header .brand span { color: var(--large-color); }

header nav a {
  color: white;
  text-decoration: none;
  margin-left: 18px;
  font-size: 14px;
  opacity: 0.85;
}

header nav a:hover, header nav a.active { opacity: 1; text-decoration: underline; }

#map {
  position: absolute;
  top: 48px;
  bottom: 0;
  left: 0;
  right: 0;
}

#status {
  position: absolute;
  z-index: 1000;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(22, 35, 43, 0.9);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  transition: opacity 0.6s ease;
  pointer-events: none; /* never blocks clicks on whatever's underneath it */
}

/* On the season page, the button row sits at top:60px, so push the status
   message below it instead of stacking on top and hiding the buttons. */
#status.below-buttons {
  top: 112px;
}

#status.fade { opacity: 0; }

#season-buttons {
  position: absolute;
  z-index: 1000;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: white;
  padding: 6px;
  border-radius: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

#season-buttons button {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
}

#season-buttons button.active {
  background: var(--ink);
  color: white;
}

/* Size / Species filter panels, stacked in the top-right corner */
#filter-panels {
  position: absolute;
  z-index: 1000;
  top: 64px; /* clears the 48px header bar so it never covers the nav links */
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 260px;
}

.filter-panel {
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  padding: 12px 16px;
  max-height: 260px;
  overflow-y: auto;
}

.filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid #ebeeef;
}

.filter-panel h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.filter-toggle-all {
  border: none;
  background: none;
  padding: 0;
  color: var(--large-color);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.filter-toggle-all:hover { text-decoration: underline; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.filter-row input[type='checkbox'] {
  width: 15px;
  height: 15px;
  accent-color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

.filter-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-dot-large { background: var(--large-color); }
.filter-dot-reef { background: var(--reef-color); }
.filter-dot-macro { background: var(--macro-color); }
.filter-dot-muted { background: var(--muted-color); }

/* individual pins */
.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 3px rgba(0,0,0,0.5);
}

.pin-large { background: var(--large-color); }
.pin-reef { background: var(--reef-color); }
.pin-macro { background: var(--macro-color); }

/* cluster badges */
.cluster-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-weight: 600;
  border: 2px solid white;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

.cluster-large { background: var(--large-color); }
.cluster-reef { background: var(--reef-color); }
.cluster-macro { background: var(--macro-color); }

.cluster-small { width: 30px; height: 30px; font-size: 12px; }
.cluster-medium { width: 38px; height: 38px; font-size: 13px; }
.cluster-large.cluster-large, .cluster-reef.cluster-large, .cluster-macro.cluster-large { width: 46px; height: 46px; font-size: 14px; }

/* popup */
.popup { font-size: 13px; min-width: 200px; max-width: 240px; }
.popup-site { font-weight: 700; margin-bottom: 2px; }
.popup-species { color: #444; margin-bottom: 4px; text-transform: capitalize; }
.popup-date { color: #888; font-size: 12px; margin-bottom: 6px; }
.popup-link { color: var(--large-color); text-decoration: none; font-weight: 600; }
.popup-link:hover { text-decoration: underline; }
.popup-photo {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 8px;
}
