/* ========================================================
   EasyLetter Enterprise Master Production Stylesheet
   Optimized for OpenLiteSpeed (High-Performance Static Delivery)
   ======================================================== */

/* 1. Typography & Web Fonts (Self-Hosted Fallback + System Stack) */
@font-face {
    font-family: 'Vazirmatn';
    src: local('Vazirmatn'), local('Vazir'),
         url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn[wght].woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --font-primary: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --brand-primary: #2563eb;
    --brand-dark: #0f172a;
}

body {
    font-family: var(--font-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 2. Keyframe Animations */
@keyframes stamp {
    0% {
        opacity: 0;
        transform: scale(3) rotate(-15deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.9) rotate(-3deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(-5deg);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scanLaser {
    0%, 100% { top: 0%; opacity: 0.8; }
    50% { top: 96%; opacity: 1; }
}

.animate-stamp {
    animation: stamp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.animate-fade-in {
    animation: fadeIn 0.25s ease-out forwards;
}

.animate-slide-down {
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scan-laser {
    animation: scanLaser 2.2s ease-in-out infinite;
}

/* 3. Official A4 Letter Print Engine (@media print) */
@media print {
    @page {
        size: A4 portrait;
        margin: 15mm 15mm 15mm 15mm;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
        line-height: 1.8 !important;
    }

    /* Hide Navigation, Sidebar, Modals, Action Buttons */
    header, nav, aside, footer,
    button, .no-print, [role="dialog"],
    .toolbar, .btn-action, .modal-backdrop {
        display: none !important;
    }

    /* Expand letter sheet to full printable width */
    .print-sheet, .letter-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Keep signature seal and canvas together */
    .signature-block, .stamp-container {
        page-break-inside: avoid !important;
    }

    /* High-contrast text for monochrome printers */
    h1, h2, h3, p, span, td, th {
        color: #000000 !important;
    }

    a {
        text-decoration: none !important;
        color: #000000 !important;
    }
}

/* 4. Rich Text Editor Styling (Word-like Experience) */
.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.rich-content th, .rich-content td {
    border: 1px solid #cbd5e1;
    padding: 0.5rem 0.75rem;
    text-align: right;
}

.rich-content th {
    background-color: #f1f5f9;
    font-weight: 700;
}

.rich-content blockquote {
    border-right: 4px solid #3b82f6;
    padding-right: 1rem;
    margin: 1rem 0;
    color: #475569;
    font-style: italic;
}
