.filter-container {
  padding-left: 0;
  padding-right: 0;
}

#filter-bar {
  display: flex; /* Use flexbox for horizontal layout */
  flex-wrap: wrap; /* Allow wrapping to new lines if necessary */
  gap: 5px; /* Spacing between buttons */
  padding: 5px;
}

.filter-button {
  padding: 8px 16px;
  border: #006054 1px solid; /* Border color */
  border-radius: 8px;
  background-color: white; /* Default button color */
  color: #006054;
  cursor: pointer;
  transition: background-color 0.3s; /* Smooth transition for hover effect */
  white-space: nowrap; /* Prevent text from wrapping */
  width: 180px;
}

.clipped-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* Prevent text from wrapping */
  max-width: 210px; /* Set your maximum width */
  display: inline-block; /* Important for width to work correctly */
}

.filter-button:hover {
  background-color: #d0d0d0;
}

.filter-button.active {
  background-color: #007bff; /* Active button color */
  color: white;
}

/* Style for the dropdown menu */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 5px; /* Add rounded corners */
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {background-color: #f1f1f1;}

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

.filter-button {
  position: relative; /* For positioning the dropdown */
  display: inline-flex; /* Use flexbox for icon and text */
  align-items: center; /* Vertically align icon and text */
}

.filter-button::after { /* Dropdown caret */
  content: '\279C'; /* Default: Down caret */
  margin-left: 5px;
  transition: transform 0.3s ease; /* Smooth rotation */
}

.filter-button.show::after { /* Up caret when dropdown is shown */
  transform: rotate(180deg); /* Rotate 180 degrees for up caret */
}

.filter-button.disabled {
  opacity: 0.5; /* Reduce opacity to indicate disabled */
  cursor: not-allowed; /* Change cursor to "not allowed" */
  pointer-events: none; /* prevent clicks from registering */
}

.filter-button.disabled .dropdown-panel{
  pointer-events: none; /* prevent clicks from registering on the dropdown */
}

.dropdown-panel {
  display: none;
  position: absolute;
  top: 100%; /* Position below the button */
  left: 0; /* Align to the left edge of the button */
  background-color: #f9f9f9;
  min-width: 200px; /* Adjust as needed */
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 10000; /* Gotta display panels above eg. map legend items */
  padding: 10px;
  border-radius: 5px;
  white-space: nowrap; /* Prevent contents from wrapping */
}

.dropdown-panel.show {
  display: block;
}

.dropdown-panel label {
  display: block; /* Labels on separate lines */
  margin-bottom: 5px;
}

.dropdown-panel input[type="text"],
.dropdown-panel input[type="checkbox"],
.dropdown-panel input[type="radio"] {
  margin-right: 5px;
}

.dropdown-panel input[type="checkbox"],
.dropdown-panel input[type="radio"] {
  width: auto;
}

.dropdown-panel button {
  margin-top: 10px;
  padding: 5px 10px;
  background-color: #4CAF50;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 5px;
}

/* Style the omni-search input */
#omni-search {
  width: 100%;
  padding: 5px;
  box-sizing: border-box; /* Include padding in width */
  margin-bottom: 5px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

#location-filter { /* Style the location filter button */
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
  white-space: nowrap;
  position: relative; /* For positioning the icon */
  display: inline-flex;
  align-items: center;
}

#location-input-container { /* Container for the input and icons */
  display: flex;
  align-items: center;
  padding-left: 5px; /* Add some left padding */
  width: auto; /*400px;*/
  min-width: 200px; /* This does nothing. Font size + # chars governs minimum width. See common.css */
  border: #006054 1px solid; /* Border around the input container */
  border-radius: 8px; /* Rounded corners */
  background-color: white; /* Background color for the input container */
}

#location-input { /* Style the text input */
  border: none;
  flex-grow: 1; /* Allow input to expand */
  padding: 5px;
  outline: none; /* Remove default focus outline */
  background-color: transparent;
}

#location-search-icon, #location-clear-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#location-search-icon::before { /* Magnifying glass icon */
  /* content: '\1F50D';  Unicode for magnifying glass */
}
.magnifying-glass-button { /* SVG in HTML */
  width: 30px;
  height: 30px;
  fill: #006054; /* Icon color */
}

#location-clear-icon::before { /* 'X' icon */
  content: '\2715'; /* Unicode for multiplication sign */
}

#location-clear-icon {
  display: none; /* Initially hidden */
}

#location-input:not(:placeholder-shown) + #location-clear-icon {
  display: block; /* Show clear icon when input has text */
}

.filter-polygon-checkbox {
  display: flex;
}

/* Filters button: opens a modal with Survey Priority + Survey Method
   (the previous side-by-side dropdowns). Matches .filter-button visually
   so it sits in the bar alongside Adoption Status. */
.filters-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;        /* match Survey / hamburger height */
  padding: 0 12px;
  border: #006054 1px solid;
  border-radius: 5px;
  background-color: white;
  color: #006054;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
  white-space: nowrap;
}
@media (max-width: 419px) {
  .filters-btn { height: 36px; padding: 0 10px; }
}
.filters-btn:hover {
  background-color: #d0d0d0;
}
.filters-btn .fa {
  font-size: 1.05em;
}
/* Count badge — iNat-style: only visible when one or more filters
   inside the modal are selected. */
.filters-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #006054;
  color: white;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  margin-left: 2px;
}
.filters-count[hidden] {
  display: none;
}

/* Filters modal — grouped sections with iNat-style pill toggles. */
.filters-modal .filters-group {
  margin-bottom: 14px;
}
.filters-group-title {
  margin: 0 0 8px;
  font-size: 0.95em;
  color: #006054;
  font-weight: 600;
}
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-pill {
  padding: 6px 14px;
  border: 1px solid #006054;
  border-radius: 999px;   /* full pill */
  background: white;
  color: #006054;
  font-size: 0.95em;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.filter-pill:hover {
  background: #e6f3f1;
}
.filter-pill.selected {
  background: #006054;
  color: white;
}
/* Filters dialog title bar: × on the left, Reset on the right, around the
   "Filters" title (which stays centered via .modal-header text-align). */
.filters-modal-close {
  float: left;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #555;
  cursor: pointer;
  padding: 0 4px;
}
.filters-modal-close:hover { color: #000; }
.filters-reset {
  float: right;
  background: none;
  border: none;
  color: #006054;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  margin-top: 4px;
}
.filters-reset:hover { text-decoration: underline; }

@media (max-width: 576px) {
  .filter-button {
    width: auto;
    min-width: 0;
    padding: 6px 8px;
    font-size: 14px;
  }
  #location-input-container {
    min-width: 0;
  }
}
/* ═══════════════════════════════════════════════════════════════════════
   Consolidated filter popover. Triggered by #filters-btn in the header.
   Holds Adoption Status (radios) + Survey Priority + Survey Method (pills).
   ═══════════════════════════════════════════════════════════════════════ */
.filters-popover {
  position: absolute;
  z-index: 2000;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  padding: 12px 14px;
  display: none;
}
.filters-popover.show { display: block; }
.filters-popover .filters-group { margin-bottom: 10px; }
.filters-popover .filters-group-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #555;
  margin: 0 0 6px;
}
.filters-popover .filter-radios { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.filters-popover .popover-radio {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; cursor: pointer; user-select: none;
}
.filters-popover .filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.filters-popover .filter-pill {
  border: 1px solid #006054;
  background: #fff;
  color: #006054;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 14px;
  cursor: pointer;
}
.filters-popover .filter-pill.selected {
  background: #006054;
  color: #fff;
}
.filters-popover-footer {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid #eee; padding-top: 10px; margin-top: 8px;
}
/* Match the profile popup's .sp-btn look (profile_simple.js), but at the
   16px font the Done button had when it inherited the body size. */
.filters-popover-clear,
.filters-popover-done {
  padding: 11px 14px; font-size: 16px; font-weight: 600; text-align: center;
  border-radius: 6px; cursor: pointer; border: 1px solid #006054;
  background: #fff; color: #006054;
}
.filters-popover-clear:hover,
.filters-popover-done:hover { background: #e6f3f1; }
