/* ==========================================================================
   INTERFACE À L'ÉCRAN : Formulaires et boutons de la modale d'impression
   ========================================================================== */

/* --- Formulaires à l'intérieur de la modale --- */
.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.form-group label {
    font-size: 14px;
    font-weight: bold;
    color: #2c3e50;
}
.form-group input, .form-group select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}
.form-group-checkbox {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* --- Boutons d'action de la modale --- */
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.action-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.pdf-color { background-color: #27ae60; }
.pdf-color:hover { background-color: #219653; }
.shp-color { background-color: #2980b9; }
.shp-color:hover { background-color: #2471a3; }

/* --- Overlay de mise en page pour le PDF (Invisible à l'écran) --- */
#print-layout-overlay {
    display: none;
}

/* ==========================================================================
   RENDU PAPIER / PDF : Styles appliqués uniquement lors de l'impression
   ========================================================================== */
@media print {
    body, html {
        background: white !important;
        overflow: visible !important;
    }

    /* Titres des sections dans l'aperçu avant impression */
    .export-section h3 {
        margin-top: 0;
        margin-bottom: 12px;
        color: #2c3e50;
        font-size: 16px;
        border-bottom: 2px solid #f1f1f1;
        padding-bottom: 5px;
    }

    /* FUSION : On cache TOUTE l'interface utilisateur web sur le papier */
    .leaflet-control-container, 
    .leaflet-control-zoom,
    .action-buttons-container, 
    .tools-container-right, 
    #help-btn, 
    .modal {
        display: none !important;
    }

    /* Rend l'overlay de la carte (titre, légende) visible sur le papier */
    #print-layout-overlay {
        display: block !important;
        position: absolute;
        top: 20px;
        left: 20px;
        z-index: 9999;
        background: rgba(255, 255, 255, 0.9);
        padding: 15px;
        border-radius: 8px;
        border: 2px solid #2c3e50;
        max-width: 300px;
        font-family: sans-serif;
    }
    #layout-title { margin: 0 0 10px 0; font-size: 20px; color: #2c3e50; }
    #layout-date { font-size: 12px; color: #7f8c8d; margin-bottom: 10px; }
    #layout-legend h3 { margin: 5px 0; font-size: 14px; border-bottom: 1px solid #ccc; }
    
    /* FUSION : La carte s'adapte parfaitement à la feuille de papier */
    #map {
        position: absolute !important;
        top: 0;
        left: 0;
        width: 100vw !important;
        height: 100vh !important;
    }
}