/* Generic modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0);
  backdrop-filter: blur(0px);
  cursor: default;
  -webkit-backdrop-filter: blur(0px);
  z-index: 10000;

  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

.modal-overlay.active {
  display: flex;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  position: relative !important;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ==========================================================
   FIX: Modal + Magnifier visibility inside Leaflet fullscreen
   ========================================================== */

/* Allow modal overlay to escape fullscreen stacking context */
:fullscreen #modal-overlay,
:-webkit-full-screen #modal-overlay {
    position: fixed !important;
    z-index: 2147483647 !important; /* highest safe z-index */
}

/* Modal content must also float above fullscreen canvas */
:fullscreen #modal-content,
:-webkit-full-screen #modal-content {
    position: fixed !important;
    z-index: 2147483646 !important;
}

/*
   Leaflet fullscreen wrappers sometimes clip absolutely positioned
   children (like your magnifier lens or modal). Prevent clipping.
*/
.leaflet-fullscreen,
.leaflet-fullscreen-on,
.leaflet-container.leaflet-fullscreen {
    overflow: visible !important;
}

/*
   Ensure your magnifier lens is always above the map, even in fullscreen
*/
.magnifier-lens {
    z-index: 2147483640 !important;
    pointer-events: none;
}