/**
 * Battleground Mission Control - Print Styles
 * 
 * Optimiert für Missions-Ausdruck mit Karten
 * 
 * @package Battleground Mission Control
 * @since 1.0.0 Build 004
 * @author Ayonto UG | ayonto.de
 */

/* ========================================
 * PRINT STYLES
 * ======================================== */

@media print {
    
    /* ===== ALLGEMEIN ===== */
    
    * {
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    /* Nur Mission anzeigen */
    body * {
        visibility: hidden;
    }
    
    .bmc-mission-print,
    .bmc-mission-print * {
        visibility: visible;
    }
    
    .bmc-mission-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    
    /* ===== ELEMENTE AUSBLENDEN ===== */
    
    .bmc-no-print,
    .site-header,
    .site-footer,
    .sidebar,
    .nav,
    .navigation,
    .header,
    .footer,
    .wp-admin-bar,
    button,
    .bmc-btn,
    .bmc-action-buttons,
    .bmc-edit-controls {
        display: none !important;
    }
    
    /* ===== SEITENLAYOUT ===== */
    
    @page {
        margin: 2cm;
        size: A4 portrait;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    /* ===== MISSION HEADER ===== */
    
    .bmc-print-header {
        margin-bottom: 1cm;
        padding-bottom: 0.5cm;
        border-bottom: 2pt solid #000;
    }
    
    .bmc-print-header h1 {
        font-size: 20pt;
        font-weight: bold;
        margin: 0 0 0.5cm 0;
    }
    
    .bmc-print-meta {
        display: flex;
        gap: 1cm;
        flex-wrap: wrap;
    }
    
    /* ===== BADGES ===== */
    
    .bmc-status-badge,
    .bmc-faction-badge,
    .bmc-points {
        display: inline-block;
        padding: 0.2cm 0.5cm;
        border: 1pt solid #000;
        border-radius: 0.2cm;
        font-weight: bold;
        
        /* Farben beibehalten */
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .bmc-faction-badge {
        background-color: var(--faction-color, #666) !important;
        color: #fff !important;
    }
    
    /* Status-Farben */
    .bmc-status-draft { background: #9E9E9E !important; color: #fff !important; }
    .bmc-status-pending { background: #FFC107 !important; color: #000 !important; }
    .bmc-status-active { background: #4CAF50 !important; color: #fff !important; }
    .bmc-status-completed { background: #2196F3 !important; color: #fff !important; }
    .bmc-status-failed { background: #F44336 !important; color: #fff !important; }
    .bmc-status-cancelled { background: #757575 !important; color: #fff !important; }
    
    /* ===== SECTIONS ===== */
    
    .bmc-mission-section {
        margin-bottom: 0.8cm;
        page-break-inside: avoid;
    }
    
    .bmc-mission-section h3 {
        font-size: 14pt;
        font-weight: bold;
        margin: 0 0 0.3cm 0;
        border-bottom: 1pt solid #ccc;
        padding-bottom: 0.2cm;
    }
    
    /* ===== ZEITRAHMEN ===== */
    
    .bmc-timeframe p {
        margin: 0.2cm 0;
    }
    
    .bmc-timeframe strong {
        font-weight: bold;
    }
    
    /* ===== BESCHREIBUNG ===== */
    
    .bmc-description p {
        margin: 0.3cm 0;
    }
    
    .bmc-description ul,
    .bmc-description ol {
        margin: 0.3cm 0;
        padding-left: 1cm;
    }
    
    /* ===== OBJECTIVES ===== */
    
    .bmc-objectives-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .bmc-objectives-list li {
        display: flex;
        margin-bottom: 0.4cm;
        page-break-inside: avoid;
    }
    
    .bmc-obj-number {
        display: inline-block;
        width: 1cm;
        font-weight: bold;
        flex-shrink: 0;
    }
    
    .bmc-obj-text {
        flex: 1;
    }
    
    .bmc-obj-checkbox {
        display: inline-block;
        width: 0.5cm;
        height: 0.5cm;
        border: 1pt solid #000;
        margin-right: 0.3cm;
        flex-shrink: 0;
    }
    
    /* ===== KARTE ===== */
    
    .bmc-map-section {
        page-break-before: auto;
        page-break-inside: avoid;
    }
    
    .bmc-mission-map {
        width: 100%;
        height: 12cm !important;
        border: 1pt solid #ccc;
        page-break-inside: avoid;
        
        /* Leaflet-Karte druckbar machen */
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color-adjust: exact;
    }
    
    /* Leaflet-spezifische Print-Fixes */
    .leaflet-container {
        background: #fff !important;
    }
    
    .leaflet-control-container {
        display: none !important;
    }
    
    .leaflet-tile {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color-adjust: exact;
    }
    
    /* ===== SEITENUMBRÜCHE ===== */
    
    .bmc-page-break {
        page-break-before: always;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    /* ===== LINKS ===== */
    
    a {
        text-decoration: none;
        color: #000;
    }
    
    a[href]:after {
        content: "";
    }
    
    /* ===== ATTACHMENTS ===== */
    
    .bmc-attachments-list {
        list-style: none;
        padding: 0;
    }
    
    .bmc-attachments-list li {
        margin-bottom: 0.3cm;
        padding-left: 0.5cm;
        text-indent: -0.5cm;
    }
    
    .bmc-attachments-list li:before {
        content: "📎 ";
        font-size: 10pt;
    }
    
    /* ===== NOTES ===== */
    
    .bmc-notes {
        background: #f5f5f5 !important;
        border: 1pt dashed #999;
        padding: 0.5cm;
        margin-top: 0.5cm;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .bmc-notes h4 {
        margin: 0 0 0.3cm 0;
        font-size: 11pt;
        font-weight: bold;
    }
    
    /* ===== FOOTER ===== */
    
    .bmc-print-footer {
        margin-top: 1cm;
        padding-top: 0.5cm;
        border-top: 1pt solid #ccc;
        font-size: 9pt;
        text-align: center;
        color: #666;
    }
}

/* ===== PRINT PREVIEW MODE ===== */

body.bmc-print-preview {
    background: #f5f5f5;
}

body.bmc-print-preview .bmc-mission-print {
    background: #fff;
    max-width: 21cm;
    margin: 2cm auto;
    padding: 2cm;
    box-shadow: 0 0 1cm rgba(0,0,0,0.2);
}
