/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */
 @import url("https://api.mapbox.com/mapbox-gl-js/v3.1.2/mapbox-gl.css");

.mapboxgl-popup-content {
  color: #1f2937;
}

.map-signal-marker {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* zone de toucher élargie (~40px) autour du point de 16px */
.map-signal-marker::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 9999px;
}

.map-signal-marker:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 3px;
  border-radius: 9999px;
}

.map-signal-marker__dot {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 1px 3px rgba(0, 0, 0, 0.4);
}

.map-signal-marker__ping {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background-color: #f59e0b;
  opacity: 0.75;
  animation: map-signal-ping 1.8s cubic-bezier(0, 0, 0.2, 1) 3;
}

.map-signal-marker--interested .map-signal-marker__dot,
.map-signal-marker--interested .map-signal-marker__ping {
  background-color: #22c55e;
}

.map-signal-marker--interested .map-signal-marker__ping {
  animation: none;
  opacity: 0;
}

.map-signal-marker--not_interested .map-signal-marker__dot,
.map-signal-marker--not_interested .map-signal-marker__ping {
  background-color: #6b7280;
}

.map-signal-marker--not_interested .map-signal-marker__ping {
  animation: none;
  opacity: 0;
}

.map-signal-marker--active .map-signal-marker__dot {
  background-color: #3b82f6;
}

.map-signal-marker--active .map-signal-marker__ping {
  background-color: #3b82f6;
}

.map-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  min-height: 2.75rem;
  padding: 0.25rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #475569;
  background-color: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.8);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.1s ease-out;
}

.map-filter-btn:hover {
  border-color: rgba(217, 119, 6, 0.4);
}

@media (min-width: 640px) {
  .map-filter-btn {
    min-height: 2rem;
  }
}

/* Légende : la couleur du point reprend celle des marqueurs de la carte */
.map-filter-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
}

.map-filter-dot--new { background-color: #f59e0b; }
.map-filter-dot--interested { background-color: #22c55e; }
.map-filter-dot--not_interested { background-color: #6b7280; }

/* Retour immédiat au toucher, avant même le relâchement */
.map-filter-btn:active {
  transform: scale(0.97);
}

.map-filter-btn.is-active {
  background-color: #facc15;
  color: #0f172a;
  border-color: #facc15;
}

.map-signal-marker--hidden {
  display: none;
}

@keyframes map-signal-ping {
  0% {
    transform: scale(1);
    opacity: 0.75;
  }
  75%,
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* La carte apparaît en fondu une fois chargée */
.map-loading {
  background-color: #f1f5f9;
}

.map-loading .mapboxgl-canvas-container {
  opacity: 0;
}

.mapboxgl-canvas-container {
  transition: opacity 0.3s ease;
}

/* Fiche d'un bien : matériau translucide au-dessus de la carte, avec un liseré clair en haut */
.map-card {
  background-color: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-top-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18), 0 1px 3px rgba(15, 23, 42, 0.1);
}

@media (prefers-reduced-transparency: reduce) {
  .map-card {
    background-color: #ffffff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  .map-card {
    background-color: #ffffff;
    border-color: #475569;
  }
}

/* ── Mobile : la carte passe au premier plan, les commandes flottent dessus ── */

/* Commande flottante translucide (pilule de recherche). Jamais empilée sur une autre surface translucide. */
.map-float {
  background-color: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-top-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.16), 0 1px 3px rgba(15, 23, 42, 0.1);
}

@media (prefers-reduced-transparency: reduce) {
  .map-float {
    background-color: #ffffff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  .map-float {
    background-color: #ffffff;
    border-color: #475569;
  }
}

/* Feuille de filtres : un bloc ordinaire sur desktop, une feuille basse sous 640px (pilotée par sheet_controller.js) */
.sheet-handle {
  touch-action: none; /* le glissé de la poignée ne doit pas faire défiler la page */
  cursor: grab;
}

@media (max-width: 639px) {
  .sheet-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    max-height: 88dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 1.5rem 1.5rem 0 0;
    background-color: #ffffff;
    box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.22);
    outline: none;
    transform: translateY(100%);
    visibility: hidden;
  }

  .sheet-panel[data-open] {
    transform: none;
    visibility: visible;
  }

  .sheet-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    background-color: rgba(15, 23, 42, 0.35);
  }

  /* Pastilles de filtre flottantes sur la carte */
  .map-filter-btn:not(.is-active) {
    background-color: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  }

  .map-filter-btn.is-active {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  }

  /* La fiche se glisse au doigt : pas de défilement natif dessus */
  .map-card {
    touch-action: none;
  }

  /* Logo et attribution Mapbox restent visibles au-dessus de la fiche ouverte */
  .mapboxgl-ctrl-bottom-left,
  .mapboxgl-ctrl-bottom-right {
    bottom: var(--map-card-h, 0px);
    transition: bottom 0.3s ease;
  }
}

@media (prefers-reduced-motion: reduce) and (max-width: 639px) {
  .sheet-panel {
    transform: none;
    opacity: 0;
    transition: opacity 0.15s ease, visibility 0.15s;
  }

  .sheet-panel[data-open] {
    opacity: 1;
  }

  .mapboxgl-ctrl-bottom-left,
  .mapboxgl-ctrl-bottom-right {
    transition: none;
  }
}

/* Pas de pulsation infinie ni d'effet d'échelle pour qui demande moins de mouvement */
@media (prefers-reduced-motion: reduce) {
  .map-signal-marker__ping {
    animation: none;
    opacity: 0;
  }

  .map-filter-btn:active {
    transform: none;
  }

  .mapboxgl-canvas-container {
    transition: none;
  }
}

.hw-combobox {
  width: 100%;
}


.hw-combobox__main__wrapper {
  --hw-combobox-width: 100%;
}

.hw-combobox__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 0.375rem;
  background-color: #EEF6FF;
  padding: 0.125rem 0.5rem;
  font-size: 0.5rem;
  line-height: 1rem;
  font-weight: 500;
  color: #1447e6;
}
