/* ===== CARTE.CSS - Page de la carte des aventures ===== */

/* Hérite des variables :root globales */

html, body.page-carte {
    height: 100%;
    overflow: hidden; /* Empêche le double scroll */
}

/* Structure principale de la page */
.map-page-wrapper {
    display: flex;
    height: calc(100vh - 80px); /* 100% de la hauteur moins la navbar */
}

/* Panneau latéral des filtres */
.map-sidebar {
    width: 300px;
    background: var(--nav-bg-solid, #fff);
    border-right: 1px solid var(--nav-border, #e0e0e0);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    z-index: 10;
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--nav-border);
}
.sidebar-header h2 { font-size: 1.5rem; margin: 0; color: var(--nav-text); }

.sidebar-toggle {
    background: none; border: 1px solid var(--nav-border); width: 32px; height: 32px;
    border-radius: 50%; cursor: pointer; display: flex; align-items: center;
    justify-content: center; font-size: 1.2rem;
    transition: transform 0.3s, background-color 0.3s;
}
.sidebar-toggle:hover { background: var(--nav-hover-bg); }

.sidebar-content { padding: 1.5rem; overflow-y: auto; }

/* Styles pour le mode replié */
.map-sidebar.collapsed { width: 0; padding: 0; }
.map-sidebar.collapsed .sidebar-header h2, .map-sidebar.collapsed .sidebar-content {
    opacity: 0; visibility: hidden;
}
.map-sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }

/* Styles des filtres */
.filter-item {
    display: flex; align-items: center; padding: 0.5rem 0;
}
.filter-item input[type="checkbox"] {
    width: 1.25em; height: 1.25em; accent-color: var(--accent-color);
}
.filter-item label { margin-left: 0.75rem; user-select: none; cursor: pointer; }

/* Contenu principal de la carte */
.map-main-content {
    flex-grow: 1;
    height: 100%;
}

#carte-container {
    margin-top: 68px;
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
}

/* Style des Popups Leaflet */
.leaflet-popup-content-wrapper {
    background: var(--nav-bg-solid); color: var(--nav-text);
    border-radius: 8px; box-shadow: var(--shadow-lg);
}
.leaflet-popup-tip { background: var(--nav-bg-solid); }
.leaflet-popup-content b { color: var(--accent-color); font-size: 1.1em; }
.leaflet-popup-content a { color: var(--accent-color); text-decoration: none; font-weight: 600; }
.leaflet-popup-content a:hover { text-decoration: underline; }

/* Style des icônes et clusters (personnalisés) */
.custom-marker-icon {
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
    color: white; font-weight: bold;
}

/* /var/www/staphy/public/css/carte.css (ajouts) */

/* Style pour l'icône dans la liste des filtres */
.filter-item label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.filter-icon {
    font-size: 1.2em; /* Pour que les emojis s'affichent un peu plus grand */
    display: inline-flex;
    align-items: center;
}
.filter-icon .marker-svg-icon { /* Cible l'image SVG du roller */
    width: 1.2em;
    height: 1.2em;
}

/* Style de base pour nos marqueurs personnalisés (inchangé) */
.custom-marker-icon {
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white; /* Pour le texte des emojis */
}

/* On donne des couleurs de fond différentes pour chaque type d'activité */
.marker-icon-rando { background-color: #4CAF50; } /* Vert */
.marker-icon-ski { background-color: #2196F3; }   /* Bleu */
.marker-icon-roller { background-color: #9C27B0; } /* Violet */
.marker-icon-randoski { background-color: #FFC107; } /* Jaune */
.marker-icon-trekking { background-color: #FF5722; } /* Orange */

/* Ajustement pour que l'image SVG soit bien centrée et dimensionnée dans le marqueur */
.custom-marker-icon .marker-svg-icon {
    width: 18px;
    height: 18px;
}

/* Style de la trace GPX affichée */
path.leaflet-gpx {
    stroke: #ff0000; /* Rouge vif pour bien voir la trace */
    stroke-opacity: 0.8;
    stroke-width: 5;
    fill: none;
}

