/**
 * Styles pour l'impression des cartes avec leaflet.browser.print
 */

/* Styles pour le bouton d'impression */
.leaflet-control-browser-print {
    clear: none !important;
}

.leaflet-control-browser-print a {
    background-color: #fff;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.65);
    cursor: pointer;
}

.leaflet-control-browser-print a:hover {
    background-color: #f4f4f4;
}

.leaflet-control-browser-print a i {
    font-size: 16px;
    line-height: 30px;
}

/* Styles pour le bouton d'impression */
.print-button, .print-button-alt {
    background-color: #fff !important;
    border: 2px solid rgba(0,0,0,0.2) !important;
    color: #000 !important;
    font-weight: bold !important;
    font-size: 16px !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    text-align: center !important;
    text-decoration: none !important;
    display: block !important;
}

.print-button:hover, .print-button-alt:hover {
    background-color: #f4f4f4 !important;
}

.print-button-alt {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 1000 !important;
    padding: 5px 10px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 4px !important;
}

/* Assurer que les contrôles sont visibles */
.leaflet-top {
    z-index: 1000 !important;
}

.leaflet-control {
    clear: both !important;
    pointer-events: auto !important;
}

/* Styles pour le menu d'impression */
.browser-print-mode {
    padding: 6px 10px;
    background: white;
    cursor: pointer;
    border-bottom: 1px solid #ccc;
}

.browser-print-mode:hover {
    background-color: #f4f4f4;
}

.browser-print-mode:last-child {
    border-bottom: none;
}

/* Styles pour l'impression */
@media print {
    .leaflet-control-container {
        display: none !important;
    }
    
    #controls, .navbar, .footer, .sidebar, .leaflet-control {
        display: none !important;
    }
    
    #map {
        height: 100% !important;
        width: 100% !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }
}

/* Styles pour l'impression de la carte */

/* Cacher les éléments inutiles lors de l'impression */
@media print {
    header, 
    footer, 
    .sidebar, 
    .navbar, 
    .no-print,
    .leaflet-control-container .leaflet-top,
    .leaflet-control-container .leaflet-bottom {
        display: none !important;
    }
    
    /* Assurer que la carte occupe toute la page */
    body {
        margin: 0;
        padding: 0;
    }
    
    #map-container, 
    #map {
        width: 100% !important;
        height: 100vh !important;
        page-break-inside: avoid;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Styles pour les popups */
    .leaflet-popup-content-wrapper {
        background: white !important;
        color: black !important;
        border: 1px solid #999 !important;
    }
    
    /* Assurer que les enceintes sont bien visibles */
    .leaflet-interactive {
        stroke-width: 2px !important;
        stroke-opacity: 1 !important;
        fill-opacity: 0.2 !important;
    }
}

/* Styles spécifiques pour le mode d'impression */
body.leaflet-print-mode {
    overflow: hidden !important;
}

body.leaflet-print-mode #map-container,
body.leaflet-print-mode #map {
    width: 100% !important;
    height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 9999 !important;
}
