* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: #0b1727;
  color: #f3f6fb;
}

/* Header */

header {
  padding: 12px 16px;
  background: #0b3d91;
  border-bottom: 1px solid #0a2f6d;
}

h1 {
  margin: 0;
  font-size: 20px;
}

.sub {
  opacity: 0.9;
  font-size: 13px;
}

/* Controls bar */

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: #0b1727;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid #0a2f6d;
}

.controls label {
  font-size: 14px;
}

.controls input {
  margin-left: 6px;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #294d86;
  background: #0e2242;
  color: #f3f6fb;
  width: 90px;
}

.controls button {
  padding: 8px 12px;
  background: #3ba16d;
  border: none;
  border-radius: 8px;
  color: #041b0f;
  font-weight: 600;
  cursor: pointer;
}

/* Map */

#map {
  height: 45vh;
  width: 100%;
}

.leaflet-container {
  background: #0b1727;
}

/* Generic layout blocks (cards/bestday legacy containers) */

.cards,
.bestday {
  padding: 10px 16px;
}

.cards h2,
.bestday h2 {
  margin: 10px 0 6px 0;
  font-size: 18px;
}

/* Top Picks grid */

#results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem 1.25rem;
  align-items: stretch;
}

/* Card styling */

.card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 22, 40, 0.9);
  padding: 0.7rem 0.9rem;
  margin: 10px 0;
  z-index: 2500;
}

.card h3 {
  margin: 0 0 6px 0;
}

.card header {
  margin-bottom: 0.35rem;
}

.card .row {
  margin: 0.2rem 0;
}

.card .score {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

/* Older helpers still used in some markup */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #233f73;
  border: 1px solid #3963ad;
  color: #dbe8ff;
  font-size: 12px;
  margin-right: 6px;
}

.stat {
  font-size: 14px;
  margin: 6px 0;
}

.btns a {
  display: inline-block;
  margin-right: 8px;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #16315d;
  border: 1px solid #264f93;
  color: #e1edff;
  text-decoration: none;
  font-size: 13px;
}

.rank {
  font-weight: 700;
}

footer {
  padding: 16px;
  text-align: center;
  opacity: 0.8;
}

.weather {
  font-size: 13px;
  opacity: 0.95;
}

.icon {
  font-style: normal;
  margin-right: 6px;
}

.legend {
  position: absolute;
  right: 10px;
  top: 70px;
  background: #0e2242;
  border: 1px solid #18345f;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
}

.score {
  font-size: 22px;
  font-weight: 800;
}

/* (Legacy) old inline species layout — harmless to keep */
.species {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.species .group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-height: 76px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #294d86;
  border-radius: 8px;
  background: #0e2242;
}

.species label {
  font-size: 13px;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid #18345f;
  border-radius: 8px;
  background: #0f1e39;
}

/* --- Species dropdown styles (new) --- */

.species-select {
  position: relative;
}

.species-toggle {
  background: #ffffff;
  color: #111;
  border-radius: 6px;
  border: 1px solid #294d86;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
}

/* The dropdown panel itself */
.species-panel {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #ffffff;
  color: #111;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  padding: 4px 0;
  max-height: 260px;
  overflow-y: auto;
  min-width: 220px;
  z-index: 1000;
}

/* Each species row */
.species-option {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 2px 8px;
  background: #ffffff;
  color: #111;
  font-size: 13px;
}

/* Hover state */
.species-option:hover {
  background: #f0f4ff;
}

/* Checkbox accent color */
.species-option input[type="checkbox"] {
  accent-color: #1e90ff;
}

/* --- Top Pick forecast mini-cards --- */

.forecast-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.forecast-block > strong {
  font-size: 0.85rem;
  opacity: 0.8;
}

.forecast-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.forecast-row.empty {
  font-size: 0.8rem;
  opacity: 0.7;
}

.forecast-day {
  flex: 1 1 0;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.fd-label {
  font-size: 0.8rem;
  font-weight: 600;
}

.fd-temp {
  font-size: 0.85rem;
}

.fd-meta {
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  opacity: 0.85;
}

/* --- keep header + controls + species dropdown above the map --- */

header {
  position: sticky;
  top: 0;
  z-index: 3100;         /* above Leaflet panes */
}

/* controls bar stays just under the header, always visible */
.controls {
  position: sticky;
  top: 69px;             /* adjust if your header is taller/shorter */
  z-index: 3100;
  background: #0b1727;   /* solid background behind the dropdown */
}

/* species dropdown panel must be above everything else */
.species-panel {
  z-index: 3200;
}

/* Hard-hide any legacy Best Day block if it still exists in the HTML */
.bestday {
  display: none !important;
}

/* === FORCE Target species menu to be white === */

/* The dropdown panel & everything inside it */
.species-panel,
.species-panel * {
  background: #ffffff !important;
  color: #000000 !important;
}

/* Each row in the menu */
.species-option {
  background: #ffffff !important;
  color: #000000 !important;
  border: none !important;
}

/* Hover state – light hint of blue, still white-ish */
.species-option:hover {
  background: #eef4ff !important;
}

/* The "Target species: Any" button */
.species-toggle {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #294d86 !important;
}


