/* =============================================================================
   CARTE INTERACTIVE - MARQUEURS ET POPUPS
   ============================================================================= */

/* =============================================================================
   MARQUEURS PERSONNALISÉS
   ============================================================================= */
.carte-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  color: white;
  font-weight: bold;
}

.carte-marker:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Types de marqueurs selon les données */
.carte-marker.naissance {
  background: #28a745;
}

.carte-marker.mariage {
  background: #007bff;
}

.carte-marker.deces {
  background: #dc3545;
}

.carte-marker.lieu-residence {
  background: #ffc107;
  color: #212529;
}

.carte-marker.multiple {
  background: linear-gradient(45deg, #28a745 25%, #007bff 25%, #007bff 50%, #dc3545 50%, #dc3545 75%, #ffc107 75%);
}

/* Tailles des marqueurs selon le nombre d'événements */
.carte-marker.size-small {
  width: 20px;
  height: 20px;
  font-size: 10px;
}

.carte-marker.size-medium {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.carte-marker.size-large {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

/* =============================================================================
   POPUPS PERSONNALISÉS
   ============================================================================= */
.carte-popup {
  min-width: 280px;
  max-width: 320px;
}

.carte-popup-header {
  background: #f8f9fa;
  margin: -12px -18px 12px -18px;
  padding: 12px 18px;
  border-radius: 6px 6px 0 0;
  border-bottom: 1px solid #e9ecef;
}

.carte-popup-title {
  font-weight: 600;
  color: #495057;
  margin: 0;
  font-size: 1rem;
}

.carte-popup-coordinates {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 2px;
}

.carte-popup-content {
  padding: 0;
}

.carte-popup-section {
  margin-bottom: 1rem;
}

.carte-popup-section:last-child {
  margin-bottom: 0;
}

.carte-popup-section-title {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.carte-popup-events {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.carte-popup-event {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid;
}

.carte-popup-event.naissance {
  border-left-color: #28a745;
}

.carte-popup-event.mariage {
  border-left-color: #007bff;
}

.carte-popup-event.deces {
  border-left-color: #dc3545;
}

.carte-popup-event.residence {
  border-left-color: #ffc107;
}

.carte-popup-event-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.carte-popup-event-content {
  flex: 1;
  min-width: 0;
}

.carte-popup-event-person {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.carte-popup-event-date {
  color: #6c757d;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.carte-popup-event-details {
  color: #495057;
  font-size: 0.85rem;
  line-height: 1.3;
}

.carte-popup-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e9ecef;
}

.carte-popup-stat {
  text-align: center;
}

.carte-popup-stat-value {
  font-weight: 600;
  color: #495057;
  font-size: 1.1rem;
  display: block;
}

.carte-popup-stat-label {
  color: #6c757d;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =============================================================================
   CLUSTERS DE MARQUEURS
   ============================================================================= */
.carte-cluster {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border: 2px solid #007bff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #007bff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.carte-cluster:hover {
  background: #007bff;
  color: white;
  transform: scale(1.05);
}

.carte-cluster.size-small {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.carte-cluster.size-medium {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.carte-cluster.size-large {
  width: 50px;
  height: 50px;
  font-size: 16px;
}

/* =============================================================================
   LÉGENDE DE LA CARTE
   ============================================================================= */
.carte-legend {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  font-size: 0.85rem;
  z-index: 1000;
}

.carte-legend-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #495057;
}

.carte-legend-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.carte-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.carte-legend-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.carte-legend-label {
  color: #495057;
}

/* =============================================================================
   RESPONSIVE POUR MARQUEURS ET POPUPS
   ============================================================================= */
@media (max-width: 768px) {
  .carte-popup {
    min-width: 240px;
    max-width: 280px;
  }
  
  .carte-legend {
    position: static;
    margin-top: 1rem;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .carte-popup {
    min-width: 200px;
    max-width: 240px;
  }
  
  .carte-popup-stats {
    grid-template-columns: 1fr;
  }
  
  .carte-legend-items {
    flex-direction: row;
    flex-wrap: wrap;
  }
}