/*
********************************************************************
************** Feuille de style spécifique à la carte **************
********************************************************************
*/
body#map_page {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/*
********************* Mise en page de la carte *********************
*/
.map_container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 100px;
    overflow: hidden;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}


/*
************************* Menu de la carte *************************
*/
.menu_pad{
    border-bottom: solid 1px #3c3c7656;
    padding: 20px;
}

.map_menu {
    position: absolute;
    top: 100px;
    bottom: 0;
    left: 0;
    width: 25%;
    overflow-y: auto;
    background-color: rgb(247, 247, 247);
    z-index: 4;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    border: solid 1px #3c3c7656;
    border-top: none;
    border-bottom: none;
}

.menu_header {
    position: sticky;
    top: 0;
    background-color: rgb(247, 247, 247);
    z-index: 5;
    padding: 20px;
    border-bottom: 1px solid #3c3c7656;
}

.menu_filters {
    overflow-y: auto;
    flex-grow: 1;
}

.activity_count{
    font-size: 22px;
    font-weight: 700;
    color: #e6007e;
}

.legend{
    color: #2d2e83;
    font-size: 12px;
    line-height: 1em;
    margin-top: 7px;
}

.legend span{
    display: inline-block;
    align-items: bottom;
    justify-content: center;
    margin: 2px;
    font-weight: 300;
}

.legend img{
    width: 9px;
    height: 9px;
    padding-top: 2px;
}

/* Cache le bouton par défaut */
.menu_toggle{
    display: none;
    position: fixed;
    top: 130px;
    left: 30px;
    background-color: #e6007e;
    border: none;
    border-radius: 8px;
    padding: 10px;
    z-index: 3;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.menu_toggle .loupe_icon{
    width: 24px;
    height: 24px;
    fill: white;
}

/* Croix de fermuture du menu des filtres */
.menu_close{
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 6;
}

.menu_close span{
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #e6007e;
    transform-origin: center;
    transition: 0.3s;
}

.menu_close span:first-child{
    transform: rotate(45deg);
}

.menu_close span:last-child{
    transform: rotate(-45deg);
}


@media only screen and (max-width: 1000px) {
    .map_menu {
        display: none;
        width: 65%;
    }

    .map_menu.open {
        display: block;
    }

    .menu_toggle {
        display: block;
    }

    .menu_close {
        display: block;
    }
}


/*              Les filtres             */
.filter{
    width: auto;
}


/* Le menu déroulant des filtres */
.filter_header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 700;
}

.filter_title {
    font-weight: 700;
    font-size: 18px;
}

.filter_subtitle{
    font-size: 15px;
    color: #a5a5a5;
    margin-top: 2px;
}

.ripple_wrapper{
    position: relative;
    display: inline-block;
    vertical-align: middle;
    overflow: hidden;
    border-radius: 50%;
    padding: 5px;
}

.ripple_effect {
    position: absolute;
    width: 30px; 
    height: 30px;
    background: rgba(45, 47, 131, 0.193);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.6;
    pointer-events: none;
    animation: ripple-animation 0.6s ease-out forwards;
    z-index: 1;
}

@keyframes ripple-animation {
    to {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0;
    }
}

.dropdown_icon{
    width: 20px;
    height: 20px;
    vertical-align: middle;
    fill: #2d2e83;
    transition: transform 0.2s ease;
    transform-origin: center;
    position: relative;
    z-index: 2;
}

.dropdown_icon.rotated{
    transform: rotate(180deg);
}


/* Le contenue des filtres */
.filter_container{
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}


/*La localisation*/
.location_content{
    position: relative;
    display: flex;
    justify-content: space-between;
    border-bottom: solid 2px #2d2f8384;
    padding: 0 0 0 0;
}

#location{
    background: transparent;
    border: none;
    padding: 5px 0;
    font-size: 14px;
    width: 100%;
    color: #2d2f83;
    outline: none;
    transition: border-color 0.3s ease;
}

#location::placeholder{
    color: rgba(45, 47, 131, 0.4);
}

.location_target{
    width: 20px;
    height: 20px;
    fill: #e6007e;
    cursor: pointer;
}

.distance_selector{
    margin: 15px 10px 0 10px;
}

/* Liste d'autotcomplétion des adresses */
.autocomplete-suggestions{
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ccc;
    border-top: none; 
    z-index: 10;
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: none;
}

.autocomplete-suggestions li{
    padding: 5px 10px;
    cursor: pointer;
}
.autocomplete-suggestions li:hover{
    background-color: #f0f0f0;
}


.distance_track{
    position: relative;
    height: 3px;
    background: #ccc;
    border-radius: 3px;
    margin: 20px 0 40px 0;
    user-select: none;
}

.distance_fill{
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: #e6007e;
    border-radius: 3px;
    width: 0;
    pointer-events: none;
    z-index: 1;
}

.distance_point{
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.distance_point.active,
.distance_point:hover 
{
    background: #e6007e;
}

.distance_point.selected{
    width: 10px;
    height: 10px;
    border-width: 2px;
    background-color: #fff;
}

.distance_point .label{
    position: absolute;
    font-size: 15px;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: normal;
    color: #ccc;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    transition: color 0.3s ease, font-weight 0.3s ease;
}

.distance_point.active .label{
    font-weight: bold;
    color: #2d2e83;
}

.active_circle{
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 6px solid #e6007e;
    border-radius: 50%;
    cursor: grab;
    transform: translate(-50%, -50%);
    z-index: 3;
    transition: left 0.3s ease;
}

.active_circle:active {
    cursor: grabbing;
}

.distance_selector.disabled,
.distance_selector.disabled * {
  pointer-events: none; 
  opacity: 0.5;
  user-select: none;
  cursor: not-allowed !important;
}


/* Les jours, Types d'activités et programme de prescritpion (checkboxs) */

/* Style général du label pour aligner texte et svg */
.checkbox_group{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox_option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.checkbox_option label{
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 8px;
    font-size: 15px;
    color: #2d2d83;
    border: 1px solid #98c7204e;
    border-radius: 25px;
    padding: 4px 20px 4px 8px;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
    background-color: transparent;
}

.checkbox_option input[type="checkbox"]:not(:checked) + label:active,
.checkbox_option input[type="checkbox"]:not(:checked):focus + label,
.checkbox_option input[type="checkbox"]:not(:checked):focus-visible + label 
{
    background-color: transparent;
    border-color: #98c7204e;
}

/* Conteneur SVG à gauche*/
.custom_checkbox{
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    position: relative;
}

/* Style de la coche (polyline en V) */
.custom_checkbox .check{
    fill: none;
    stroke: #f8d3e6;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 1; 
    transition: stroke 0.3s;
}

.custom_checkbox svg{
    width: 28px;
    height: 28px;
}

.checkbox_option input[type="checkbox"]:checked + label{
    border-color: #98c7204e;
    background-color: #98c7204e;
    color: #2d2d83;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.checkbox_option input[type="checkbox"]:checked + label .custom_checkbox .check{
    stroke: #ff0077;
    opacity: 1;
}

.checkbox_option label:hover{
    border-color: #2d2d83;
}

.checkbox_option input[type="checkbox"]:focus {
    outline: none;
    box-shadow: none;
}

.checkbox_option input[type="checkbox"]:not(:checked) + label:hover .custom_checkbox .check {
    stroke: #c0c8ff;
}

.checkbox_svg .outer {
    fill: none; 
    stroke: none; 
}

.checkbox_option input[type="checkbox"]:not(:checked) + label:hover {
    border-color: #2d2d83;
    background-color: transparent;
}


/* Le tarif */
.price_selector{
    margin: 15px 10px 0 10px;
}

.price_hitbox{
    position: relative;
    cursor: pointer;
    height: 40px;
    margin: 5px 0;
}

.price_track{
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    height: 3px;
    background: #ccc;
    border-radius: 3px;
    pointer-events: auto;
    z-index: 1;
}

.price_fill{
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: #e6007e;
    border-radius: 3px;
    width: 0;
    pointer-events: none;
    z-index: 1;
}

.price_point{
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.price_point .label{
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: normal;
    color: #ccc;
    white-space: nowrap;
    font-size: 15px;
    pointer-events: none;
    user-select: none;
}

.active_circle{
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 6px solid #e6007e;
    border-radius: 50%;
    cursor: grab;
    transform: translate(-50%, -50%);
    z-index: 3;
    transition: left 0.05s ease;
}

.active_circle:active{
    cursor: grabbing;
}

.price_point.active{
    background: #e6007e;
}

.price_point.active .label{
    color: #2d2f83;
    font-weight: bold;
}

.price_tooltip{
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2d2f83;
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.active_circle:hover .price_tooltip,
.active_circle.dragging .price_tooltip 
{
    opacity: 1;
}

/*
** Le modal d'information d'une activite
*/
.modal-overlay{
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content{
    background: white;
    padding: 20px 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.modal-close{
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
}



/*
********************* La carte interactive *********************
*/
/*                       Les marqueurs                        */
.custom-pin{
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 6px solid rgb(224, 226, 255);
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}

.custom-pin::after {
    content: "";
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid rgb(224, 226, 255);
}

/* Pour la priorité d'affichege (tooltip > popup)*/
.leaflet-tooltip-pane {
    z-index: 1001 !important;
}
.leaflet-popup-pane {
    z-index: 1000 !important;
}

.leaflet-tooltip.custom-tooltip {
    background-color: white;
    border: 1px solid #ccc;
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    color: #2d2d83;
    font-weight: 700;
    z-index: 10000 !important;
}

/* Message d'erreur de la carte */
#mapError{
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: #f8d7da;
    color: #721c24;
    height: 100%;
    width: 100%;
    border: 1px solid #f5c6cb;
    font-family: sans-serif;
    font-size: 16px;
}

.error_icon{
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    text-align: center;
    font-weight: bold;
    font-size: 24px;
    line-height: 40px;
    margin-bottom: 10px;
}

/* Le bouton de reset des filtres */
.reset_button{
    background: none;
    border: none;
    color: #2d2d83;
    cursor: pointer;
    margin-right: auto;
    border: solid 1px #2d2d83;
    border-radius: 25px;
    padding: 3px 6px;
    margin-left: 10px;
    font-size: 0.7em;
    transition: transform 0.2s ease;
}

.reset_button:hover{
    color: #e6007e;
    background-color: #6565dd22;
}

