/* Reset and base styles */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: sans-serif;
    background-color: #d5a456;
    overflow: hidden;
}

h1 {
font-family: 'Trebuchet MS', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', 'Tahoma', 'sans-serif';
color: white;
font-size: 2.3rem;
font-weight: bold;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

#map-title, h1 {
  position: fixed;
  width: "100%";
  max-width: none;
  white-space: normal;
  display: block;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  border-radius: 8px;
  pointer-events: none;
  opacity: 1 !important;
  z-index: 500;
}

#map-legend {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background-color: rgba(255,255,255,0.85);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #333;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.legend-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid #999;
}


/* Container for the scrollable map */
/*#map-container {
    width: 100vw;
    height: 100vh; 
    overflow: auto; 
    cursor: grab;
    overflow: auto;
} */

#map-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: auto; /* scroll horizontal + vertical */
  cursor: grab;
  min-height: 100%;
  min-width: 100%;
}


#map-container:active {
    cursor: grabbing;
}

/* Wrapper for the image and the points layer */

.map-wrapper {
  width: 4096px;
  height: 2234px;
  position: relative;
  display: inline-block; /* ✅ RESTAURÉ pour forcer le débordement naturel */
}

/* The map image */
#map-image {
    display: block;
    width: 100%;
    height: 100%;
}

/* Layer for the interactive points, overlaid on the map */
#points-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto; 
    z-index:10;
}

/* Styles adapted from user's original CSS */
.point-wrapper {
  position: absolute;
  /* top and left will be set by JS in pixels */
}

.point {
  position: absolute;
  width: 20px;
  height: 20px;
/*  background-color: crimson; */
  border: 2px solid white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  cursor: pointer;
  pointer-events: auto; /* Make points clickable */
  transition: transform 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.point:hover {
    transform: translate(-50%, -50%) scale(1.3);
    background-color: darkred;
}

.label {
  position: absolute;
  background: rgba(255,255,255,0.9);
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 0.75rem; /* Increased for better readability on a large map */
  font-weight: bold;
  color: black;
/* transform: translate(-50%, -180%); /* Position above the point */
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  user-select: none; /* Prevent text selection */
}


#info-popup {
  position: absolute;
  top: 75px;
  right: 20px;
  width: 200px;
  background: rgba(255, 255, 255, 0.0); /* fond transparent */
  border: 2px solid #ccc;               /* cadre visible */
  padding: 1rem;
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: visible;                    /* pas de scroll */
  border-radius: 8px;
}

#info-popup.visible {
  display: flex;
}

#info-popup h2 {
  margin-top: 0;
  font-size: 1.5rem;
  color: #FFFF;
  text-align :center;
}

/* Réduction des images à 60 % */
#info-popup img {
  width: 75%;
  height: auto;
  margin: 0 auto;
  display: block;
}

/* Amélioration du bouton de fermeture */
#close-popup {
  align-self: flex-end;
  font-size: 1.2rem;
  background-color: #eee;
  border: 1px solid #999;
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  color: #333;
  transition: background-color 0.3s ease;
}

#close-popup:hover {
  background-color: #ddd;
}

.popup-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}


.menu-bouton img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.menu-bouton img:hover {
  transform: scale(1.05);
}

      /* Style for the initial touch prompt on mobile devices */
      #touch-prompt {
        display: none; /* Initially hidden, enabled via JS for mobile */
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 9999;
        justify-content: center;
        align-items: center;
        padding: 2rem;
        box-sizing: border-box;
        background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent backdrop */
      }

      #touch-prompt .message {
        background-color: rgba(255, 255, 255, 0.85);
        color: #5f2f00;
        font-size: 1.4rem;
        font-weight: bold;
        text-align: center;
        padding: 2rem;
        border-radius: 20px;
        box-shadow: 0 0 20px rgba(0,0,0,0.3);
        max-width: 600px;
        width: 90%;
      }

.exit-direct-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  background-color: #d5a456;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
/*  display: none;  */
}
