/* Reset et style global */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f6fa;
  color: #333;
}

.home-container {
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 40px;
  color: #222;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Conteneur des cards */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  width: 100%;
  max-width: 1000px;
  margin-bottom: 50px;
  padding: 0 10px;
}

/* Style des cards */
.trajet-card {
  background-color: #fff;
  border-radius: 15px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  width: 280px;
  padding: 24px 28px;
  box-sizing: border-box;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.trajet-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.trajet-card h3 {
  margin: 0 0 12px 0;
  font-size: 1.5rem;
  color: #222;
  font-weight: 600;
}

.trajet-card p {
  margin: 0 0 20px 0;
  font-size: 1rem;
  color: #555;
}

/* Boutons dans les cards */
.card-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.card-buttons a,
.card-buttons button {
  background-color: #1e90ff;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 4px 8px rgba(30, 144, 255, 0.4);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  flex: 1;
}

.card-buttons a:hover,
.card-buttons button:hover {
  background-color: #0077e6;
  box-shadow: 0 6px 12px rgba(0, 119, 230, 0.6);
  cursor: pointer;
}

.card-buttons button {
  cursor: pointer;
}

/* Bouton principal "Créer un nouveau trajet" */
.btn {
  padding: 16px 28px;
  background-color: #2ecc71;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 12px rgba(46, 204, 113, 0.6);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  max-width: 300px;
  width: 100%;
  text-align: center;
}

.btn:hover {
  background-color: #27ae60;
  box-shadow: 0 8px 16px rgba(39, 174, 96, 0.8);
  cursor: pointer;
}

/* Responsive : sur petit écran, empile les cards */
@media (max-width: 640px) {
  .card-container {
    flex-direction: column;
    gap: 20px;
  }

  .trajet-card {
    width: 90%;
    max-width: 400px;
    margin: 0 auto;
  }
}


/* Styles pour la page map.html */
body.map-page {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  height: 100vh;
  display: flex;
  background-color: #f5f6fa;
}

/* Sidebar à gauche */
#sidebar {
  width: 320px;
  background: #ffffff;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  padding: 25px 20px;
  box-sizing: border-box;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#sidebar h3 {
  margin-top: 0;
  font-size: 1.6rem;
  color: #222;
  margin-bottom: 20px;
  font-weight: 700;
}

/* Liste des trajets */
#trajetList {
  list-style: none;
  padding-left: 0;
  margin: 0 0 20px 0;
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
}

#trajetList li {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  font-weight: 600;
  color: #333;
  transition: background-color 0.2s ease;
}

#trajetList li:hover {
  background-color: #e3f2fd;
}

/* Input du nom de trajet */
#trajetName {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1.5px solid #bbb;
  font-size: 1rem;
  margin-bottom: 15px;
  outline: none;
  transition: border-color 0.3s ease;
}

#trajetName:focus {
  border-color: #3498db;
}

/* Boutons enregistrer et réinitialiser */
#sidebar button {
  width: 100%;
  padding: 14px 0;
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(52, 152, 219, 0.4);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#sidebar button:nth-child(3) { /* Enregistrer */
  background-color: #3498db;
  color: white;
}

#sidebar button:nth-child(3):hover {
  background-color: #2980b9;
  box-shadow: 0 7px 15px rgba(41, 128, 185, 0.6);
}

#sidebar button:nth-child(4) { /* Réinitialiser */
  background-color: #e74c3c;
  color: white;
  box-shadow: 0 5px 12px rgba(231, 76, 60, 0.4);
}

#sidebar button:nth-child(4):hover {
  background-color: #c0392b;
  box-shadow: 0 7px 15px rgba(192, 57, 43, 0.6);
}

/* Bouton retour */
.btn-return {
  margin-top: auto;
  display: block;
  background-color: #7f8c8d;
  color: white;
  padding: 12px 0;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(127, 140, 141, 0.4);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

.btn-return:hover {
  background-color: #636e72;
  box-shadow: 0 6px 14px rgba(99, 110, 114, 0.7);
}

/* Carte Leaflet prend tout le reste de la page */
#map {
  flex-grow: 1;
  height: 100vh;
}

/* Scrollbar personnalisée sidebar */
#sidebar::-webkit-scrollbar {
  width: 8px;
}

#sidebar::-webkit-scrollbar-thumb {
  background-color: #3498db;
  border-radius: 10px;
}

#sidebar::-webkit-scrollbar-track {
  background: #f0f0f0;
}

/* Responsive */
@media (max-width: 900px) {
  body.map-page {
    flex-direction: column;
  }
  #sidebar {
    width: 100%;
    height: auto;
    max-height: 300px;
  }
  #map {
    height: 60vh;
  }
}

/* bouton supprimer = bouton rouge */
#sidebar button:nth-child(4) {
  background-color: #e74c3c;
  color: white;
  box-shadow: 0 5px 12px rgba(231, 76, 60, 0.4);
}

#sidebar button:nth-child(4):hover {
  background-color: #c0392b;
  box-shadow: 0 7px 15px rgba(192, 57, 43, 0.6);
}

/* Style popup Leaflet personnalisé pour le formulaire de point clé */
.leaflet-popup-content-wrapper {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #222;
  min-width: 260px;
  padding: 16px 20px;
}

.leaflet-popup-content {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.leaflet-popup-content label {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
  color: #1e90ff;
}

.leaflet-popup-content input[type="text"],
.leaflet-popup-content textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid #bbb;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
  margin-bottom: 12px;
  outline: none;
}

.leaflet-popup-content input[type="text"]:focus,
.leaflet-popup-content textarea:focus {
  border-color: #3498db;
  box-shadow: 0 0 6px rgba(52, 152, 219, 0.5);
}

.leaflet-popup-content button#popupSaveBtn {
  background-color: #1e90ff;
  color: white;
  font-weight: 700;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 5px 12px rgba(30, 144, 255, 0.4);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.leaflet-popup-content button#popupSaveBtn:hover {
  background-color: #0077e6;
  box-shadow: 0 6px 14px rgba(0, 119, 230, 0.6);
}

/* Petite marge entre les champs et bouton */
.leaflet-popup-content textarea {
  min-height: 60px;
}

/* Ajustement de la flèche du popup */
.leaflet-popup-tip-container {
  width: 30px;
  height: 15px;
}

.leaflet-popup-tip {
  background: #ffffff;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
}

/* Style du bouton Supprimer dans le popup Leaflet */
.leaflet-popup-content button.delete-marker-btn,.deleteMarkerBtn {
  background-color: #e74c3c; /* rouge vif */
  color: white;
  font-weight: 700;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  width: 80%;
  box-shadow: 0 5px 12px rgba(231, 76, 60, 0.4);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.leaflet-popup-content button.delete-marker-btn:hover,.deleteMarkerBtn:hover {
  background-color: #c0392b; /* rouge foncé */
  box-shadow: 0 7px 15px rgba(192, 57, 43, 0.6);
}

#instructions {
  margin-top: 20px;
  font-size: 0.9em;
  color: #444;
  background-color: #f9f9f9;
  border-left: 4px solid #007bff;
  padding: 12px 16px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#instructions strong {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #0056b3;
}

#instructions ul {
  padding-left: 20px;
  margin: 0;
  list-style-type: disc;
}

#instructions ul li {
  margin-bottom: 6px;
  line-height: 1.4;
}

.top-bar {
  width: 100%;
  padding: 10px 20px;
  box-sizing: border-box;
  background-color: #f1f1f1;
  border-bottom: 1px solid #ccc;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

#userStatus {
  font-size: 0.9em;
  color: #555;
}

#logoutBtn {
  background-color: #d9534f;
  border: none;
  color: white;
  padding: 6px 12px;
  font-size: 0.9em;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.3s ease;
}

#logoutBtn:hover {
  background-color: #c9302c;
}




