/* Conteneur principal de la carte */
.certified-students-map-container {
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Carte Leaflet */
#certified-students-map {
  height: 600px;
  width: 100%;
  border: none;
}

/* Styles pour les popups */
.leaflet-popup-content {
  margin: 15px;
  line-height: 1.4;
}

.leaflet-popup-content h3 {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 1.4em; /* Taille augmentée pour le nom commercial */
  border-bottom: 2px solid #3498db;
  padding-bottom: 5px;
}

/* Barres colorées sous le nom commercial selon la formation */
.leaflet-popup-content h3.popup-title.formation-mantrailing {
  border-bottom-color: #f39c12; /* Orange pour Mantrailing */
}

.leaflet-popup-content h3.popup-title.formation-instinctive {
  border-bottom-color: #27ae60; /* Vert plante pour Sélection Instinctive */
}

.leaflet-popup-content h3.popup-title.formation-education {
  border-bottom-color: #2ecc71;
}

.leaflet-popup-content h3.popup-title.formation-comportement {
  border-bottom-color: #e74c3c;
}

.leaflet-popup-content h3.popup-title.formation-agility {
  border-bottom-color: #1abc9c;
}

.leaflet-popup-content h3.popup-title.formation-detection {
  border-bottom-color: #34495e;
}

.leaflet-popup-content h3.popup-title.formation-default {
  border-bottom-color: #3498db;
}

.leaflet-popup-content p {
  margin: 8px 0;
  font-size: 0.9em;
}

.leaflet-popup-content img {
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content i {
  margin-right: 8px;
  color: #3498db;
  width: 16px;
  text-align: center;
}

.leaflet-popup-content a {
  color: #3498db;
  text-decoration: none;
}

.leaflet-popup-content a:hover {
  text-decoration: underline;
}

/* Styles pour la légende */
/* Anciens styles de légende supprimés - remplacés par .map-summary */

/* Contrôles de zoom personnalisés */
.leaflet-control-zoom {
  border: none !important;
  border-radius: 4px !important;
}

.leaflet-control-zoom a {
  background-color: #fff !important;
  border: 1px solid #ccc !important;
  color: #333 !important;
}

.leaflet-control-zoom a:hover {
  background-color: #f5f5f5 !important;
}

/* Loading indicator */
.map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.map-loading .spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Marqueurs en forme de goutte avec logo à l'intérieur */
.droplet-marker-container {
  background: transparent !important;
  border: none !important;
}

.droplet-marker {
  position: relative;
  width: 40px;
  height: 48px;
  background: #ffffff;
  border: 3px solid #3498db;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.droplet-marker:hover {
  transform: rotate(-45deg) scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.marker-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
}

.marker-logo {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 50%;
}

.marker-content .fas {
  font-size: 16px;
  color: #3498db;
}

/* Couleurs par type de formation */
.droplet-marker.formation-mantrailing {
  border-color: #f39c12; /* Orange pour Mantrailing */
}

.droplet-marker.formation-education {
  border-color: #2ecc71;
}

.droplet-marker.formation-comportement {
  border-color: #e74c3c;
}

.droplet-marker.formation-instinctive {
  border-color: #27ae60; /* Vert plante pour Sélection Instinctive */
}

/* Animation pour les marqueurs */
@keyframes markerPulse {
  0% {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(52, 152, 219, 0.4);
  }
  70% {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 0 0 10px rgba(52, 152, 219, 0);
  }
  100% {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(52, 152, 219, 0);
  }
}

.droplet-marker.active {
  animation: markerPulse 2s infinite;
}

/* Contrôle des layers de formations */
.formation-layers-control {
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  min-width: 220px;
  max-width: 300px;
  font-family: inherit;
}

.formation-layers-control h4 {
  margin: 0 0 12px 0;
  color: #2c3e50;
  font-size: 16px;
  font-weight: bold;
  border-bottom: 2px solid #ecf0f1;
  padding-bottom: 8px;
}

.layer-controls {
  margin: 10px 0;
  text-align: center;
}

.toggle-all-btn {
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-weight: 500;
}

.toggle-all-btn:hover {
  background: #2980b9;
}

.toggle-all-btn:active {
  transform: translateY(1px);
}

.layer-checkbox {
  margin: 8px 0;
  display: flex;
  align-items: center;
}

.layer-checkbox input[type="checkbox"] {
  margin: 0 8px 0 0;
  transform: scale(1.2);
  cursor: pointer;
}

.layer-checkbox label {
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #34495e;
  font-weight: 500;
}

.formation-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Couleurs des formations */
.formation-color.formation-mantrailing {
  background-color: #f39c12; /* Orange pour Mantrailing */
}

.formation-color.formation-education {
  background-color: #2ecc71;
}

.formation-color.formation-comportement {
  background-color: #e74c3c;
}

.formation-color.formation-instinctive {
  background-color: #27ae60; /* Vert plante pour Sélection Instinctive */
}

.formation-color.formation-agility {
  background-color: #1abc9c;
}

.formation-color.formation-detection {
  background-color: #34495e;
}

.formation-color.formation-default {
  background-color: #3498db;
}

/* Styles pour les logos des formations dans les filtres */
.formation-logo-filter {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  margin-right: 8px;
  object-fit: contain;
  background: white;
  border: 1px solid #ddd;
  padding: 2px;
}

.formation-label {
  flex: 1;
}

/* Conteneur mobile masqué par défaut sur desktop */
.mobile-filters-container {
  display: none;
}

/* Informations de la carte en dessous */
.map-summary {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  justify-content: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 120px;
}

.stat-item.formation-stat {
  flex-direction: row;
  align-items: center;
  min-width: 150px;
  justify-content: center;
  gap: 8px;
}

.stat-item.formation-stat .formation-color {
  flex-shrink: 0;
}

.stat-number {
  font-size: 2em;
  font-weight: bold;
  color: #2c3e50;
  line-height: 1;
}

.stat-label {
  font-size: 0.9em;
  color: #7f8c8d;
  margin-top: 5px;
  font-weight: 500;
}

.formation-stat .stat-number {
  font-size: 1.5em;
  margin: 0 8px;
}

.formation-stat .stat-label {
  margin-top: 0;
  color: #34495e;
}

.formation-stat .formation-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-right: 8px;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.map-instructions {
  border-top: 1px solid #ecf0f1;
  padding-top: 20px;
}

.map-instructions p {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 1.1em;
}

.map-instructions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.map-instructions li {
  padding: 8px 0;
  color: #34495e;
  font-size: 0.95em;
  line-height: 1.4;
}

.map-instructions li strong {
  color: #2c3e50;
}

/* Responsive design */
@media (max-width: 1200px) {
  /* Carte adaptée aux écrans moyens et mobiles */
  #certified-students-map {
    height: 450px;
  }
  
  /* Conteneur mobile pour les filtres */
  .mobile-filters-container {
    display: block;
    margin-bottom: 15px;
  }
  
  /* Contrôles de filtrage sur mobile */
  .mobile-filters-container .formation-layers-control {
    position: relative;
    width: 100%;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 15px;
  }
}

/* Écrans plus petits - vraiment mobiles */
@media (max-width: 768px) {
  #certified-students-map {
    height: 400px;
  }
  
  .formation-layers-control h4 {
    font-size: 16px;
    text-align: center;
    margin-bottom: 15px;
  }
  
  /* Arrangement horizontal des checkboxes sur mobile */
  .formation-layers-control .layer-checkbox {
    display: inline-block;
    width: calc(50% - 10px);
    margin: 5px;
    vertical-align: top;
  }
  
  .layer-checkbox label {
    font-size: 12px;
    line-height: 1.3;
  }
  
  .formation-color {
    width: 8px;
    height: 8px;
    margin-right: 6px;
  }
  
  /* Bouton tout afficher/masquer plus compact */
  .toggle-all-btn {
    padding: 8px 16px;
    font-size: 13px;
    margin-bottom: 10px;
  }
  
     /* Section d'informations responsive */
   .map-summary {
     padding: 15px;
     margin: 15px 0;
   }
   
   .summary-stats {
     flex-direction: column;
     gap: 15px;
   }
   
   .stat-item {
     min-width: auto;
   }
   
   .stat-item.formation-stat {
     min-width: auto;
     justify-content: flex-start;
   }
   
   .stat-number {
     font-size: 1.5em;
   }
   
   .formation-stat .stat-number {
     font-size: 1.2em;
   }
   
   .map-instructions {
     padding-top: 15px;
   }
   
   .map-instructions p {
     font-size: 1em;
   }
   
   .map-instructions li {
     font-size: 0.9em;
     padding: 6px 0;
   }
  
  /* Popups plus adaptés mobile */
  .leaflet-popup-content {
    margin: 8px;
  }
  
  .leaflet-popup-content h3 {
    font-size: 1.2em;
  }
  
  .leaflet-popup-content p {
    font-size: 0.85em;
  }
  
  /* Marqueurs légèrement plus petits sur mobile */
  .droplet-marker {
    width: 35px;
    height: 42px;
  }
  
  .marker-content {
    width: 24px;
    height: 24px;
  }
  
  .marker-logo {
    width: 20px;
    height: 20px;
  }
  
  .marker-content .fas {
    font-size: 14px;
  }
}

/* Très petits écrans - force les filtres au-dessus de la carte */
@media (max-width: 500px) {
  /* Forcer les filtres dans le conteneur mobile */
  .mobile-filters-container {
    display: block !important;
    margin-bottom: 10px;
  }
  
  .mobile-filters-container .formation-layers-control {
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px !important;
    font-size: 14px;
  }
  
  /* Masquer complètement les contrôles Leaflet superposés */
  .leaflet-control-container .leaflet-top.leaflet-left {
    display: none !important;
  }
  
  /* Carte encore plus petite sur très petits écrans */
  #certified-students-map {
    height: 350px !important;
  }
  
  /* Filtres plus compacts */
  .formation-layers-control h4 {
    font-size: 14px !important;
    margin-bottom: 8px !important;
  }
  
  .layer-checkbox {
    margin: 6px 0 !important;
  }
  
  .formation-logo-filter {
    width: 18px !important;
    height: 18px !important;
  }
  
  .formation-label {
    font-size: 13px !important;
  }
  
  .toggle-all-btn {
    font-size: 11px !important;
    padding: 5px 10px !important;
  }
}

/* Bordures colorées pour les logos de formation dans les filtres */
.formation-logo-filter {
  border-radius: 4px;
  padding: 2px;
  border: 2px solid transparent;
}

/* Couleurs spécifiques par formation */
.formation-border-mantrailing {
  border-color: #e67e22 !important; /* Orange mantrailing */
}

.formation-border-instinctive {
  border-color: #27ae60 !important; /* Vert sélection instinctive */
}

.formation-border-education {
  border-color: #3498db !important; /* Bleu éducation */
}

.formation-border-comportement {
  border-color: #9b59b6 !important; /* Violet comportement */
}

.formation-border-agility {
  border-color: #f39c12 !important; /* Jaune agility */
}

.formation-border-detection {
  border-color: #e74c3c !important; /* Rouge détection */
}

.formation-border-default {
  border-color: #95a5a6 !important; /* Gris par défaut */
} 