body {
  margin: 0;
  padding: 0;
  font-family: "Roboto", sans-serif;
  font-weight: 400;
  font-size: 14px;
}

#container {
  height: 100vh;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

/* Légende overlay sur desktop */
#legende {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 150px;
  max-height: 90%;
  overflow-y: auto;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(5px);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  text-align: center;
}

/* Scrollable ul dans la légende */
#legende ul {
  list-style: none;
  padding-left: 5px;
  margin: 0;
  text-align: center;
}

.note {
  position: absolute;
  top: 10px;
  right: calc(160px + 5%); /* espace à gauche de la légende */
  width: calc(90% - 180px); /* reste de la largeur */
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 1001;
  text-align: center;
  font-size: 13px;
  animation: fadeIn 0.3s ease;
  height: fit-content;
}

/* Espacement vertical si plusieurs notes */
.note + .note {
  margin-top: 10px;
}

/* Couleurs selon le type */
.note.info {
 color: white;
  background-color: rgba(39, 187, 255, 0.85);
}

.note.warning {
 color: white;
  background-color: rgba(255, 147, 39, 0.85);
}

.note.error {
 color: white;
  background-color: rgba(255, 39, 39, 0.85);
}

/* Apparition douce */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile : overlay en bas, hauteur réduite */
@media (max-width: 768px) {
  #legende {
    top: auto;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-height: 30vh;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    text-align: center;
  }

  #legende ul {
    max-height: 100%;
    overflow-y: auto;
  }

  /* ✅ Notes sur mobile : centrées au-dessus de la légende */
  .note {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: 80%;
    bottom: calc(20vh + 20px);
    top: auto;
  }

  .note + .note {
    margin-top: 8px;
  }
}
