<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <style>
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
        }
        .header {
            background-color: #dc2626;
            color: white;
            padding: 20px;
            text-align: center;
            border-radius: 5px;
        }
        .content {
            background-color: #f9fafb;
            padding: 20px;
            margin-top: 20px;
            border-radius: 5px;
        }
        .invoice-details {
            background-color: white;
            padding: 15px;
            margin: 15px 0;
            border-left: 4px solid #dc2626;
        }
        .invoice-details table {
            width: 100%;
            border-collapse: collapse;
        }
        .invoice-details td {
            padding: 8px 0;
        }
        .invoice-details td:first-child {
            font-weight: bold;
            width: 40%;
        }
        .button {
            display: inline-block;
            padding: 12px 24px;
            background-color: #3b82f6;
            color: white;
            text-decoration: none;
            border-radius: 5px;
            margin-top: 15px;
        }
        .footer {
            text-align: center;
            color: #6b7280;
            font-size: 12px;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #e5e7eb;
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>⚠️ {{ _('Invoice Overdue') }}</h1>
    </div>
    
    <div class="content">
        <p>Hello {{ user.display_name }},</p>
        
        <p>This is a notification that <strong>Invoice {{ invoice.invoice_number }}</strong> is now <strong>{{ days_overdue }} days overdue</strong>.</p>
        
        <div class="invoice-details">
            <table>
                <tr>
                    <td>Invoice Number:</td>
                    <td>{{ invoice.invoice_number }}</td>
                </tr>
                <tr>
                    <td>Client:</td>
                    <td>{{ invoice.client_name }}</td>
                </tr>
                <tr>
                    <td>Amount:</td>
                    <td>{{ invoice.currency_code }} {{ invoice.total_amount }}</td>
                </tr>
                <tr>
                    <td>Due Date:</td>
                    <td>{{ invoice.due_date }}</td>
                </tr>
                <tr>
                    <td>Days Overdue:</td>
                    <td><strong>{{ days_overdue }}</strong></td>
                </tr>
                <tr>
                    <td>Status:</td>
                    <td>{{ invoice.status|upper }}</td>
                </tr>
            </table>
        </div>
        
        <p><strong>Recommended Action:</strong> Please follow up with the client or update the invoice status if payment has been received.</p>
        
        <center>
            <a href="{{ url_for('invoices.view_invoice', invoice_id=invoice.id, _external=True) }}" class="button">
                {{ _('View Invoice') }}
            </a>
        </center>
    </div>
    
    <div class="footer">
        <p>TimeTracker - Time Tracking & Project Management</p>
        <p>This is an automated notification. To manage your notification preferences, visit your user settings.</p>
    </div>
</body>
</html>

