/* ===== CSS DÉDIÉ À L'IMPRESSION DU PLANNING ===== */

/* Configuration de base pour l'impression */
@media print {
    /* Configuration de la page */
    @page {
        size: A4 landscape;
        margin: 0.5cm;
    }
    
    /* Masquer les éléments non nécessaires à l'impression */
    body * {
        visibility: hidden;
    }
    
    /* Afficher uniquement le contenu du planning */
    .print-content, .print-content * {
        visibility: visible;
    }
    
    .print-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    
    .employee-name {
        font-size: 10px !important;
        font-weight: bold !important;
        color: #000 !important;
    }
    
    /* Shifts non planifiés */
    .unscheduled-shift {
        position: relative !important;
    }
    
    .unscheduled-shift::before {
        content: "⚠️" !important;
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        font-size: 8px !important;
        color: #ff6b35 !important;
        background: rgba(255, 255, 255, 0.8) !important;
        border-radius: 50% !important;
        width: 12px !important;
        height: 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Différences positives et négatives */
    .positive-diff {
        background-color: #28a745 !important;
        color: white !important;
        padding: 1px 3px !important;
        border-radius: 2px !important;
        font-size: 7px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .negative-diff {
        background-color: #dc3545 !important;
        color: white !important;
        padding: 1px 3px !important;
        border-radius: 2px !important;
        font-size: 7px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Footer du tableau - uniquement sur la dernière page */
    #sticky-footer, tfoot {
        background-color: #f8f9fa !important;
        font-weight: bold !important;
        border-top: 2px solid #000 !important;
        position: static !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Masquer les éléments interactifs */
    .plus-icon,
    .icon-overlay,
    .drag-handle,
    .bi-grip-vertical,
    button,
    input[type="checkbox"],
    .dropdown-menu,
    .modal {
        display: none !important;
    }
    
    /* Forcer le footer à rester en bas de la dernière page */
    tfoot {
        position: static !important;
        bottom: auto !important;
        page-break-before: avoid !important;
        page-break-inside: avoid !important;
        break-before: avoid !important;
        break-inside: avoid !important;
    }
    
    /* Titre du planning */
    .planning-title {
        font-size: 14px !important;
        font-weight: bold !important;
        text-align: center !important;
        margin-bottom: 10px !important;
        color: #000 !important;
    }
    
    /* Optimisation de l'espace */
    body {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Forcer l'affichage des couleurs dans tous les navigateurs */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
}

/* Styles pour la prévisualisation d'impression */
.print-preview {
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin: 20px auto;
    padding: 20px;
    max-width: 1200px;
}

.print-preview .employee-name {
    font-size: 10px;
}

/* Styles pour le mode impression navigateur amélioré */
@media screen {
    .print-mode {
        background: white !important;
        color: black !important;
    }
}
