h1 {
    margin: 20px 0 20px 0;
    text-align: center;
}

body {
    margin:0;
    font-family: Arial, sans-serif;
}

.btn-big {
    padding: 12px 18px;
    font-size: 18px;
    border-radius: 12px;
    background: white;
    border: 2px solid #222;
    cursor: pointer;
}

#btn-compte {
    margin: 20px auto;
    display: block;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px #333;
    z-index: 2000;
}

.hidden {
    display: none;
}

.hidden-block {
    display: none !important;
}

#popup-compte button {
    text-align: left;
    margin-bottom: 12px;
}

#popup-admin {
    height: 80vh;
    overflow-y: auto;
}

#popup-aides {
    height: 80vh;
    overflow-y: auto;
}

.aide-card {
    padding: 10px;
    background: #f4f4f4;
    border-radius: 8px;
    margin-bottom: 12px;
}

.aide-header {
    font-size: 16px;
    margin-bottom: 6px;
}

.aide-info {
    margin-bottom: 6px;
}

.aide-message {
    margin-bottom: 12px;
}

.aide-buttons button {
    margin-right: 10px;
}

.btn-signaler {
    color: red;
    font-weight: bold;
}

#mode-switch {
    margin: 20px auto 10px auto;
    width: 320px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    position: relative;
}

#mode-switch .label {
    width: 80px;
    text-align: center;
    opacity: 0.6;
    font-weight: normal;
    white-space: nowrap;
}

#mode-switch .label.active {
    font-weight: bold;
    opacity: 1;
}

#slider {
    width: 120px;
    height: 16px;
    background: #ddd;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
}

#knob {
    position: absolute;
    top: -6px;
    left: 45px;
    width: 28px;
    height: 28px;
    background: #4a90e2;
    border-radius: 50%;
    transition: left 0.25s;
}

#neutral-label {
    text-align: center;
    font-size: 14px;
    margin-top: -5px;
    opacity: 0.6;
}

#border-escalier {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
    width: 1px;
}

.bord {
    position: absolute;
    background: black;
}

#legende {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0 2 8px #999;
    font-size: 14px;
    z-index: 1000;
    text-align: right;
    pointer-events: auto !important;
}

.toggle-btn {
    position: absolute;
    right: 20px;
    background: white;
    border: 2px solid #444;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    z-index: 1600;
}

#toggle-legende { top: 20px }
#toggle-map-buttons { top: 60px }

.close-btn {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 12px;
    cursor: pointer;
}

#legende p {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 6px;
        margin: 4px 0;
    }

.icone-moi {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: #7B4BFF;
    border-radius: 50%;
    margin-right: 6px;
}

.icone-moi-map {
    width: 100%;
    height: 100%;
    background: #7B4BFF;
    border-radius: 50%;
    border: 2px solid white;
}

.icone-map {
    font-size: 38px !important;
    line-height: 38px;
    text-align: center;
}

.emoji-icone {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
}

.icone-demande, .icon-proposition {
    font-size: 18px;
    margin-right: 6px;
    font-weight: bold;
}

#carte {
    position: relative;
    height: 70vh;
    margin: 20px;
    border-radius: 20px;
}

#map-buttons {
    position: absolute;
    top: 130px;
    right: 20px;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    z-index: 1500;
}

#map-buttons button {
    padding: 10px 14px;
    background: white;
    border: 2px solid #444;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    text-align: right;
    width: fit-content;
    white-space: nowrap;
}

#map-buttons button:hover {
    background: #e6e6e6;
}

.leaflet-popup {
    z-index: 10000 !important;
}

.leaflet-pane {
    z-index: 1 !important;
}

.leaflet-popup-pane {
    z-index: 12000 !important;
}

#choix-type {
    width: 100%;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 20px;
    margin: 20px auto;
    display: flex;
    gap: 20px;
}

.btn-type {
    padding: 8px 16px;
    border-radius: 8px;
    border: 2px solid #666;
    background: #eee;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
}

.btn-type.active {
    background: #4caf50;
    color: white;
    border-color: #2d7a2d;
}

@media (max-width: 600px) and (orientation: portrait) {
    h1 {
        margin: 15px auto;
        text-align: center;
    }

    body {
        font-size: 16px;
    }

    #btn-compte {
        font-size: 1.4rem;
        padding: 18px 25px;
        width: 90%;
        display: block;
    }

    #btn-compte {
        margin: 15px auto;
    }

    .leaflet-control-zoom-in,
    .leaflet-control-zoom-out {
        width: 48px !important;
        height: 48px !important;
        font-size: 2rem !important;
        line-height: 48px !important;
    }

    #carte {
        margin: 15px auto;
        padding: 10px;
    }

    #carte {
        height: 58vh !important;
        border-radius: 40px;
        overflow: hidden;
        position: relative;
    }

    .popup {
        font-size: 1.2rem !important;
        padding: 18px !important;
        width: 90vw;
        max-height: 80vh;
        z-index: 9999;
    }

    .popup button {
        font-size: 1.2rem !important;
        padding: 12px !important;
    }

    #map-buttons {
        margin-bottom: 15px;
    }

    #map-buttons {
        position: absolute;
        bottom: 12px;
        left: 50%;
        transform: translateX(-50%);
        top: auto;
        right: auto;
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 80%;
        z-index: 2000;
    }

    #map-buttons button {
        padding: 10px;
        font-size: 1rem;
        border-radius: 8px;
        margin: 0; 
        width: 100%;
    }

    #legende {
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 14px;
        padding: 10px 15px;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        max-width: 110px;
        line-height: 1;
        z-index: 1000;
        margin: 0;
        text-align: right;
    }

    #legende img {
        width: 20px;
        height: 20px;
    }

    .leaflet-popup {
        z-index: 10000 !important;
    }

    .leaflet-pane {
        z-index: 1 !important;
    }

    .leaflet-popup-pane {
        z-index: 12000 !important;
    }

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

    #choix-type {
        margin: 15px auto;
    }

    #choix-type {
        flex-direction: column;
        gap: 10px;
    }

    .btn-type {
        width: 90%;
        text-align: center;
        padding: 10px;
        font-size: 16px;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    #carte {
        height: 70vh !important;
    }

    .popup {
        width: 70vw;
        max-height: 70vh;
    }

    #map-buttons {
        bottom: 10px;
        right: 10px;
        gap: 8px;
    }

    #map-buttons button {
        padding: 8px 10px;
        font-size: 13px;
    }

    #legende {
        font-size: 12px;
        padding: 8px;
    }
}

@media (prefers-color-scheme: dark) {
}