/* Explain: Styles for reusable UI components and print styles. */
.tech-glow {
    box-shadow: var(--neon-glow);
    transition: all 0.3s ease;
}

.tech-glow:hover {
    box-shadow: 0 6px 20px rgba(15, 40, 98, 0.15);
    border-color: var(--primary-color);
}

.tech-text-glow {
    text-shadow: none; /* إزالة التوهج في النسخة الفاتحة */
}

.nav-link {
    position: relative;
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    right: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
    left: 0;
    right: auto;
}

.print-header {
    display: none !important;
}

@media print {
    @page {
        size: A4;
        margin: 1.5cm;
    }
    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        background: white !important;
    }
    .print-header {
        display: flex !important;
        break-after: avoid;
        page-break-after: avoid;
        margin-bottom: 2rem !important;
    }
    /* إخفاء جميع محتويات الصفحة باستثناء النافذة المفتوحة لضمان تدفق الطباعة عبر عدة صفحات */
    body > header, body > footer, main > section:not(:has(dialog[open])) {
        display: none !important;
    }
    section:has(dialog[open]) > *:not(dialog) {
        display: none !important;
    }
    
    body, html, main, section {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    dialog[open] {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        inset: auto !important;
    }
    dialog[open] .modal-box {
        position: relative !important;
        display: block !important;
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
    }
    dialog[open] .modal-backdrop {
        display: none !important;
    }
    .no-print, .no-print * {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* منع تقطيع الجداول والنصوص عند الانتقال لصفحة جديدة */
    table, tr, .bg-\[var\(--surface-color\)\] {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        break-after: avoid;
    }
    
    /* إظهار الجداول بالكامل وإلغاء شريط التمرير الأفقي في الطباعة */
    .overflow-x-auto {
        overflow: visible !important;
    }
    
    /* إجبار ظهور جميع التبويبات (للشروط والوثائق) عند الطباعة للحصول على مستند كامل */
    dialog[open] [style*="display: none"],
    dialog[open] [x-show] {
        display: block !important;
    }
    dialog[open] .flex-col[style*="display: none"],
    dialog[open] .flex-col[x-show] {
        display: flex !important;
    }
    dialog[open] .grid[x-show] {
        display: grid !important;
    }
}