/* explore.css */

/* ================================================
   Explore Layout
================================================ */
/* Root layout for the explore/map experience. */
body.explore-page {
  height: 100vh;
  overflow: hidden;
}

/* Prevent the ribbons from shrinking in the viewport column layout. */
body.explore-page #topRibbon,
body.explore-page #filterRibbon,
body.explore-page .bottom-ribbon {
  flex-shrink: 0;
}

/* Allow the Leaflet map to consume all remaining space. */
body.explore-page #map {
  flex: 1 1 auto;
  min-height: 0;
}

/* ================================================
   Filter Ribbon
================================================ */
/* Sticky bar containing search and type filters. */
#filterRibbon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5em;
  flex-wrap: wrap;
  padding: 0.6em 2em;
  background: #f1f6f2;
  box-sizing: border-box;
  position: sticky;
  top: 60px;
  z-index: 1500;
  border-bottom: 1px solid #dfe8e2;
}

/* Relative positioning context for the dropdown filters. */
#filterContainer {
  position: relative;
  margin-left: auto;
}

/* Wrapper for the location/name search field. */
#searchContainer {
  flex: 1 1 320px;
  max-width: 560px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Enforce full width on the search bar. */
#searchInputGroup {
  position: relative;
  width: 100%;
}

/* Rounded search form styling. */
#mapSearchForm {
  display: flex;
  align-items: center;
  gap: 0.65em;
  background: #fff;
  border: 1px solid #dfe8e2;
  border-radius: 999px;
  padding: 0.25em 0.35em 0.25em 0.95em;
  box-shadow: 0 10px 20px rgba(32, 73, 55, 0.12);
  transition: box-shadow 0.2s ease, border 0.2s ease;
}

/* Dim the search bar when a query is running. */
#mapSearchForm.loading {
  opacity: 0.75;
}

/* Outline the search bar when focusing any inner input. */
#mapSearchForm:focus-within {
  border-color: #2a6a4f;
  box-shadow: 0 12px 26px rgba(32, 73, 55, 0.2);
}

/* Text input within the search bar. */
#mapSearchInput {
  flex: 1;
  border: none;
  font-size: 1em;
  padding: 0.55em 0;
  outline: none;
  min-width: 0;
  background: transparent;
}

/* Soft placeholder color for the search box. */
#mapSearchInput::placeholder {
  color: #93a39a;
}

/* Submit button on the right of the search bar. */
#mapSearchButton {
  border: none;
  background: #2a6a4f;
  color: #fff;
  padding: 0.55em 1.35em;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

/* Lift effect on the search button hover. */
#mapSearchButton:hover {
  background: #245b44;
  transform: translateY(-1px);
}

/* Muted style when search action is disabled. */
#mapSearchButton:disabled {
  background: #9cb6a8;
  cursor: not-allowed;
  transform: none;
}

/* Dropdown for live search suggestions. */
#mapSearchSuggestions {
  position: absolute;
  top: calc(100% + 0.3em);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #dfe8e2;
  border-radius: 16px;
  list-style: none;
  padding: 0.35em 0;
  margin: 0;
  box-shadow: 0 18px 28px rgba(32, 73, 55, 0.18);
  max-height: 240px;
  overflow-y: auto;
  display: none;
  z-index: 1700;
}

/* Reveal suggestions when matches exist. */
#mapSearchSuggestions.show {
  display: block;
}

/* Remove default spacing for suggestion list items. */
#mapSearchSuggestions li {
  margin: 0;
}

/* Button covering each suggestion entry. */
#mapSearchSuggestions button {
  width: 100%;
  padding: 0.55em 1.1em;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 0.95em;
  color: #274636;
  cursor: pointer;
  font-style: italic;
}

/* Highlight suggestion row on hover/focus. */
#mapSearchSuggestions button:hover,
#mapSearchSuggestions button:focus-visible {
  background: #f1f6f2;
  outline: none;
}

/* Visually denote which suggestion is active/selected. */
#mapSearchSuggestions button.active {
  background: #e0efe5;
  font-weight: 600;
}

/* Screen-reader-only helper class for accessibility labels. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Pill button used to toggle the advanced filters dropdown. */
#filterToggle {
  padding: 0.65em 1.4em;
  background: #2a6a4f;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(32, 73, 55, 0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

/* Slight lift while hovering the filter toggle. */
#filterToggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(32, 73, 55, 0.25);
}

/* Dropdown card containing the type filter pills. */
#filterDropdown {
  position: absolute;
  top: calc(100% + 0.4em);
  right: 0;
  background: #fff;
  border-radius: 18px;
  padding: 1.15em 1.2em 1.3em;
  width: min(320px, 90vw);
  max-height: 540px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 25px 50px rgba(15, 30, 30, 0.25);
  z-index: 2000;
  border: 1px solid #dfe8e2;
}

/* Display the dropdown when .show is applied. */
#filterDropdown.show {
  display: block;
}

/* Stack category sections inside the dropdown. */
#typeFilters {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
  margin-top: 0.8em;
}

/* Row for Select All / Clear All buttons. */
.filter-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.8em;
  flex-wrap: wrap;
}

/* Secondary buttons styling in the filter dropdown. */
.filter-actions button {
  flex: 1 1 120px;
  border: 1px solid #dfe8e2;
  background: #f5faf7;
  color: #2a6a4f;
  border-radius: 999px;
  padding: 0.45em 0.8em;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease;
}

/* Lighten the background on hover. */
.filter-actions button:hover {
  background: #e4f1ea;
}

/* Individual category block (People/Places/etc.). */
.filter-category {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
}

.filter-category-label {
  margin: 0;
  font-size: 0.78em;
  letter-spacing: 0.08em;
  color: #6f8279;
  text-transform: uppercase;
}

.filter-type-list {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}

.filter-type-row {
  display: flex;
  align-items: center;
  gap: 0.65em;
}

.filter-type-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px dashed rgba(42, 106, 79, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(42, 106, 79, 0.05);
  flex-shrink: 0;
}

.filter-type-icon::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(42, 106, 79, 0.65);
}

.filter-type-icon.has-image {
  border-style: solid;
  background: #fff;
}

.filter-type-icon.has-image::after {
  display: none;
}

.filter-type-icon img {
  display: block;
  width: 70%;
  height: 70%;
  object-fit: contain;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 0.35em 0.9em;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
  background: #e8f3ed;
  color: #285441;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, border 0.15s ease;
}

/* Color coding for People filter pills. */
.filter-pill.people {
  background: #e1f3e6;
  color: #1f5d34;
}

/* Color coding for Places filter pills. */
.filter-pill.places {
  background: #e3eefc;
  color: #1f4a77;
}

/* Color coding for Experiences filter pills. */
.filter-pill.experiences {
  background: #fdf4d7;
  color: #6a530f;
}

/* Add glow/border when a pill is selected. */
.filter-pill.selected {
  box-shadow: 0 10px 26px rgba(16, 62, 46, 0.2);
  border-color: #2a6a4f;
}

/* Fade pills that are not currently selected. */
.filter-pill:not(.selected) {
  opacity: 0.45;
}

/* Hover lift effect for filter pills. */
.filter-pill:hover {
  transform: translateY(-2px);
}

/* Placeholder text shown while filters load. */
.loading-copy {
  margin: 0;
  color: #6b7f75;
  font-size: 0.9em;
}

.filter-icon-tooltip {
  position: absolute;
  background: #1c2c25;
  color: #fff;
  padding: 0.4em 0.65em;
  border-radius: 8px;
  font-size: 0.78em;
  line-height: 1.3;
  max-width: 220px;
  box-shadow: 0 12px 24px rgba(15, 30, 30, 0.25);
  pointer-events: none;
  z-index: 4000;
  transition: opacity 0.12s ease;
}

/* ================================================
   Map
================================================ */
/* Leaflet map element that fills the viewport. */
#map {
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Tooltip appearing above pins while hovering on the map. */
.leaflet-tooltip.pin-tooltip {
  background: #2a6a4f;
  color: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(15, 30, 30, 0.3);
  padding: 0.4em 0.9em;
  font-size: 0.9em;
  line-height: 1.2;
  font-weight: 500;
}

/* Match tooltip pointer color to the pill background. */
.leaflet-tooltip.pin-tooltip:before,
.leaflet-tooltip.pin-tooltip:after {
  border-top-color: #2a6a4f;
  border-bottom-color: #2a6a4f;
}

/* People tooltip colorway. */
.leaflet-tooltip.pin-tooltip.tooltip-people {
  background: #1f5d34;
  color: #fff;
}

/* Ensure pointer inherits the people color. */
.leaflet-tooltip.pin-tooltip.tooltip-people:before,
.leaflet-tooltip.pin-tooltip.tooltip-people:after {
  border-top-color: #1f5d34;
  border-bottom-color: #1f5d34;
}

/* Places tooltip colorway. */
.leaflet-tooltip.pin-tooltip.tooltip-places {
  background: #1f4a77;
  color: #fff;
}

/* Pointer color for place tooltips. */
.leaflet-tooltip.pin-tooltip.tooltip-places:before,
.leaflet-tooltip.pin-tooltip.tooltip-places:after {
  border-top-color: #1f4a77;
  border-bottom-color: #1f4a77;
}

/* Experiences tooltip colorway. */
.leaflet-tooltip.pin-tooltip.tooltip-experiences {
  background: #867600;
  color: #fff8dc;
}

/* Pointer color for experience tooltips. */
.leaflet-tooltip.pin-tooltip.tooltip-experiences:before,
.leaflet-tooltip.pin-tooltip.tooltip-experiences:after {
  border-top-color: #6a530f;
  border-bottom-color: #6a530f;
}

/* Add drop shadow to the temporary drop-pin marker. */
.temp-pin-marker.leaflet-interactive {
  filter: drop-shadow(0 6px 14px rgba(15, 30, 30, 0.35));
}

.pin-marker {
  background: transparent;
  border: none;
}

.pin-marker .pin-icon-image {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(15, 30, 30, 0.3));
}

/* Simple circular fallback icon for marker types without custom artwork. */
.pin-marker-circle-wrapper {
  width: 42px;
  height: 42px;
}

.pin-marker-circle {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--pin-marker-color, #5e6b7a);
  box-shadow: 0 6px 12px rgba(15, 30, 30, 0.3);
}

/* ================================================
   Pin Popup Styling
================================================ */
/* Shared popup container styling across pin popups. */
.leaflet-popup-content {
  margin: 0;
  padding: 0.2em 0.2em 0.2em;
  font-size: 0.8rem;
  line-height: 1.3;
  width: fit-content;
  min-width: 260px;
  max-width: 320px;
}

/* Ensure the popup card fills the Leaflet content box. */
.leaflet-popup-content .pin-popup {
  width: 100%;
}

/* Base popup card styling for pin details. */
.pin-popup {
  font-family: inherit;
  color: #1f4d3b;
  --popup-section-gap: 0.45em;
  display: flex;
  flex-direction: column;
  gap: var(--popup-section-gap);
  border-radius: 12px;
  max-width: 100%;
  padding: 0.75em 1.1em;
  box-sizing: border-box;
}

/* Title of the pin shown at the top of the popup. */
.popup-title {
  margin: 0;
  margin-bottom: 0.15em;
  font-size: 1.1em;
  color: #194c39;
  line-height: 1.25;
  word-break: break-word;
}

/* Info section that stacks description/review content. */
.popup-info {
  display: flex;
  flex-direction: column;
  gap: var(--popup-section-gap);
}

/* Block listing the primary/secondary type pills. */
.popup-types {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

/* Display pill rows with consistent spacing. */
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28em;
}

/* Slightly tighter spacing for compact pill rows. */
.pill-list.compact {
  gap: 0.25em;
}

/* Layout row containing the primary type pill. */
.primary-row {
  gap: 0.3em;
}

/* Secondary types row styling. */
.secondary-row {
  color: #70867b;
}

/* Shared styling for type pills inside the popup. */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3em 0.8em;
  border-radius: 999px;
  background: #e8f3ed;
  color: #285441;
  font-size: 0.85em;
}

/* Fallback pill used when no types are available. */
.pill.muted {
  background: #f0f2f1;
  color: #7a8c84;
}

/* Outline the primary type pill for emphasis. */
.primary-pill {
  border: 1px solid #000000;
  font-weight: 600;
}

/* People category pill colors inside the popup. */
.pill.people {
  background: #e1f3e6;
  color: #1f5d34;
}

/* Places category pill colors inside the popup. */
.pill.places {
  background: #e3eefc;
  color: #1f4a77;
}

/* Experiences category pill colors inside the popup. */
.pill.experiences {
  background: #fdf4d7;
  color: #6a530f;
}

/* Styled quote showing the latest review snippet. */
.popup-review {
  margin: 0;
  font-size: 0.92em;
  color: #53776a;
  font-style: italic;
  line-height: 1.3;
  padding: 0 0.2em;

}

/* Short excerpt from the pin description (line-clamped). */
.popup-description {
  margin: 0;
  padding: 0 0.2em;
  font-size: 0.9em;
  color: #2a5a46;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  box-sizing: border-box;
  word-break: break-word;
}

/* Stack the “View pin / Get directions” buttons. */
.popup-actions {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--popup-section-gap);
  width: 100%;
}

/* Shared button styling inside the popup actions. */
.popup-btn {
  width: 100%;
  border-radius: 999px;
  padding: 0.5em 0.9em;
  font-size: 0.9em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s ease-in-out, color 0.2s ease-in-out, border 0.2s ease-in-out;
}

/* Filled button style inside the popup. */
.popup-btn.primary {
  background: #2a6a4f;
  color: #fff;
}

/* Hover state for the filled popup button. */
.popup-btn.primary:hover {
  background: #1f503a;
}

/* Outline-style button used for secondary action. */
.popup-btn.secondary {
  background: transparent;
  color: #2a6a4f;
  border-color: #2a6a4f;
}

/* Soft background on hover for outline button. */
.popup-btn.secondary:hover {
  background: rgba(42, 106, 79, 0.08);
}

/* Arrange popup action buttons side-by-side on wider screens. */
@media (min-width: 520px) {
  .popup-actions {
    flex-direction: row;
  }

  .popup-btn {
    width: auto;
  }
}

/* Popup shown when the user is dropping a new pin. */
.add-pin-popup {
  min-height: 20px;
  min-width: 75px;
}

/* Remove default wrappers for the add-pin-only popup. */
.add-pin-popup-only .leaflet-popup-content-wrapper {
  background: transparent;
  box-shadow: none;
  padding: 0 !important;
  border: none;
}

/* Reset content padding for add-pin popups. */
.add-pin-popup-only .leaflet-popup-content {
  margin: 0;
  padding: 0;
}

/* Hide the default Leaflet pointer on add-pin popups. */
.add-pin-popup-only .leaflet-popup-tip-container {
  display: none;
}

/* Slightly larger CTA button for add-pin step. */
.add-pin-popup .popup-btn {
  padding: 0.65em 1.1em;
  font-size: 1em;
}

/* Remove extra padding Leaflet adds to popups. */
.leaflet-popup-content-wrapper {
  padding: 0 !important;
}

/* Remove extra padding Leaflet adds to popup content. */
.leaflet-popup-content {
  padding: 0 !important;
}

/* Override Leaflet's default margins on <p> inside popups */
.leaflet-popup-content p {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
