<!DOCTYPE html>
<html>
<head>
    <title>Payment Reminder</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <div class="container">
        <div class="card mt-4">
            <div class="card-header bg-warning">
                <h4 class="mb-0">Payment Reminder</h4>
            </div>
            <div class="card-body">
                <p>Dear {{ $client->full_name }},</p>

                <p>This is a reminder for your upcoming loan payment:</p>

                <table class="table table-bordered">
                    <tr>
                        <th>Loan ID:</th>
                        <td>{{ $loan->id }}</td>
                    </tr>
                    <tr>
                        <th>Due Date:</th>
                        <td>{{ $repayment ? $repayment->due_date->format('F d, Y') : 'N/A' }}</td>
                    </tr>
                    <tr>
                        <th>Amount Due:</th>
                        <td>${{ $repayment ? number_format($repayment->amount, 2) : 'N/A' }}</td>
                    </tr>
                    <tr>
                        <th>Remaining Balance:</th>
                        <td>${{ number_format($loan->outstanding_balance, 2) }}</td>
                    </tr>
                </table>

                <p>Please make your payment before the due date to avoid penalties.</p>

                <a href="{{ route('loan.payment', $loan->id) }}"
                   class="btn btn-primary">
                    Make Payment
                </a>

                <hr>
                <p class="text-muted">
                    If you have already made this payment, please ignore this message.
                </p>
            </div>
        </div>
    </div>
</body>
</html>
