/************************************
 * donor-search-new.css
 * 
 * Modern bar-based layout 
 * Left side: All Filters + pills inline
 * Right side: "Treatment in" + # Donors
 * 
 * Max width: 1400px to prevent over-expansion 
 ************************************/

 body, h1, h2, h3, p, ul, li, button, input, select {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Open Sans", sans-serif;
}

#donor-search-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto 4rem auto;
  padding: 1rem;
  background-color: #f8fcfe;
  background-image: url(https://copenhagen.ssb.dev/wp-content/uploads/sites/3/2024/10/LargeLeavesBackdrop2.webp);
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: contain;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);  
  min-height: 1600px;
}

/* ---- Filter Bar (top container) ---- */
.donor-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between; /* So left content & right content are separated */
  background-color: #eaf3f9;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* Left side for All Filters + inline pills */
.donor-filter-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* The "All Filters" button */
.filter-button.all-filters-btn {
  display: inline-flex;
  align-items: center;
}

/* The group of inline pills */
.filter-pills-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Right side: "Treatment in" + donor count */
.donor-filter-bar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Basic button styling */
.filter-button, .filter-button-pill {
  background-color: #1e2a38;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}
.filter-button:hover, .filter-button-pill:hover {
  background-color: #2c3e50;
}

/* Example color adjustments for different pills if needed 
   (commented out in this version):
.filter-button-pill#ethnicityPillBtn {
  background-color: #008080; 
}
*/

/* Icon spacing */
.filter-button.all-filters-btn .icon-filters {
  margin-right: 6px;
}

/* The "Measurement" type picker */
.measurement-dropdown-bar {
  display: flex;
  align-items: center;
  column-gap: 0.75rem;
}
.measurement-label {
  font-size: 0.9rem;
  color: #2c3e50;
}

.measurement-type-dropdowns {
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
}

/* The "Treatment in" label, select, and donor count on the right */
.treatment-label {
  font-size: 0.9rem;
  color: #2c3e50;
}
.treatment-country-select {
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
}
.donor-count-label {
  color: #1e2a38;
  font-weight: 600;
  font-size: 1rem;
}

/* ---- All Filters Panel ---- */
.all-filters-panel {
  background-color: #fff;
  border: 1px solid #dde4e9;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: none; /* hidden by default */
}
.all-filters-panel.open {
  display: block;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  flex: 1 1 300px; 
  min-width: 300px;
}

.filters-toggle-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-toggle {
  display: inline-flex;
  flex-direction: column;
  flex: 1 1 300px; 
  min-width: 300px;
}

.label-title {
  margin-bottom: 0.25rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: #34495e;
}

.filter-group input[type="range"],
.filter-group select {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
  outline: none;
}

.filter-group input[type="checkbox"] {
  margin-right: 0.3rem;
  transform: scale(1.2);
  cursor: pointer;
}

.clear-filters-btn, .apply-filters-btn {
  background-color: #4c7d94;
  color: #fff;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.clear-filters-btn:hover, .apply-filters-btn:hover {
  background-color: #5e9cb3;
}

/* A simple button style */
.bar_button {
  background-color: #1e2a38;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color 0.2s ease;
}
.bar_button:hover {
  background-color: #2c3e50;
}

/* The gear icon spacing */
.icon-filters {
  margin-right: 6px;
}


/* Stock toggle pill: changes text from OFF to ON if data-stock-active="1" in JS. */
.toggle_pill {
  background-color: #d35400; /* or any color you prefer */
}

/* Donor ID pill with label & input inline */
.donor_id_pill {

  display: flex;
  align-items: center;
  gap: 0.3rem;
  /*background-color: #f0f0f0;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  */
}
.donor_id_input {
  width: 180px;
  font-size: 0.85rem;
  background-color: #fff;

  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color 0.2s ease;
}

/*Single Select*/
.donor_select2_single {
  background-color: #f0f8fa !important;
  border-width: 0 !important;
  border-radius: 15px !important;
  color: #121212 !important;
  font-size: 15px !important;
  height: 45px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 10px !important;
  box-sizing: border-box !important;
}

/* ---- Toggle Selection ---- */
.toggle-switch {
  display: inline-block;
  margin: 1em 0;
}

/* Container around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;    /* Adjust for desired toggle width */
  height: 26px;   /* Adjust for desired toggle height */
}

/* Hide the original checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

/* The slider (background) */
.slider {
  position: absolute;
  top: 0; 
  left: 0; 
  right: 0; 
  bottom: 0;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 26px;
  overflow: hidden;        /* We’ll show the text inside this container */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.4s;
}

/* The round toggle knob */
.slider:before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

/* Text labels for off/on states */
.label-off,
.label-on {
  position: absolute;
  width: 100%;
  text-align: center;
  color: #fff;
  font-size: 12px;
  pointer-events: none; /* Let clicks pass through to the toggle */
  transition: 0.3s;
}

/* "Any" (default/off) is visible by default */
.label-off {
  opacity: 1;
}

/* "Has Adult Photos" (on) is hidden by default */
.label-on {
  opacity: 0;
}

/* When checked, move the knob and change the background color */
.switch input:checked + .slider {
  background-color: #4caf50; 
}

/* Move the knob (the circle) to the right */
.switch input:checked + .slider:before {
  transform: translateX(34px);
}

/* Hide the "off" label, show the "on" label */
.switch input:checked + .slider .label-off {
  opacity: 0;
}
.switch input:checked + .slider .label-on {
  opacity: 1;
}

/* ---- Active Filters Bar ---- */
.active-filters-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  min-height: 30px;
  width: 100%;
}

.active-filter-pill {
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  color: #333;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.active-filter-pill .remove-filter {
  cursor: pointer;
  color: #777;
  font-weight: bold;
}

.clear-all-filters-link {
  margin-left: auto; 
  font-size: 0.85rem;
  color: #007bff;
  text-decoration: none;
}
.clear-all-filters-link:hover {
  text-decoration: underline;
}

/* ---- Donor Results (grid) ---- */
#inner-content {
  border-radius: 8px;
  /*padding: 1rem;*/
}

#donor_list_wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 1rem 0;
  min-height: 100vh;
}

.donor_pod_wrap {
  flex: 1 1 calc(25% - 20px);
  max-width: calc(25% - 20px);
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.donor_pod_wrap:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.donor-status-badge {
  position: absolute;
  top: 2%;
  left: 5%;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: bold;
  color: rgb(37, 37, 37);
  border-radius: 4px;
  backdrop-filter: blur(1px);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.062);
}

.donor_pod_image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* Responsive breakpoints */
@media (max-width: 900px) {
  .donor_pod_wrap {
    flex: 1 1 calc(50% - 20px);
    max-width: calc(50% - 20px);
  }
}
@media (max-width: 600px) {
  .donor_pod_wrap {
    flex: 1 1 100%;
    max-width: 100%;
  }
}
