html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: Arial, sans-serif;
}

#container {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100vh;
}

#sidebar {
  width: 280px;
  background: #f9f9f9;
  border-right: 1px solid #ddd;
  padding: 15px;
  overflow-y: auto;
}

#map-container {
  position: relative;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* This blur layer sits ABOVE the map but BELOW popovers */
#map-blur-overlay {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(8px);
  background: rgba(164, 54, 54, 0.05); /* optional */
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
  z-index: 1000;
}

:popover-open {
  width: 300px;
  height: 200px;
  padding: 0 10px;
  border-radius: 10px;
}

/* Center the popover inside map-container */
#map-container #search-popover {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: white;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

#search-popover .input-container {
  position: relative; /* dropdown will position relative to this */
  width: 100%;        /* optional, to match input width */
}

#autocompleteList {
  position: absolute;
  top: 100%;       /* directly below input */
  left: 0;
  width: 100%;     
  max-height: 200px;
  overflow-y: auto;
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 1000;
}

select {
  border: 2px solid #dddddd;
  background: #ffffff;
  padding: 10px;
  border-radius: 6px;
  transition: 0.4s;
}

#blockAddress {
  font-style: italic;
  margin-bottom: 8px;
}

#pinnedBlockInfo {
  margin-bottom: 8px;
}

#pinned-block-popover {
  position: absolute;
  top: 50%;
  left: 70%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: white;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

#map-legend {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(255,255,255,0.9);
  padding: 8px;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  z-index: 9999;
}

.legend-scale {
  display: flex;
  align-items: center;
  gap: 0px;
}

.legend-color {
  width: 40px;
  height: 14px;
  display: inline-block;
  opacity: 0.7; /* match opacity of polygons */
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  margin-top: 4px;
}

.popover {
  position: absolute;
  top: 20px;
  left: 20px;
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  max-width: 250px;
  z-index: 5000; /* sits above map */
}

.hidden {
  display: none;
}

.info-box {
  font-family: 'Arial', sans-serif;
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #ddd;
  max-width: 700px;
  line-height: 1.6;
}

.info-box h3 {
  margin-top: 0;
  font-weight: 600;
  color: #333;
}

#nwi-formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 1em;
  margin-top: 10px;
  margin-bottom: 10px;
}

/* Fraction styling */
.fraction {
  display: inline-block;
  text-align: center;
  vertical-align: middle;
  position: relative;
  margin: 0 4px;
}

.numerator {
  display: block;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  color: #2c7fb8;
  transition: background 0.2s;
}

.numerator:hover {
  background: rgba(44, 127, 184, 0.1);
  border-radius: 4px;
}

.denominator {
  display: block;
  border-top: 2px solid #333;
  padding: 2px 0;
  font-weight: 500;
}

/* Tooltip styling */
.tooltip .tooltiptext {
  visibility: hidden;
  width: max-content;
  max-width: 180px;
  font-family: 'Arial', sans-serif;
  background-color: #333;
  color: #fff;
  text-align: left;
  padding: 5px 8px;
  border-radius: 6px;
  position: absolute;
  z-index: 5000;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.8em;
  line-height: 1.3;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
  z-index: 1000;
}

.tooltip .tooltiptext::after {
  font: 'Arial';
  content: '';
  position: absolute;
  top: 100%; /* arrow at the bottom of tooltip */
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.button-container {
  margin-top: 15px;
  margin-bottom: 15px;
}

/* Minimal modern buttons */
.important-btn {
  display: block;
  padding: 0.5em 1.2em;
  margin-left: auto;
  margin-right: auto;
  max-width: 200px;
  font-size: 1rem;
  font-weight: 500;
  color: #ffffff; /* Primary accent color for text */
  background-color: #2ca5b8; /* matches container */
  border: 1px solid #2ca5b8; /* subtle outline */
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

/* Hover state */
.important-btn:hover {
  background-color: #299bac; /* subtle highlight */
}

/* Focus outline for accessibility */
.important-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(44, 127, 184, 0.3);
}

/* Active / pressed state */
.important-btn:active {
  background-color: #299bac;
  transform: translateY(1px);
  box-shadow: none;
}

/* Medium important buttons */
.medium-btn {
  display: block;
  padding: 0.5em 1.2em;
  margin-left: auto;
  margin-right: auto;
  max-width: 200px;
  font-size: 1rem;
  font-weight: 500;
  color: #2ca5b8; /* Primary accent color for text */
  background-color: transparent; /* matches container */
  border: 1px solid #2ca5b8; /* subtle outline */
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

/* Hover state */
.medium-btn:hover {
  background-color: rgba(44, 127, 184, 0.1); /* subtle highlight */
}

/* Active / pressed state */
.medium-btn:active {
  background-color: rgba(44, 127, 184, 0.2);
  transform: translateY(1px);
  box-shadow: none;
}

/* Minimal modern buttons */
.minor-btn {
  display: inline-block;
  padding: 0.2em 0.5em;
  margin: 2px 4px;
  max-width: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #ffffff; /* Primary accent color for text */
  background-color: #2ca5b8;
  border: 1px solid #2ca5b8; /* subtle outline */
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.minor-btn:disabled {
  opacity: 0.5;
}

.alt-minor-btn {
  display: inline-block;
  padding: 0.2em 0.5em;
  margin: 2px 4px;
  max-width: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #2ca5b8; /* Primary accent color for text */
  background-color: #ffffff;
  border: 1px solid #2ca5b8; /* subtle outline */
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

