/* APP */
/*
  Les couleurs : 
  - Fond : #f5f5f5;
  - Bleu : #039be5;
  - Bleu Survol : #1f77b1;
*/

/* Bloquer la sélection */
html, body, * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Autoriser la sélection dans les champs de formulaire */
input, textarea, select {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

body {
  font-family: sans-serif; 
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  height: 50px;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  z-index: 1000;
  color: #fff;
}

#mapInfo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

#mapInfo img {
  margin-left: 10px;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

#mapTitle {
  font-size: 14px;
}

#mapZoom {
  font-size: 12px;
  margin-top: 2px;
}

#mapBtn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  width: 50px;
  height: 50px;
  background-image: url('../img/maps.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  background-size: 20px 20px; /* Taille exacte de l'image */
  cursor: pointer;
  -webkit-tap-highlight-color: transparent; /* Chrome/Android/iOS */
  -webkit-user-select: none;                /* iOS Safari */
  -webkit-touch-callout: none;              /* iOS Safari */
  outline: none;
}

/* Overlay plein écran */
#mapOverlay {
  opacity: 0;                    /* invisible par défaut */
  visibility: hidden;            /* empêche les clics quand invisible */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(245,245,245,0.95);
  z-index: 2000;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease; /* transition fluide */
}

#mapOverlay.show {
  opacity: 1;
  visibility: visible;
}

#mapOverlay ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 80%;
  max-width: 400px;
}

#mapOverlay li {
  padding: 16px;
  margin: 8px 0;
  background: #e8e8e8;
  border-radius: 6px;
  text-align: center;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-user-drag: none !important;                  /* Empêche le drag */
  -webkit-tap-highlight-color: transparent !important; /* Supprime le highlight */
  outline: none !important;
}

#mapOverlay li:hover {
  /* background: #ddd; */
  background: #1f77b1;
}

/* Fermer overlay (croix superposée à la carte) */
#mapOverlay #closeOverlay {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 28px;
  color: #333;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  z-index: 3000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  -webkit-tap-highlight-color: transparent; /* Chrome/Android/iOS */
  -webkit-user-select: none;                /* iOS Safari */
  -webkit-touch-callout: none;              /* iOS Safari */
  outline: none;
}

iframe {
  flex: 1;
  border: none;
  width: 100%;
}

/* Contrôles de la carte */
footer {
  height: 50px;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  z-index: 1000;
  color: #fff;
}

#locateBtn {
  position: absolute;
  display: block;
  top: 0;
  left: 0;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  width: 50px;
  height: 50px;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent; /* Chrome/Android/iOS */
  -webkit-user-select: none;                /* iOS Safari */
  -webkit-touch-callout: none;              /* iOS Safari */
  outline: none;
  border-right: 1px dotted rgba(255, 255, 255, 0.3);
}

#locateBtn svg {
  width: 22px;
  height: 22px;
}

#footerZoom {
  position: absolute;
  display: block;
  top: 0;
  right: 0;
  background: transparent;
  width: 102px;
  height: 50px;
  font-size: 0;
}

#footerZoom button {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  width: 50px;
  height: 50px;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent; /* Chrome/Android/iOS */
  -webkit-user-select: none;                /* iOS Safari */
  -webkit-touch-callout: none;              /* iOS Safari */
  outline: none;
  border-left: 1px dotted rgba(255, 255, 255, 0.3);
  
  font-size: 16px;
  font-family: inherit;
  color: #fff;
  font-weight: bolder;
  font-size 50px !important;
}

#footerZoom button svg {
  width: 22px;
  height: 22px;
}


/* LOGIN */
html, body {
  height: 100%;
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background-color: #f5f5f5;
}

body > main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  box-sizing: border-box;
  padding: 1rem;
  transition: transform 0.2s ease-in-out;
}

body > main form {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 320px;
  gap: 0.75rem;
  background-color: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  box-sizing: border-box;
  position: relative;
}

body > main form input[type="text"],
body > main form input[type="password"] {
  padding: 0 25px;
  margin: 0;
  width: 100%;
  height: 38px;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fafafa;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
}

body > main form input[type="text"]:focus,
body > main form input[type="password"]:focus {
  outline: none;
  border-color: #039be5;
  box-shadow: 0 2px 6px rgba(3, 155, 229, 0.2);
}

body > main form i {
  padding-left: 5px;
  width: 20px;
  height: 38px;
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  object-fit: contain;
  opacity: .8;
}

body > main form input[type="submit"] {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 40px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  background-color: #039be5;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  width: 100%;
}

body > main form input[type="submit"]:hover {
  background-color: #1f77b1;
}

#error {
  margin: 0 0 0.75rem 0;
  color: #b00020;
  background-color: #ffebee;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#result {
  display: none;
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.9rem;
  color: #333;
}

#result:empty {
    display: none;
}

#result:not(:empty) {
    display: block;
}

@media (max-width: 400px) {
  body > main {
    transform: translateY(-10%); /* Remonte le bloc de 10% */
  }
  
  body > main form {
    max-width: 300px;
    padding: 1.5rem;
  }
}
