/**
 * AUTO TESTER - المصرية لفحص السيارات
 * الملف: print.css
 * الوصف: تنسيقات مخصصة للطباعة
 * الإصدار: 1.0
 */

@media print {
    /* ========================================
       إخفاء العناصر غير المرغوب فيها في الطباعة
       ======================================== */
    .navbar,
    .footer,
    .btn,
    .no-print,
    .tabs,
    .filters-section,
    .action-buttons,
    .pagination,
    .sidebar,
    .header-actions,
    .breadcrumb,
    .back-to-top,
    .theme-switch,
    .notification-bell,
    .user-menu,
    .logout-btn,
    .login-btn,
    .social-links,
    .quick-actions,
    .chat-input-area,
    .send-btn,
    .upload-area,
    .file-upload-area,
    .modal,
    .dropdown,
    .tooltip {
        display: none !important;
    }
    
    /* ========================================
       تنسيقات الصفحة الأساسية
       ======================================== */
    body {
        background: white;
        color: black;
        font-family: 'Cairo', sans-serif;
        line-height: 1.4;
        padding: 0;
        margin: 0;
    }
    
    .container,
    .main-content,
    .container-fluid {
        max-width: 100%;
        padding: 0.5cm;
        margin: 0;
    }
    
    /* ========================================
       تنسيقات العناوين
       ======================================== */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        break-after: avoid;
        color: #002b5c;
        margin-top: 0.5cm;
        margin-bottom: 0.3cm;
    }
    
    h1 {
        font-size: 24pt;
        border-bottom: 2px solid #ffd700;
        padding-bottom: 0.2cm;
    }
    
    h2 {
        font-size: 20pt;
    }
    
    h3 {
        font-size: 16pt;
    }
    
    /* ========================================
       تنسيقات الفقرات
       ======================================== */
    p {
        orphans: 3;
        widows: 3;
        font-size: 12pt;
        line-height: 1.5;
        margin: 0.2cm 0;
    }
    
    /* ========================================
       تنسيقات الروابط
       ======================================== */
    a {
        color: #002b5c;
        text-decoration: underline;
        word-wrap: break-word;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        font-style: italic;
        color: #666;
    }
    
    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "";
    }
    
    /* ========================================
       تنسيقات الجداول
       ======================================== */
    table {
        width: 100%;
        border-collapse: collapse;
        margin: 0.5cm 0;
        page-break-inside: avoid;
    }
    
    th {
        background: #002b5c !important;
        color: white !important;
        font-weight: bold;
        padding: 8px;
        border: 1px solid #333;
    }
    
    td {
        padding: 6px;
        border: 1px solid #ccc;
    }
    
    /* ========================================
       تنسيقات البطاقات
       ======================================== */
    .card,
    .table-card,
    .chart-card,
    .stat-card,
    .request-card,
    .profile-card {
        box-shadow: none;
        border: 1px solid #ddd;
        border-radius: 5px;
        padding: 0.3cm;
        margin-bottom: 0.4cm;
        background: white;
        break-inside: avoid;
    }
    
    .card-header,
    .card-footer {
        border: none;
        background: none;
        padding: 0.2cm 0;
    }
    
    .card-header h2,
    .card-header h3 {
        margin: 0;
    }
    
    /* ========================================
       تنسيقات الصور
       ======================================== */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
        break-inside: avoid;
        border: 1px solid #eee;
        padding: 0.1cm;
    }
    
    /* ========================================
       تنسيقات الشعار
       ======================================== */
    .print-logo {
        display: block !important;
        text-align: center;
        margin-bottom: 0.5cm;
    }
    
    .print-logo img {
        max-width: 200px;
    }
    
    .print-logo h1 {
        border: none;
        font-size: 28pt;
        color: #002b5c;
    }
    
    .print-logo span {
        color: #ffd700;
    }
    
    /* ========================================
       تنسيقات التاريخ والوقت
       ======================================== */
    .print-date {
        display: block;
        text-align: left;
        font-size: 10pt;
        color: #666;
        margin-bottom: 0.3cm;
        border-top: 1px dashed #ccc;
        padding-top: 0.2cm;
    }
    
    /* ========================================
       تنسيقات الفواصل
       ======================================== */
    hr {
        border: 1px solid #ccc;
        margin: 0.3cm 0;
    }
    
    /* ========================================
       تنسيقات القوائم
       ======================================== */
    ul, ol {
        margin: 0.2cm 0;
        padding-right: 0.5cm;
    }
    
    li {
        margin: 0.1cm 0;
    }
    
    /* ========================================
       تنسيقات الشهادات والتقارير
       ======================================== */
    .certificate,
    .report {
        border: 2px solid #002b5c;
        padding: 0.5cm;
        margin: 0.5cm 0;
        background: #f9f9f9;
    }
    
    .certificate-header {
        text-align: center;
        border-bottom: 3px double #ffd700;
        padding-bottom: 0.3cm;
        margin-bottom: 0.3cm;
    }
    
    .certificate-number {
        font-family: monospace;
        font-size: 14pt;
        letter-spacing: 2px;
        background: #f0f0f0;
        padding: 0.1cm 0.3cm;
        border-radius: 5px;
    }
    
    .certificate-footer {
        margin-top: 0.5cm;
        padding-top: 0.3cm;
        border-top: 2px dashed #ffd700;
        font-size: 10pt;
    }
    
    .qr-code {
        width: 2cm;
        height: 2cm;
        margin: 0 auto;
    }
    
    /* ========================================
       تنسيقات التوقيعات
       ======================================== */
    .signature-area {
        display: flex;
        justify-content: space-between;
        margin-top: 1cm;
    }
    
    .signature-line {
        width: 200px;
        border-bottom: 2px solid #333;
        margin-bottom: 0.2cm;
    }
    
    .signature-text {
        font-size: 10pt;
        color: #666;
    }
    
    /* ========================================
       تنسيقات الفواتير
       ======================================== */
    .invoice {
        border: 1px solid #333;
        padding: 0.5cm;
    }
    
    .invoice-header {
        display: flex;
        justify-content: space-between;
        margin-bottom: 0.5cm;
    }
    
    .invoice-company {
        font-size: 18pt;
        font-weight: bold;
        color: #002b5c;
    }
    
    .invoice-title {
        font-size: 24pt;
        color: #ffd700;
    }
    
    .invoice-details {
        margin: 0.3cm 0;
    }
    
    .invoice-row {
        display: flex;
        justify-content: space-between;
        padding: 0.2cm 0;
        border-bottom: 1px dotted #ccc;
    }
    
    .invoice-total {
        font-size: 16pt;
        font-weight: bold;
        background: #f0f0f0;
        padding: 0.2cm;
        margin-top: 0.3cm;
    }
    
    /* ========================================
       تنسيقات كسر الصفحات
       ======================================== */
    .page-break {
        page-break-before: always;
        break-before: page;
    }
    
    .page-break-after {
        page-break-after: always;
        break-after: page;
    }
    
    .keep-together {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* ========================================
       تنسيقات خلفية الصفحة
       ======================================== */
    @page {
        size: A4;
        margin: 1.5cm;
        
        @top-center {
            content: "AUTO TESTER - المصرية لفحص السيارات";
            font-size: 9pt;
            color: #666;
        }
        
        @bottom-center {
            content: "الصفحة " counter(page) " من " counter(pages);
            font-size: 9pt;
            color: #666;
        }
    }
    
    /* ========================================
       تنسيقات خاصة بالصفحة الأولى
       ======================================== */
    @page :first {
        margin-top: 2cm;
        
        @top-center {
            content: "";
        }
    }
    
    /* ========================================
       تنسيقات الصفحات الزوجية والفردية
       ======================================== */
    @page :left {
        margin-left: 2cm;
        margin-right: 1.5cm;
    }
    
    @page :right {
        margin-left: 1.5cm;
        margin-right: 2cm;
    }
    
    /* ========================================
       تنسيقات الألوان في الطباعة
       ======================================== */
    .text-primary {
        color: #002b5c !important;
    }
    
    .text-secondary {
        color: #ffd700 !important;
    }
    
    .text-success {
        color: #28a745 !important;
    }
    
    .text-danger {
        color: #dc3545 !important;
    }
    
    .text-warning {
        color: #ffc107 !important;
    }
    
    .text-info {
        color: #17a2b8 !important;
    }
    
    /* ========================================
       تنسيقات الخلفيات في الطباعة
       ======================================== */
    .bg-primary,
    .bg-success,
    .bg-danger,
    .bg-warning,
    .bg-info {
        background: transparent !important;
        color: black !important;
    }
    
    /* ========================================
       تنسيقات الحدود في الطباعة
       ======================================== */
    .border {
        border: 1px solid #000 !important;
    }
    
    .border-primary {
        border: 1px solid #002b5c !important;
    }
    
    .border-secondary {
        border: 1px solid #ffd700 !important;
    }
    
    /* ========================================
       عناصر تظهر فقط في الطباعة
       ======================================== */
    .print-only {
        display: block !important;
    }
    
    .print-only-inline {
        display: inline !important;
    }
    
    .print-only-flex {
        display: flex !important;
    }
    
    /* ========================================
       عناصر تخفى في الطباعة
       ======================================== */
    .print-hide {
        display: none !important;
    }
}