/* --- Variables de Design --- */
:root {
  --primary-color: #1a73e8; /* Bleu Google Moderne */
  --primary-hover: #1557b0;
  --bg-panel: #ffffff;
  --text-main: #202124;
  --text-secondary: #5f6368;
  --shadow-panel: 0 4px 16px rgba(0,0,0,0.15);
  --shadow-btn: 0 2px 4px rgba(0,0,0,0.2);
  --radius-panel: 16px;
  --radius-btn: 24px;
}

/* --- Reset & Bases --- */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden; /* Empêche le scroll de page */
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* --- Carte (Arrière-plan complet) --- */
#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  z-index: 1; /* Couche de fond */
}

/* --- Ajustements Leaflet pour la modernité --- */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-panel) !important;
  border-radius: 8px !important;
  margin-top: 20px !important;
}
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  border-bottom: 1px solid #f1f3f4 !important;
  color: var(--text-secondary) !important;
  font-weight: bold;
}

/* --- Panneau d'Interface Utilisateur (UI) --- */
#ui-panel {
  position: fixed;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 400px; /* Largeur max sur grand écran */
  background-color: var(--bg-panel);
  padding: 16px;
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  z-index: 1000; /* Force l'affichage au-dessus de tout */
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* En-tête du panneau */
.ui-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#ui-panel h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

/* Zone d'affichage de la distance */
#distance {
  background-color: #e8f0fe; /* Bleu très clair */
  color: var(--primary-color);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* Zone des contrôles (boutons) */
.ui-controls {
  display: flex;
  gap: 8px;
  width: 100%;
}

/* --- Styles des Boutons --- */
button {
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
  font-family: inherit;
  font-weight: 500;
  outline: none;
}

button:active {
  transform: scale(0.97); /* Effet de clic */
}

/* Bouton Principal (Trouver un banc) */
.btn-primary {
  flex-grow: 1; /* Prend l'espace restant */
  background-color: var(--primary-color);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-btn);
  font-size: 15px;
  gap: 8px; /* Espace icône/texte */
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-primary svg {
  width: 20px;
  height: 20px;
  fill: white;
}

/* Bouton Secondaire (Recentrer) */
.btn-secondary {
  width: 48px;
  height: 48px;
  background-color: white;
  border-radius: 50%;
  box-shadow: var(--shadow-btn);
}

.btn-secondary:hover {
  background-color: #f8f9fa;
}

.btn-secondary svg {
  width: 22px;
  height: 22px;
  fill: var(--text-secondary);
}

/* Animation douce pour le changement de taille des marqueurs */
.leaflet-marker-icon {
  transition: width 0.3s, height 0.3s, margin 0.3s;
}


/* Style du marqueur de banc */
.bench-marker {
  background-color: white;
  border-radius: 50%;
  /* On définit une taille par défaut si le JS n'est pas chargé */
  width: var(--m-size, 20px);
  height: var(--m-size, 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  /* L'astuce pour éviter l'étirement : */
  box-sizing: border-box; 
  transition: all 0.2s ease-out;
}

.bench-marker svg {
  /* L'icône prendra toujours 60% de la place dispo, sans se déformer */
  width: 65%;
  height: 65%;
  display: block;
}

/* Légende discrète dans le panneau */
.ui-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #f1f3f4;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}














#map-style-wrapper {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    font-family: sans-serif;
}

#map-style-toggle {
    background: white;
    border: none;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    float: right;
}

#map-style-menu {
    background: white;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    margin-top: 50px; /* Espace sous le bouton */
    clear: both;
}

.hidden { display: none !important; }

.style-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: 80px;
}

.style-option img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    border: 2px solid transparent;
    object-fit: cover;
}

.style-option span {
    font-size: 11px;
    margin-top: 4px;
    color: #333;
}

.style-option.active img {
    border-color: #007AFF; /* Bleu style iOS */
}




/* pour le bouton stat */
/* --- Bouton Statistiques --- */
#stats-toggle {
    background: white;
    border: none;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    float: right;
    clear: both;
    margin-top: 10px; /* Espace sous le bouton de carte */
}

/* --- Popup Plein Écran (Mobile First) --- */
#stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-panel);
    z-index: 9999; /* Par-dessus tout le reste */
    display: flex;
    flex-direction: column;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f4;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stats-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-main);
}

.close-btn {
    background: #f1f3f4;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.stats-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- Cartes de statistiques --- */
.stat-card {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-title {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-main);
}

.section-title {
    margin: 10px 0 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}