body {
  margin-top: initial !important;
}

.section {
  padding: 1vh 0.5rem;
}

.header {
  position: relative !important;
  margin-top: 1.5vh !important;
}

#header,
section#research {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.results-container {
  display: none;
}


section#research {
  position: relative;
  background: #ffffff;
  width: 90%;
  margin: 2vh auto 1vh auto;
  border-radius: 20px;
  height: fit-content;
  box-shadow: rgba(27, 31, 35, 0.04) 0px 1px 0px, rgba(255, 255, 255, 0.25) 0px 1px 0px inset;
  padding: 3vh 3vh 3vh 3vh;
  overflow-x: clip;
}


#map-container {
  height: 20vh !important;
  width: 94% !important;
  left: 3% !important;
  box-shadow: rgba(27, 31, 35, 0.04) 0px 1px 0px, rgba(255, 255, 255, 0.25) 0px 1px 0px inset;
  margin-top: 1vh;
  position: relative;
  z-index: 10;
  transition: transform 0.3s ease, top 0.3s ease, height 0.3s ease-in-out;
}

#map-container-expanded {
  height: 30vh !important;
  width: 94% !important;
  left: 3% !important;
  box-shadow: rgba(27, 31, 35, 0.04) 0px 1px 0px, rgba(255, 255, 255, 0.25) 0px 1px 0px inset;
  margin-top: 1vh;
  position: relative;
  z-index: 10;
  transition: transform 0.3s ease, top 0.3s ease, height 0.3s ease-in-out;
}


#map-container.fixed {
  position: fixed; /* Passe en position fixe */
  top: 0;
  left: 0;
  width: 100%; /* Largeur pleine */
  z-index: 100;
  transform: scale(0.8); /* Rétréci au départ */
  animation: popup 0.3s ease forwards; /* Animation par défaut */
  box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px;
}

#map-placeholder {
  height: 0;
  transition: height 0.3s ease; /* Transition pour le placeholder */
}

.close-map-button {
  position: fixed;
  top: 1.5%;
  right: 3.5%;
  color: white;
  background-color: #bae0ff;
  color: #515356;
  border: none;
  border-radius: 50%;
  padding: 8px 15px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
  height: 43px;
  width: 43px;
  display: flex;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  transform: scale(0.8);
  animation: popup 0.3s ease forwards;
}

.close-map-button:hover {
  background-color: #91bce0;
  color: #ffffff;}


@media screen and (max-width: 767px) {
  section#research {
    min-height: 20vh;
  }
  section#results {
    width: 95% !important;
    padding: 3vh 2vh !important;
    margin: 2vh auto 10.5vh auto !important;
  }
  main {
    padding: 0 0vh 2vh 0vh;
  }
  .results__content_list {
    max-height: 42vh;
  }

  

}

/* Overlay for mobile map */
.map-overlay-mobile {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(104 104 104 / 46%); /* Semi-transparent white veil */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 700; /* Higher than Leaflet map elements */
  cursor: pointer;
  transition: opacity 0.3s ease, height 0.3s ease-in-out;
  z-index: 9999;
  border-radius: 20px;
}

img.vectIcon {
    width: 10vh;
    filter: invert(1);
}

.map-overlay-mobile i {
  font-size: 4rem; /* Large icon */
  color: #525960; /* Icon color */
  pointer-events: none; /* Allows click to pass through to the overlay itself */
}

section#map {
  padding: 1vh 0.5rem;
  transition: opacity 0.1s ease-in-out;
}

@media screen and (min-width: 768px) {
section#results {
    width: 45% !important;
    margin: 2vh 0!important;
    height: auto !important;
}
.displaySection {
    display: flex;
    flex-direction: column;
    width: 50%;
}

  section#map {
      width: 100%;
      margin: 0;
      padding: 0;
  }

  section#research {
      width: 100% !important;
  }
  
  main {
      height: 100%;
      display: flex;
      gap: 2vh;
      justify-content: space-around;
      margin: 0 2%;
  }

  #map-container {
      height: 50vh !important;
      width: 100% !important;
      margin-bottom: 2.2vh !important;
      left: 0 !important;
  } 

  .results__content__item__infos p {
    font-size: 1.3vh !important;
    margin-top: 1vh !important;
  }
  .results__content__item {
    max-height: 19vh !important;
  }

  section#map {
    padding: 0vh 0 !important;
  }

  .map-overlay-mobile {
    display: none !important;
  }

}

.leaflet-control-attribution.leaflet-control {
  font-size: 1vh !important;
}

span.pinName {
  display: flex;
  width: max-content;
  place-self: center;
}

.info-button {
    background-color: #525960;
    color: #fff;
    border: none;
    padding: 7px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.8vh;
    transition: background-color 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
    animation: popup 0.3s ease forwards;
    position: absolute;
    z-index: 9;
    right: 15px;
    bottom: 15px;
}

.info-button:hover {
  background-color: #91bce0;
}

/* Animation de type popup */
@keyframes popup {
  0% {
      opacity: 0;
      transform: scale(0.8);
  }
  100% {
      opacity: 1;
      transform: scale(1);
  }
}


section#results {
  position: relative;
  background: #ffffff;
  width: 90%;
  margin: 3vh auto 13vh auto;
  border-radius: 20px;
  min-height: 40vh;
  box-shadow: rgba(27, 31, 35, 0.04) 0px 1px 0px, rgba(255, 255, 255, 0.25) 0px 1px 0px inset;
  padding: 3vh;
  z-index: 22;
}

.results__content_list {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 10px;
}

/* Style pour la barre de défilement */
.results__content_list::-webkit-scrollbar {
  width: 5px; 
}

.results__content_list::-webkit-scrollbar-thumb {
  background-color: #c8c8c8; /* Couleur de la barre de défilement */
  border-radius: 4px; /* Coins arrondis */
}


.results__content_list::-webkit-scrollbar-track {
  background-color: #f1f1f1; /* Couleur de fond de la piste */
  border-radius: 4px;
}

/* Container global */
.search-bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 15px auto;
}

/* Container du champ de recherche */
.search-input-container {
  display: flex;
  align-items: center;
  position: relative;
  border-radius: 15px;
  padding: 5px 18px;
  flex: 1;
  background-color: #f8f8f8;
  box-shadow: rgb(0 0 0 / 5%) 0px 4px 6px -1px, rgb(0 0 0 / 5%) 0px 2px 4px -1px;
  height: 40px;
  width: 75%;
}

/* Icône de recherche */
.search-input-container i {
  font-size: 1.2rem;
  color: #999;
  margin-right: 8px;
}

/* Champ de saisie */
.search-input-container input {
  border: none;
  outline: none;
  font-size: 1rem;
  flex: 1;
  padding: 5px;
  background-color: #f8f8f8;
  color: #515356 !important;
  width: 75%;
}

button.search-button-inside {
  height: 38px;
  padding: 8px 15px;
  position: absolute;
  right: 0px;
  border: none;
  border-radius: 0 15px 15px 0;
  background: linear-gradient(90deg, rgb(192 220 248) 0%, rgb(207 231 255) 35%, rgb(214 240 255) 100%);
}

/* Boutons */
.search-button, .filtre-button {
  background-color: #bae0ff;
  color: #515356;
  border: none;
  border-radius: 50%;
  padding: 8px 15px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
  height: 43px;
  width: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 21;
}


.search-button-section {
    margin: 2vh 0 0 0;
    display: flex;
}

.search-button-title {
    font-size: 0.8rem;
    margin-left: 5px;
    color: #515356;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
    vertical-align: middle;
}

.filter-preview {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  width: 100%;
  justify-content: space-between;
  height: 30px !important;
  align-items: center; /* Aligne les chips verticalement */
  white-space: nowrap;
  text-overflow: ellipsis;
}


/* Bouton Filtre spécifique */
.filter-button {
  background-color: #6c757d;
}

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


.close-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
}

.filter-container {
  background: #f6f6f6;
  margin: 2rem auto 0 auto;
  padding: 1.5rem;
  border-radius: 15px 25px 15px 15px;
  box-shadow: rgb(0 0 0 / 5%) 0px 4px 6px -1px, rgb(0 0 0 / 5%) 0px 2px 4px -1px;
  position: relative;
  margin-top: -37px;
  opacity: 0; 
  transform: translateX(100%); /* Départ hors de la vue */
  max-height: 0; /* Hauteur initiale */
  overflow: hidden; /* Cache les débordements pendant l'animation */
  transition: transform 0.6s ease, max-height 0.6s ease; /* Animation de la hauteur et du mouvement */
  z-index: 20;
}

/* Classe pour déclencher l'animation */
.filter-container.show {
  display: block; /* Rendre visible */
  transform: translateX(0); /* Fait glisser le menu */
  max-height: 500px; /* Ajustez cette valeur en fonction de votre contenu */
}


/* Animation de gauche à droite puis de haut en bas */
@keyframes slideIn {
  0% {
    transform: translateX(100%) translateY(0);
    height: 43px;
  }
  100% {
    transform: translateX(0) translateY(0);
    height: fit-content;
  }
}

.filter-section {
  margin-bottom: 1.5rem;
}

.filter-section h3 {
  margin-bottom: 1rem;
  font-weight: 600;
}

/* Chips (checkbox style) */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}


.chip:active,
.chipPrev:active {
  transform: scale(0.95); /* Réduit légèrement la taille */
  /* Optionnel : ajuster l'ombre ou le fond pour un effet plus marqué */
  /* box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15); */
  /* background-color: #e0e0e0; */ /* Exemple */
}


.chip {
  border: 1px solid #ccc;
  color: #515356;
  background-color: #f9f9f9;
  border-radius: 18px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  opacity: 1;
  transition: background-color 0.3s, color 0.3s, opacity 0.3s ease, visibility 0.3s ease, transform 0.1s ease-out;  
}

@media (hover: hover) and (pointer: fine) {
  .chip:hover {
    background-color: #eaeaea;
  }
  .search-button:hover, .filtre-button:hover {
    background-color: #91bce0;
    color: #ffffff;
  }
  .show-results-btn:hover {
    background-color: #91bce0 !important;
    color: #ffffff !important;
  }
  
}

.chip.active {
  background-color: #bae0ff;
  border-color: #bae0ff;
}


/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 18px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 1rem;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 40px;
  left: 0;
  background: #fff;
  min-width: 120px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border-radius: 6px;
  overflow: hidden;
  z-index: 99;
}

.dropdown-content button {
  background: none;
  border: none;
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px;
  cursor: pointer;
  font-size: 14px;
}

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

/* Filter Action */
.filter-action {
  text-align: center;
  margin-top: 2rem;
}

.show-results-btn {
  background: #bae0ff;
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  color: #525960;
  transition: background-color 0.3s, color 0.3s;
}







/* ... Styles existants ... */

/* Style pour le label de la ville à côté de l'icône */
.city-label {
  font-size: 0.8rem; /* Taille plus petite */
  margin-left: 5px;  /* Espace après l'icône */
  color: #515356;     /* Couleur du texte */
  white-space: nowrap; /* Empêche le retour à la ligne */
  overflow: hidden;    /* Cache le débordement */
  text-overflow: ellipsis; /* Ajoute "..." si trop long */
  max-width: 80px; /* Limite la largeur (ajuster si besoin) */
  vertical-align: middle; /* Alignement vertical avec l'icône */
}

/* Wrapper pour le bouton de localisation et sa popup */
.search-button-wrapper {
  position: relative; /* Permet de positionner la popup absolument par rapport à ce wrapper */
  display: inline-block; /* Pour que la largeur s'adapte au bouton */
}

button#current-location-btn, button#trigger-search-btn{
  width: auto;
  border-radius: 25px;
}

.location-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: -14%;
  transform: translateX(-50%);
  width: calc(280px + 20%);
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 15px 0 15px 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 15px;
  z-index: 1010;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, top 0.3s ease;
}

/* Classe pour afficher la popup */
.location-popup.visible {
  opacity: 1;
  visibility: visible;
  top: calc(100%); /* Rapprocher légèrement lors de l'affichage */
}

/* Styles pour le contenu de la popup */
.location-popup .popup-content {
  display: flex;
  flex-direction: column;
  gap: 12px; /* Espacement entre les éléments */
}

.location-popup label {
  font-size: 0.85rem;
  color: #555;
  font-weight: 500;
  margin-bottom: -5px; /* Rapproche le label de son input */
}

.location-popup input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
  box-sizing: border-box; /* Inclut padding/border dans la largeur */
}

/* Conteneur pour le slider et sa valeur */
.slider-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.location-popup input[type="range"] {
  flex-grow: 1; /* Le slider prend l'espace restant */
  cursor: pointer;
  height: 5px; /* Hauteur de la barre */
  background: #e0e0e0; /* Couleur de fond de la barre */
  border-radius: 5px;
  appearance: none; /* Supprime les styles par défaut */
  -webkit-appearance: none;
}
/* Style du "pouce" (curseur) pour Webkit (Chrome, Safari) */
.location-popup input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #7daed6; /* Couleur du curseur */
  border-radius: 50%;
  cursor: pointer;
}
/* Style du "pouce" pour Firefox */
.location-popup input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #7daed6;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Affichage de la valeur du rayon */
#radius-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  min-width: 45px; /* Empêche le texte de trop bouger */
  text-align: right;
}

/* Bouton "Appliquer" dans la popup */
#apply-location-btn {
  background-color: #525960;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 15px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 5px; /* Espace au-dessus */
}

#apply-location-btn:hover {
  background-color: #3e444a;
}

/* Classe utilitaire pour cacher (si pas déjà définie ailleurs) */
.hidden {
  display: none !important; /* Force la disparition */
}


/* Style pour le conteneur de l'input ville + suggestions */
.popup-content > label[for="popup-city-input"] + input + div {
  position: relative; /* Permet de positionner la liste de suggestions */
}

/* Liste de suggestions */
.suggestions-list {
  top: calc(100% + 2px); /* Juste en dessous de l'input */
  left: 0;
  right: 0;
  background-color: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 8px 8px; /* Arrondi en bas */
  max-height: 150px; /* Hauteur maximale avant scroll */
  overflow-y: auto;
  z-index: 1011; /* Au-dessus de la popup et de Leaflet */
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  display: none; /* Caché par défaut */
  margin-top: -2px; /* Compense la bordure haute enlevée */
}

.suggestions-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.suggestions-list li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggestions-list li:last-child {
  border-bottom: none;
}

.suggestions-list li:hover {
  background-color: #f5f5f5;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon input {
  padding-right: 30px; /* Espace pour l'icône */
  flex-grow: 1; /* L'input prend la place restante */
}

.input-with-icon .icon-suffix {
  position: absolute;
  right: 10px; /* Position de l'icône */
  color: #757575; /* Couleur de l'icône */
  cursor: pointer; /* Curseur pointeur pour indiquer la cliquabilité */
}

.custom-map-marker {
  position: absolute;
  /* Adjust transform to precisely align the pin's tip (bottom-center) with the coordinate */
  /* If your pin image has its tip at the bottom-center, this should be -50% for X and -100% for Y */
  transform: translate(-50%, -100%);
  display: flex; /* Keep flex for potential internal alignment */
  flex-direction: column; /* Keep column for pin and label stacking */
  align-items: center; /* Center items horizontally */
  /* Remove justify-content: flex-end; as it's not needed with absolute positioning of label */
}

.custom-map-marker .marker-pin {
  width: 25px; /* Match iconDefault size */
  height: 25px; /* Match iconDefault size */
  display: block;
  /* The pin itself is at the top of the flex container */
}

.custom-map-marker .marker-label {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75em; /* Smaller font for the label */
  white-space: nowrap; /* Prevent text wrapping */
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  color: #333;
  display: none; /* Hidden by default, controlled by JS */

  /* Absolutely position the label relative to .custom-map-marker */
  position: absolute;
  top: 100%; /* Position below the pin image */
  left: 50%; /* Start from the horizontal center */
  transform: translateX(-50%); /* Shift left by half its width to center horizontally */
  margin-top: 5px; /* Add some space between the pin and the label */
}

/* Ensure the Leaflet popup doesn't interfere */
.leaflet-popup-content-wrapper .marker-label {
  display: none !important; /* Hide the label inside the popup if it appears there */
}