<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>Chit Payment Receipt</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            color: #333;
            line-height: 1.6;
            background: #fff;
        }
        
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            background: #fff;
        }
        
        .header {
            text-align: center;
            margin-bottom: 30px;
            border-bottom: 2px solid #4a5568;
            padding-bottom: 20px;
        }
        
        .logo-title-container {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .logo {
            width: 60px;
            height: 60px;
            margin-right: 15px;
        }
        
        .company-name {
            font-size: 28px;
            color: #2d3748;
            margin: 0 0 10px 0;
        }
        
        .receipt-title {
            font-size: 20px;
            color: #4a5568;
            margin: 10px 0;
        }
        
        .receipt-details {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin: 20px 0;
        }
        
        .detail-box {
            background: #f8f9fa;
            padding: 15px;
            border-radius: 8px;
        }
        
        .detail-box h3 {
            color: #4a5568;
            margin: 0 0 10px 0;
            font-size: 16px;
        }
        
        .detail-row {
            display: flex;
            justify-content: space-between;
            margin: 5px 0;
        }
        
        .payment-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 15px;
            table-layout: fixed;
        }
        
        .payment-table th {
            background: #4a5568;
            color: white;
            padding: 12px;
            text-align: left;
            font-weight: bold;
        }
        
        .payment-table td {
            padding: 12px;
            border-bottom: 1px solid #ddd;
            color: #000;
            width: 33.33%;
        }
        
        .payment-table th.amount {
            text-align: center;
            /* Center align the Amount header */
        }
        
        .amount {
            text-align: right;
            font-family: monospace;
            color: #000;
            font-weight: 600;
            padding-right: 40px;
        }
        
        .footer {
            margin-top: 40px;
            text-align: center;
            border-top: 1px solid #ddd;
            padding-top: 20px;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="header">
            <div class="logo-title-container">
                <img src="{{logoUrl}}" alt="Logo" class="logo">
                <div class="title-text">
                    <h1 class="company-name">ROYAAL CRACKERS</h1>
                    <p>
                        Viswanatham, Sivakasi - 626 189</p>
                    <h2 class="receipt-title">CHIT PAYMENT RECEIPT</h2>
                </div>
            </div>
        </div>

        <div class="receipt-details">
            <div class="detail-box">
                <h3>CUSTOMER DETAILS</h3>
                <div class="detail-row">
                    <span>Chit ID:</span>
                    <span>{{chitId}}</span>
                </div>
                <div class="detail-row">
                    <span>Name:</span>
                    <span>{{customerName}}</span>
                </div>
                <div class="detail-row">
                    <span>Mobile:</span>
                    <span>{{customerMobile}}</span>
                </div>
                <div class="detail-row">
                    <span>Join Date:</span>
                    <span>{{joinDate}}</span>
                </div>
            </div>

            <div class="detail-box">
                <h3>SCHEME DETAILS</h3>
                <div class="detail-row">
                    <span>Scheme Plan:</span>
                    <span>{{schemePlan}}</span>
                </div>
                <div class="detail-row">
                    <span>Monthly Amount:</span>
                    <span>₹{{monthlyAmount}}</span>
                </div>
            </div>
        </div>

        <table class="payment-table">
            <thead>
                <tr>
                    <th style="width: 33.33%">Payment Date</th>
                    <th style="width:33.33%">Month</th>
                    <th style="width:33.33%" class="amount">Amount</th>
                </tr>
            </thead>
            <tbody>
                {{#payments}}
                <tr>
                    <td>{{paymentDate}}</td>
                    <td>{{month}}</td>
                    <td class="amount">₹{{amount}}</td>
                </tr>
                {{/payments}}
            </tbody>
        </table>

        <div class="footer">
            <p>Keep this receipt as proof of your payment</p>
        </div>
    </div>
</body>

</html>