<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Savings Deposit Report</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            font-size: 12px;
            line-height: 1.4;
            margin: 20px;
        }
        .header {
            text-align: center;
            margin-bottom: 30px;
            border-bottom: 2px solid #333;
            padding-bottom: 10px;
        }
        .header h1 {
            margin: 0;
            font-size: 24px;
            color: #333;
        }
        .header p {
            margin: 5px 0;
            color: #666;
        }
        .receipt-details {
            margin-bottom: 30px;
        }
        .detail-row {
            display: flex;
            margin-bottom: 10px;
        }
        .detail-label {
            font-weight: bold;
            width: 150px;
            flex-shrink: 0;
        }
        .detail-value {
            flex: 1;
        }
        .amount-highlight {
            font-size: 18px;
            font-weight: bold;
            color: #198754;
            text-align: center;
            margin: 20px 0;
            padding: 10px;
            border: 2px solid #198754;
            border-radius: 5px;
        }
        .footer {
            margin-top: 30px;
            text-align: center;
            font-size: 10px;
            color: #666;
            border-top: 1px solid #ddd;
            padding-top: 10px;
        }
        @media print {
            body { margin: 0; }
            .no-print { display: none; }
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>Savings Deposit Report</h1>
        <p>Transaction Report</p>
        <p>Generated on {{ now()->format('F d, Y H:i') }}</p>
    </div>

    <div class="receipt-details">
        <div class="detail-row">
            <div class="detail-label">Transaction Number:</div>
            <div class="detail-value">{{ $deposit->transaction_number }}</div>
        </div>

        <div class="detail-row">
            <div class="detail-label">Client Name:</div>
            <div class="detail-value">{{ $deposit->savingsAccount->client->full_name }}</div>
        </div>

        <div class="detail-row">
            <div class="detail-label">Account Number:</div>
            <div class="detail-value">{{ $deposit->savingsAccount->account_number }}</div>
        </div>

        <div class="detail-row">
            <div class="detail-label">Transaction Date:</div>
            <div class="detail-value">{{ $deposit->transaction_date->format('F d, Y') }}</div>
        </div>

        <div class="detail-row">
            <div class="detail-label">Payment Method:</div>
            <div class="detail-value">{{ ucfirst($deposit->payment_method ?? 'N/A') }}</div>
        </div>

        <div class="detail-row">
            <div class="detail-label">Reference Number:</div>
            <div class="detail-value">{{ $deposit->reference_number ?? 'N/A' }}</div>
        </div>

        <div class="detail-row">
            <div class="detail-label">Description:</div>
            <div class="detail-value">{{ $deposit->description ?? 'N/A' }}</div>
        </div>

        <div class="detail-row">
            <div class="detail-label">Processed By:</div>
            <div class="detail-value">{{ $deposit->creator->name ?? 'N/A' }}</div>
        </div>

        <div class="detail-row">
            <div class="detail-label">Balance Before:</div>
            <div class="detail-value">USD {{ number_format($deposit->balance_before, 2) }}</div>
        </div>

        <div class="detail-row">
            <div class="detail-label">Balance After:</div>
            <div class="detail-value">USD {{ number_format($deposit->balance_after, 2) }}</div>
        </div>
    </div>

    <div class="amount-highlight">
        Deposit Amount: USD {{ number_format($deposit->amount, 2) }}
    </div>

    <div class="footer">
        <p>This is an official receipt from Credora System</p>
        <p>© {{ date('Y') }} All rights reserved</p>
    </div>
</body>
</html>
