/* أحوال الطرق - تصميم الطباعة */

@media print {
    /* إخفاء العناصر غير المطلوبة للطباعة */
    .floating-report-btn,
    .search-filter-section,
    .actions-cell,
    .modal,
    .btn-report,
    .region-link {
        display: none !important;
    }
    
    /* تحسين التخطيط للطباعة */
    .road-conditions-wrapper {
        max-width: none;
        padding: 0;
        margin: 0;
    }
    
    .road-conditions-header {
        background: none !important;
        color: #000 !important;
        box-shadow: none !important;
        border: 2px solid #000;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }
    
    .main-title {
        font-size: 24pt;
        text-shadow: none !important;
        margin-bottom: 10px;
    }
    
    .last-update {
        font-size: 12pt;
        color: #000 !important;
    }
    
    /* تحسين الجدول للطباعة */
    .conditions-table-wrapper {
        box-shadow: none !important;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .conditions-table {
        font-size: 10pt;
        width: 100%;
    }
    
    .conditions-table th {
        background: #f0f0f0 !important;
        color: #000 !important;
        border: 1px solid #000;
        padding: 8px 4px;
        font-weight: bold;
    }
    
    .conditions-table td {
        border: 1px solid #000;
        padding: 6px 4px;
        vertical-align: top;
    }
    
    .condition-row:hover {
        background: none !important;
    }
    
    /* تحسين شارات الحالة للطباعة */
    .status-badge {
        border: 1px solid #000 !important;
        padding: 2px 6px;
        font-weight: bold;
    }
    
    .status-open {
        background: #e8f5e8 !important;
        color: #000 !important;
    }
    
    .status-traffic {
        background: #fff8e1 !important;
        color: #000 !important;
    }
    
    .status-closed {
        background: #ffebee !important;
        color: #000 !important;
    }
    
    .status-unknown {
        background: #f5f5f5 !important;
        color: #000 !important;
    }
    
    /* تحسين النصوص للطباعة */
    .region-name {
        font-weight: bold;
        color: #000 !important;
    }
    
    .status-details {
        font-size: 9pt;
        color: #333 !important;
    }
    
    .custom-details {
        font-size: 8pt;
        background: #f9f9f9 !important;
        border: 1px solid #ccc;
        color: #000 !important;
    }
    
    /* إضافة معلومات الطباعة */
    .print-info {
        display: block !important;
        font-size: 10pt;
        text-align: center;
        margin-top: 20px;
        padding-top: 10px;
        border-top: 1px solid #000;
        page-break-inside: avoid;
    }
    
    /* تحسين فواصل الصفحات */
    .conditions-table thead {
        display: table-header-group;
    }
    
    .condition-row {
        page-break-inside: avoid;
    }
    
    /* إضافة رقم الصفحة */
    @page {
        margin: 2cm;
        @bottom-right {
            content: "صفحة " counter(page) " من " counter(pages);
            font-size: 10pt;
        }
        @top-center {
            content: "أحوال الطرق اليوم - " date();
            font-size: 10pt;
        }
    }
    
    /* تحسين الألوان للطباعة بالأبيض والأسود */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    /* تحسين الخطوط للطباعة */
    body, .road-conditions-wrapper {
        font-family: 'Times New Roman', serif !important;
        line-height: 1.4;
    }
    
    .main-title {
        font-family: 'Arial', sans-serif !important;
    }
}

/* إضافة معلومات الطباعة (مخفية في العرض العادي) */
.print-info {
    display: none;
}

/* تحسينات إضافية للطباعة الملونة */
@media print and (color) {
    .status-open {
        background: #c8e6c9 !important;
        color: #1b5e20 !important;
    }
    
    .status-traffic {
        background: #fff3e0 !important;
        color: #e65100 !important;
    }
    
    .status-closed {
        background: #ffcdd2 !important;
        color: #b71c1c !important;
    }
    
    .road-conditions-header {
        background: linear-gradient(135deg, #006064 0%, #00838f 100%) !important;
        color: white !important;
    }

    .conditions-table th {
        background: linear-gradient(135deg, #006064 0%, #00838f 100%) !important;
        color: white !important;
    }
}
