/* =========================================
   1. CONTENEURS PRINCIPAUX
   ========================================= */
.swimrun-map-wrapper {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 12px;
    background: #fff;
    display: block;
    width: 100%;
    position: relative;
    margin-bottom: 40px;
border-radius:30px;
}

.swimrun-map-container {
    width: 100%;
    height: 340px;
    z-index: 1;
    background-color: #fff;
border-radius:  30px 30px 0 0;

}



.leaflet-left .leaflet-control {
    margin-left: 20px;
}


.leaflet-top .leaflet-control {
    margin-top: 20px;
}

/* PROFIL - HAUTEUR CORRIGÉE */
.swimrun-elevation-container {
    width: 100%;
    background: #fff !important;
    padding: 15px 10px 10px 10px !important;
    border-top: 1px solid #ddd;
    box-sizing: border-box;
    position: relative;
    overflow: visible !important;
    min-height: 120px;
border-radius: 0 0 30px 30px;
}

.swimrun-elevation-container .elevation-control {
    background: #fff !important;
    position: relative;
}

.swimrun-elevation-container .elevation-control .background,
.swimrun-theme .background {
    background-color: #fff !important;
}

/* CORRECTION: Forcer le SVG à utiliser toute sa hauteur sans espace vide */
.swimrun-elevation-container svg.background {
    display: block;
    max-width: 100%;
    background: #fff !important;
}

/* Réduire l'espace sous le graphique */
.swimrun-elevation-container .elevation-control .elevation-summary,
.swimrun-elevation-container .elevation-control > svg + * {
    margin-top: 5px;
}

/* =========================================
   2. TOOLTIPS & INFOS DU PROFIL
   ========================================= */
.swimrun-header {
    margin-bottom: 15px; 
    font-family: sans-serif;
    font-size: 16px;
}

.swimrun-tooltip-row {
    font-size: 12px;
    line-height: 1.4;
    color: #333;
    white-space: nowrap;
}
.swimrun-tooltip-row .label {
    font-weight: bold;
    color: #666;
    display: inline-block;
    min-width: 60px;
}

.chart-tooltip {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #ccc !important;
    padding: 6px 10px !important;
    z-index: 10000 !important;
}

/* =========================================
   3. POINT DE SUIVI (POINT NOIR)
   ========================================= */
.leaflet-pane .elevation-waypoint-marker,
.leaflet-pane .leaflet-mouse-marker,
.leaflet-pane .position-marker,
.chart-tooltip .focus-circle {
    background-color: #000000 !important;
    border: 2px solid #ffffff !important;
    border-radius: 50% !important;
    width: 14px !important;
    height: 14px !important;
    margin-left: -7px !important; 
    margin-top: -7px !important;
    box-shadow: 0 0 5px rgba(0,0,0,0.5) !important;
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
    z-index: 9999 !important;
}

.swimrun-theme .mouse-focus-line {
    stroke: #000000 !important;
    stroke-width: 1px !important;
    stroke-dasharray: 4,4;
    display: block !important;
    opacity: 1 !important;
}

/* =========================================
   4. PICTOS SUR PROFIL
   ========================================= */
.swimrun-profile-group {
    z-index: 500;
}
.swimrun-profile-icon {
    transition: transform 0.2s ease;
    z-index: 501;
    background: transparent;
}
.swimrun-profile-icon:hover {
    transform: scale(1.2);
    z-index: 502;
}

/* =========================================
   5. THEME GRAPHIQUE PROFIL - SWIMRUN
   ========================================= */

/* Tracé jaune 3px avec fill dégradé */
.swimrun-theme .area {
    fill: url(#swimrun-gradient) !important;
    fill-opacity: 1 !important;
    stroke: none !important;
}

.swimrun-theme .d3-path,
.swimrun-theme path.altitude {
    stroke: #fedd02 !important;
    stroke-width: 3px !important;
}

/* Axes en noir */
.swimrun-theme .axis path,
.swimrun-theme .axis line {
    stroke: #000 !important;
}

.swimrun-theme .axis text {
    font-family: 'Roboto', sans-serif;
    font-size: 10px;
    fill: #000 !important;
}

/* Grille - MASQUÉE COMPLÈTEMENT */
.swimrun-theme .grid,
.swimrun-elevation-container .grid {
    display: none !important;
    visibility: hidden !important;
}

/* =========================================
   6. CACHER L'ICÔNE TOGGLE (CROIX)
   ========================================= */
.swimrun-elevation-container .elevation-toggle-icon,
.swimrun-elevation-container .elevation-control > a[title="Elevation"] {
    display: none !important;
}

/* =========================================
   7. FLÈCHE DRAG - MASQUÉE (pose trop de problèmes)
   ========================================= */
.swimrun-theme .ruler,
.swimrun-elevation-container .ruler,
.swimrun-theme .horizontal-drag-symbol,
.swimrun-elevation-container .horizontal-drag-symbol,
.swimrun-theme .horizontal-drag-line,
.swimrun-elevation-container .horizontal-drag-line,
.swimrun-theme .horizontal-drag-label,
.swimrun-elevation-container .horizontal-drag-label {
    display: none !important;
    visibility: hidden !important;
}

/* =========================================
   8. SUMMARY - STYLES PERSONNALISÉS
   ========================================= */
.swimrun-elevation-container .elevation-summary {
    display: none !important; /* On cache l'original, on le remplace */
}

/* Notre summary personnalisé */
.swimrun-custom-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 0;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: #333;
    align-items: center;
    margin-top: -20px;
    padding: 0px 20px 10px !important;
}

.swimrun-custom-summary span {
    white-space: nowrap;
}

.swimrun-custom-summary strong {
    color: #000;
}

/* Bouton Download */
.swimrun-download-btn {
    background: #000 !important;
    color: #fff !important;
    font-family: 'Roboto', sans-serif !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    padding: 8px 15px 6px 15px !important;
    border: none !important;
    border-radius: 400px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    margin-left: auto !important;
    transition: transform 0.2s ease !important;
    display: inline-block !important;
}

.swimrun-download-btn:hover {
    transform: scale(1.05) !important;
    color: #fff !important;
    text-decoration: none !important;
}

/* =========================================
   9. LÉGENDE PROFIL
   ========================================= */
.swimrun-profile-legend {
    display: flex;
    gap: 20px;
    padding: 8px 0;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: #333;
    margin-bottom: 5px;
    justify-content: center;
}

.swimrun-profile-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.swimrun-profile-legend-color {
    width: 20px;
    height: 4px;
    border-radius: 2px;
}

.swimrun-profile-legend-color.altitude {
    background: #fedd02;
}

.swimrun-profile-legend-color.swim {
    background: #01baef;
}

/* =========================================
   10. MARKERS GPX - GROSSIR FLÈCHES ET KM
   ========================================= */
.swimrun-map-container .dist-marker,
.swimrun-map-container .leaflet-marker-icon.dist-marker {
    width: 24px !important;
    height: 24px !important;
    margin-left: -12px !important;
    margin-top: -12px !important;
    line-height: 24px !important;
    font-size: 12px !important;
    font-weight: bold !important;
    background: rgba(0, 0, 0, 0.75) !important;
    color: #fff !important;
    border-radius: 50% !important;
    text-align: center !important;
    border: 2px solid #fff !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4) !important;
}

.swimrun-map-container .leaflet-marker-icon[src*="rotate"],
.swimrun-map-container .leaflet-marker-icon svg {
    width: 16px !important;
    height: 16px !important;
    margin-left: -8px !important;
    margin-top: -8px !important;
}

.swimrun-map-container .leaflet-marker-pane img[src*="svg"][src*="rotate"] {
    width: 18px !important;
    height: 18px !important;
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.8)) !important;
}

/* =========================================
   11. CURSEUR CARTE
   ========================================= */
.swimrun-map-container {
    cursor: grab;
}
.swimrun-map-container:active {
    cursor: grabbing;
}

/* =========================================
   12. TOOLTIP LABELS PERSONNALISÉS
   ========================================= */
.swimrun-theme .mouse-focus-label-y,
.swimrun-theme .mouse-focus-label-x {
    font-family: 'Roboto', sans-serif !important;
    font-size: 11px !important;
}




/* =========================================
   NETTOYAGE DU PROFIL D'ÉLÉVATION
   ========================================= */



/* (Sécurité) Masque le tout dernier trait horizontal du haut s'il n'y a pas de texte associé */
.swimrun-elevation-container .y.axis .tick:last-of-type:not(:has(text)) line {
    display: none !important;
}

/* =========================================
   MARKERS DÉPART / ARRIVÉE
   ========================================= */
.swimrun-startend-marker {
    background: transparent !important;
    border: none !important;
}

/* =========================================
   CLUSTER MARKERS
   ========================================= */
.swimrun-map-cluster {
    width: 36px;
    height: 36px;
    background: #0B0B0B;
    border: 3px solid #fedd02;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    position: relative;
    cursor: pointer;
}

.swimrun-map-cluster-count {
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 900;
    font-size: 14px;
    line-height: 1;
}

.swimrun-map-cluster-tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #0B0B0B;
    padding: 6px 10px;
    border-radius: 10px;
    display: flex;
    gap: 6px;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 2000;
    white-space: nowrap;
}

.swimrun-map-cluster-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border: 6px solid transparent;
    border-top-color: #0B0B0B;
}

.swimrun-map-cluster:hover .swimrun-map-cluster-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}