/* =============================================================================
   CARTE INTERACTIVE - STYLES PRINCIPAUX
   ============================================================================= */

.carte-interactive-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
  position: relative;
}

/* =============================================================================
   BARRE D'OUTILS DE LA CARTE
   ============================================================================= */
.carte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  align-items: center;
}

.carte-toolbar-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.carte-toolbar-label {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
}

.carte-toolbar-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #dee2e6;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.carte-toolbar-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.carte-toolbar-btn.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

.carte-toolbar-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =============================================================================
   CONTENEUR DE LA CARTE
   ============================================================================= */
.carte-container {
  position: relative;
  width: 100%;
  height: 600px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
}

#carte-leaflet {
  width: 100%;
  height: 100%;
}

/* Override des styles Leaflet pour correspondre au design */
.leaflet-container {
  font-family: inherit;
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
  font-size: 0.9rem;
  line-height: 1.4;
}

/* =============================================================================
   PANNEAU D'INFORMATIONS
   ============================================================================= */
.carte-info-panel {
  position: absolute;
  top: 10px;
  right: 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);
  max-width: 280px;
  font-size: 0.9rem;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.carte-info-panel.show {
  transform: translateX(0);
}

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

.carte-info-stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.carte-info-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.carte-info-stat-label {
  color: #6c757d;
}

.carte-info-stat-value {
  font-weight: 600;
  color: #495057;
}

/* =============================================================================
   LOADER DE LA CARTE
   ============================================================================= */
.carte-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.carte-loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: carte-spin 1s linear infinite;
}

.carte-loader-text {
  color: #495057;
  font-size: 0.9rem;
}

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

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 768px) {
  .carte-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .carte-toolbar-group {
    justify-content: center;
  }
  
  .carte-container {
    height: 400px;
  }
  
  .carte-info-panel {
    position: static;
    transform: none;
    max-width: none;
    margin-top: 1rem;
  }
  
  .carte-info-panel.show {
    transform: none;
  }
}

/* =============================================================================
   SLIDER TEMPOREL SIMPLE
   ============================================================================= */

/* En-tête avec label et checkbox sur la même ligne */
.carte-temporal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.carte-temporal-all-checkbox label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

/* Container du slider (masqué par défaut) */
.carte-temporal-slider-container {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Labels des siècles - les uns à côté des autres */
.carte-temporal-centuries-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85em;
    color: #666;
}

.carte-temporal-century-label {
    flex: 1;
    text-align: center;
}

.carte-temporal-century-label.selected {
    color: #007cba;
    font-weight: bold;
}

.carte-temporal-century-label.has-data {
    color: #28a745;
}

/* Le slider lui-même - EN DESSOUS des labels */
.carte-temporal-slider {
    width: 100%;
    height: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.carte-temporal-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
}

.carte-temporal-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
    border: none;
}

@media (max-width: 480px) {
  .carte-toolbar-btn {
    flex: 1;
    justify-content: center;
  }
  
  .carte-container {
    height: 350px;
  }
  
  .carte-temporal-slider-labels {
    font-size: 0.75em;
  }
  
  .carte-temporal-all-checkbox label {
    font-size: 0.75em;
  }
}