<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Urgent Overdue Payment Notice</title>
    <style>
        body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; margin: 0; padding: 0; background-color: #f4f4f4; }
        .container { max-width: 600px; margin: 20px auto; background: #ffffff; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.2); }
        .header { background: #D32F2F; color: #ffffff; padding: 30px; text-align: center; }
        .urgent-badge { background: #B71C1C; color: white; padding: 8px 20px; border-radius: 20px; display: inline-block; margin-bottom: 10px; font-weight: bold; animation: pulse 2s infinite; }
        @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
        .content { padding: 30px; }
        .invoice-details { background: #ffcdd2; padding: 20px; border-radius: 5px; margin: 20px 0; border: 2px solid #D32F2F; }
        .invoice-details table { width: 100%; }
        .invoice-details td { padding: 10px 0; }
        .invoice-details td:first-child { font-weight: bold; width: 40%; }
        .amount { font-size: 32px; color: #B71C1C; font-weight: bold; }
        .warning-box { background: #ffebee; border: 2px solid #D32F2F; padding: 20px; margin: 20px 0; border-radius: 5px; }
        .button { display: inline-block; padding: 18px 50px; background: #B71C1C; color: #ffffff; text-decoration: none; border-radius: 5px; margin: 20px 0; font-weight: bold; font-size: 16px; }
        .button:hover { background: #7f0000; }
        .consequences { background: #fff3e0; padding: 15px; margin: 20px 0; border-left: 4px solid #FF6F00; }
        .footer { background: #f4f4f4; padding: 20px; text-align: center; font-size: 12px; color: #666; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <span class="urgent-badge">🚨 URGENT - IMMEDIATE ACTION REQUIRED</span>
            <h1>Overdue Payment Notice</h1>
        </div>
        <div class="content">
            <p>Dear {{customer_name}},</p>
            
            <p><strong>This is our second notice regarding your seriously overdue invoice. Your account requires immediate attention.</strong></p>
            
            <div class="invoice-details">
                <table>
                    <tr>
                        <td>Invoice Number:</td>
                        <td><strong>{{invoice_number}}</strong></td>
                    </tr>
                    <tr>
                        <td>Amount Due:</td>
                        <td class="amount">{{currency_symbol}}{{amount_due}}</td>
                    </tr>
                    <tr>
                        <td>Original Due Date:</td>
                        <td><strong>{{due_date}}</strong></td>
                    </tr>
                    <tr>
                        <td>Days Overdue:</td>
                        <td><strong style="color: #B71C1C; font-size: 18px;">{{days_overdue}} days</strong></td>
                    </tr>
                    <tr>
                        <td>Late Fees:</td>
                        <td><strong style="color: #D32F2F;">{{currency_symbol}}{{late_fees}}</strong></td>
                    </tr>
                    <tr>
                        <td>Total Now Due:</td>
                        <td class="amount">{{currency_symbol}}{{total_with_fees}}</td>
                    </tr>
                </table>
            </div>
            
            <div class="warning-box">
                <h3 style="margin-top: 0; color: #D32F2F;">⚠️ URGENT NOTICE</h3>
                <p>Payment must be received within 48 hours to avoid:</p>
                <ul>
                    <li>Additional late fees</li>
                    <li>Service suspension</li>
                    <li>Collection agency referral</li>
                    <li>Credit reporting</li>
                </ul>
            </div>
            
            <p><strong>This is your final opportunity to resolve this matter before escalation.</strong></p>
            
            <center>
                <a href="{{payment_link}}" class="button">PAY IMMEDIATELY</a>
            </center>
            
            <div class="consequences">
                <strong>If payment is not received:</strong> Your account will be placed on hold, and we will be forced to pursue collection through legal means.
            </div>
            
            <p>If you have already made payment, please provide proof of payment immediately by replying to this email or calling us.</p>
            
            <p>If you are experiencing financial difficulties, contact us TODAY to arrange a payment plan. We must hear from you within 48 hours.</p>
            
            <p>Accounts Department<br>
            {{company_name}}<br>
            {{company_phone}}<br>
            {{company_email}}</p>
        </div>
        <div class="footer">
            <p>This is an official notice. Immediate action is required.</p>
            <p><a href="{{opt_out_link}}">Opt out of payment reminders</a></p>
        </div>
    </div>
    <img src="{{tracking_pixel_url}}" width="1" height="1" alt="" />
</body>
</html>