/* --- MAP OVERLAY CONTROLS --- */
#map-geocoder-container {
  position: absolute;
  top: 80px;
  left: 10px;
  z-index: 1001;
  width: 450px;
  pointer-events: auto;
}

#map-geocoder-container * {
  pointer-events: auto; /* Children (inputs, etc.) are clickable */
}

#map-search-container,
#address-search-container {
  position: relative;
  margin-top: 10px;
}

/* UNIFIED SEARCH INPUT STYLING */
#custom-search-box,
#proponent-search-box,
#list-search-box,
#address-search-box {
  width: 100% !important;
  height: 38px !important;
  padding: 6px 10px !important;
  box-sizing: border-box;
  border-radius: 4px !important;
  border: 1px solid #f8f8f8 !important;
  background-color: #fff !important;
  font-size: 1em !important;
  color: #2d3436 !important;
  text-align: left !important;
}

#custom-search-box::placeholder,
#address-search-box::placeholder {
  color: #b2bec3;
  opacity: 1; /* Firefox fix */
}

#custom-search-box:hover,
#address-search-box:hover {
  border-color: black !important;
  box-shadow: 0 0 3px black !important;
}

/* UNIFIED SUGGESTION DROPDOWN STYLING */
#search-suggestions,
#proponent-search-suggestions,
#address-search-suggestions {
  background: #fff !important;
  border: 1px solid #f8f8f8 !important;
  border-radius: 4px !important;
  list-style: none;
  padding: 0;
  margin: 4px 0 0 0;
  color: #2d3436 !important;
}

.suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  color: #2d3436 !important;
  border-bottom: 1px solid #ccc;
  display: block;
  background-color: white;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background-color: #f8f8f8 !important;
  color: #000 !important;
}

.suggestion-item {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
}

.suggestion-item-logo {
  height: 22px;
  width: 22px;
  margin-left: 12px;
  flex-shrink: 0; /* Prevents the logo from shrinking */
}

/* Address geocoder results: two stacked lines (bold name + lighter context) */
#address-search-suggestions .suggestion-item {
  display: block !important;
}

.address-suggestion-title {
  font-weight: 700;
  color: #2d3436;
  line-height: 1.3;
}

.address-suggestion-context {
  color: #404040;
  line-height: 1.3;
}

#legend {
  background: rgba(45, 52, 54, 0.9);
  margin: 10px;
  border-radius: 5px;
  font-size: 0.9em;
  color: #f8f8f8;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  padding: 0;
  overflow: hidden; /* Hides the content when collapsed */
  transition: max-height 0.3s ease-in-out;
}
.legend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 10px 12px;
  position: relative;
  z-index: 2;
}

/* The chevron icon */
.legend-chevron {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-135deg); /* Points down when closed */
  transition: transform 0.3s ease;
  margin-left: 10px;
}

/* The wrapper for the list of methods */
.legend-content {
  max-height: 0; /* Collapsed by default */
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 12px; /* Horizontal padding */
}

/* When open, expand the content area */
#legend.open .legend-content {
  max-height: 500px; /* A large value to show all content */
  padding-bottom: 10px; /* Add spacing at the bottom when open */
  transition: max-height 0.3s ease-in;
}

/* When open, flip the chevron to point up */
#legend.open .legend-chevron {
  transform: rotate(45deg);
}

#legend h4 {
  margin: 3px 0 3px;
  color: #fff;
  font-size: 1.2em;
}
#legend .legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}
#legend .legend-color {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border-radius: 3px;
  border: 1px solid #ccc;
}

.dropdown {
  position: relative;
  display: inline-block;
  z-index: 4999;
}

#header .dropbtn,
#column-toggle-dropdown .dropbtn {
  background-color: #f8f8f8;
  color: #494949;
  padding: 5px 16px 5px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-size: 0.9em;
  font-weight: 400;
  border: none;
  cursor: pointer;
  border-radius: 25px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  margin: 1em;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.2s,
    transform 0.1s ease-in-out;
  gap: 8px;
  display: flex;
}

.dropbtn span {
  margin-top: -4px; /* Adjust text upward */
  margin-left: auto;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f8f8f8;
  min-width: 250px;
  border: 1px solid #25385b;
  border-radius: 12px;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
  padding: 12px;
  z-index: 5000;
  margin-top: 8px;
}
.dropdown-content input,
.dropdown-content select,
.dropdown-content button {
  display: block;
  margin-bottom: 8px;
}

.dropdown-content input[type="radio"] {
  display: block;
  margin-bottom: 2px !important;
}

.dropdown.open .dropdown-content {
  display: block;
}

.dropdown.open #dropdown-content-method.dropdown-content {
  max-height: 70vh;
  overflow-y: auto;
}

#header .dropbtn.pending-changes {
  background-color: #bcdbf3; /* A light blue for pending changes */
  border-color: #bcdbf3;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

#header .dropbtn.filter-active {
  background-color: #0984e3; /* A solid blue for applied filters */
  color: #ffffff;
  border-color: #023974;
}

#header .dropbtn.filter-active .chevron {
  border-right-color: #ffffff;
  border-bottom-color: #ffffff;
}

.floating-label {
  position: relative;
  margin: 1rem 0;
  padding-top: 1rem; /* Reserve space above input */
  cursor: text;
}

.floating-label input {
  width: 100%;
  padding: 14px 12px 10px 12px;
  font-size: 14px;
  box-sizing: border-box;
}

.floating-label label {
  position: absolute;
  top: 26px;
  left: 12px;
  font-size: 16px;
  color: #aaa;
  pointer-events: none;
  transition: all 0.2s ease;
}

/* When user types or focuses */
.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
  top: -8px;
  font-size: 12px;
  color: #333;
  background: white;
  padding: 0 4px; /* ⬅ add this */
  line-height: 1.2; /* ⬅ optional: tightens label height */
}

.dropdown .chevron {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid #595959;
  border-bottom: 2px solid #595959;
  transform: rotate(45deg);
  transition: transform 0.3s ease;
}

.dropdown.open .dropbtn .chevron {
  transform: translateY(4px) rotate(-135deg);
}

.method-group .chevron {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid #595959;
  border-bottom: 2px solid #595959;
  transform: rotate(45deg);
  transition: transform 0.3s ease;
}

.chevron-wrapper {
  margin-left: auto; /* Pushes the button to the far right */
  padding: 8px; /* Increases the clickable area around the chevron */
  cursor: pointer;
  display: inline-flex;
  position: relative; /* Add this */
  top: -2px; /* And add this to shift it up */
}

.dropdown.open .method-group.open .chevron {
  transform: translateY(4px) rotate(-135deg);
}

.info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  row-gap: 16px; /* increased vertical spacing between rows */
  column-gap: 16px;
  align-items: start;
  margin-top: 0px;
}
.info-grid .label {
  font-weight: bold;
  text-align: left;
}

.prop-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  row-gap: 16px; /* increased vertical spacing between rows */
  column-gap: 16px;
  align-items: center;
  margin-top: 0px;
}
.prop-grid .label {
  font-weight: bold;
  text-align: left;
}

/* This is the new parent flex container */
.expandable-content {
  display: flex;
  align-items: flex-start; /* Aligns the top of the text and button */
  flex-wrap: wrap; /* Allows button to drop to the next line when text expands */
}

/* This is the text container */
.read-more-container {
  overflow: hidden;
  line-height: 1.4em;
  max-height: 1.4em; /* Clips the text to a single line */
  white-space: normal;
  transition: max-height 0.15s ease-out;
}

/* This rule handles the expanded state */
.read-more-container.expanded {
  flex-basis: 100%; /* Makes the text take the full line, forcing the button below */
  max-height: 1000px;
}

.read-more-container.start-collapsed {
  max-height: 0;
  white-space: normal;
}

/* This is the button */
.read-more-btn {
  flex-shrink: 0; /* Prevents the button from shrinking */
  background: none;
  border: none;
  color: #007bff;
  cursor: pointer;
  font-size: 0.9em;
  padding-left: 6px;
  margin-top: 0;
  white-space: nowrap;
}

/* --- Pill-shaped Method Selector (Corrected) --- */
.method-group {
  list-style: none;
  padding: 0;
  margin-bottom: 5px;
}

/* Style for the clickable rows (which are now <label> elements) */
.method-row,
.subtype-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 5px 0;
  border-radius: 25px;
  background-color: #f1f3f5;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.method-row:hover,
.subtype-row:hover {
  background-color: #e9ecef;
}

/* Target specifically the Map Layers menu items */
#layer-checkbox-tree .subtype-row {
  transition: all 0.2s ease-in-out;
}

#layer-checkbox-tree .subtype-row:hover {
  background-color: #bcdbf3; /* Light blue highlight */
  transform: translateX(5px); /* Slide slightly to the right */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  border-color: #0984e3;
}

/* Make the text part of the label expand */
.method-row > span,
.subtype-row > span {
  flex-grow: 1;
  position: relative; /* Required for vertical adjustment */
  top: 0px; /* Moves the text up by 1 pixel */
  margin-left: 4px; /* Moves the text to the right */
  font-size: 14.4px; /* Sets the text size */
  color: #595959;
}

/* The chevron wrapper is NOT part of the label's clickable area */
.method-row .chevron-wrapper {
  flex-shrink: 0;
}

/* The list for sub-methods, with correct indentation */
.subtype-list {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-left: 40px; /* This creates the indent */
}

.method-row > input[type="checkbox"],
.subtype-row > input[type="checkbox"] {
  position: relative;
  top: 3px; /* Moves the checkbox down by 1 pixel */
}

/* --- Unified Range Slider Styles --- */
/* This base style applies to ALL noUiSliders */
.noUi-target {
  background: #d1e0ec;
  border-radius: 4px;
  border: none;
  height: 6px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}
/* Style for the active range selection */
.noUi-connect {
  background: #0984e3;
}
/* Style for the draggable handles */
.noUi-handle {
  width: 18px !important;
  height: 18px !important;
  right: -9px !important;
  top: -7px !important;
  border-radius: 50%;
  border: 1px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  background: #0984e3;
  cursor: grab;
}
.noUi-handle:focus {
  outline: none;
}
.noUi-handle:active {
  cursor: grabbing;
}
/* Remove default library handle elements */
.noUi-handle::before,
.noUi-handle::after {
  display: none;
}
/* Style for the tooltips that show the current value */
.noUi-tooltip {
  border: none;
  border-radius: 4px;
  background: #25385b;
  color: #fff;
  font-size: 0.8em;
  font-weight: bold;
  padding: 4px 8px;
  bottom: 150%;
}
/* Styles for the pips (e.g., year markers) */
.noUi-pips {
  color: #595959;
  font-size: 12px;
}
.noUi-value {
  margin-top: 8px; /* Give labels more space */
}
.noUi-marker {
  background: #b2bec3;
  height: 5px;
}
