<style>
    .form-header {
        background-color: #f8f9fa;
        border-bottom: 2px solid #dee2e6;
        padding: 15px 0;
        margin-bottom: 20px;
    }
    .form-title {
        font-size: 1.5rem;
        font-weight: bold;
        text-align: center;
        color: #0d6efd;
    }
    .form-subtitle {
        font-size: 1.1rem;
        text-align: center;
    }
    .table-custom {
        font-size: 0.9rem;
    }
    .table-custom th {
        background-color: #0d6efd;
        color: white;
        text-align: center;
        vertical-align: middle;
    }
    .table-custom td {
        vertical-align: middle;
    }
    .total-row {
        font-weight: bold;
        background-color: #f8f9fa;
    }

    .footer {
        margin-top: 20px;
        display: flex;
        justify-content: space-around;
        padding: 0 10px;
    }

    .table-custom,
    table,
    th,
    td {
        font-size: 16px !important;
        font-family: 'Shruti', 'Arial Unicode MS', sans-serif;
    }


    @media print {
        @page {
            margin: 10mm;
        }

        .print-header {
            display: flex;
            justify-content: space-between;
            font-size: 16px;
            margin-bottom: 10px;
            font-family: 'Shruti', 'Arial Unicode MS', sans-serif;
        }

        .table-responsive {
            overflow: visible !important;
            width: 100% !important;
        }

        .last-note{
            /*width: 150px;*/
        }

        table, th, td {
            padding: 5px;
            text-align: center !important;
            vertical-align: middle !important;
        }

        table {
            /*            width: 100% !important;
                        border-collapse: collapse !important;
                        table-layout: auto;*/
            font-size: 20px !important;
            font-family: 'Shruti', 'Arial Unicode MS', sans-serif;
        }
    }
</style>

<div class="col-lg-12 table-responsive">
    <!--<div class="mt-4 mb-5" style="border: 1px solid black;margin: 5px">-->
        <div class="mt-4 mb-5" style="margin: 5px">
        <div class="form-header">
            <div class="form-title" style="font-family: 'Shruti', 'Arial Unicode MS', sans-serif;">PVTGs Villages Data - {{ taluka_name }}, જિલ્લો - {{ district_name }}</div>
        </div>

        <div class="table-responsive" style="font-family: 'Shruti', 'Arial Unicode MS', sans-serif;">
            <table class="table table-bordered" style="border-collapse: collapse">
                <thead style="font-weight: bold;">
                    <tr>
                        <th style="border: 1px solid black">S.NO</th>
<!--                        <th style="border: 1px solid black">District</th>
                        <th style="border: 1px solid black">Taluka</th>-->
                        <th style="border: 1px solid black">Village</th>
                        <th style="border: 1px solid black">Grampanchayat/ Village Council</th>
                        <th style="border: 1px solid black">Revenue Village Name</th>
                        <th style="border: 1px solid black">PVTG Hamlet/ Habitation name</th>
                        <th style="border: 1px solid black">PVTG Name</th>
                        <th style="border: 1px solid black">Total population</th>
                        <!--<th style="border: 1px solid black">Total number of Households (HH)</th>-->
                        <th style="border: 1px solid black">PVTG Population</th>
                        <th style="border: 1px solid black">Number of PVTG HHs</th>
                        <th style="border: 1px solid black;">કાચા ઘરો</th>
                        <th style="border: 1px solid black;">રેશના કાર્ડ બાકી</th>
                        <th style="border: 1px solid black;">આધાર કાર્ડ બાકી</th>
                        <th style="border: 1px solid black;">પી.એમ. જય કાર્ડ બાકી</th>
                        <th style="border: 1px solid black;">વિજળીકરણ નથી</th>
                        <th style="border: 1px solid black;">મનરેગા કાર્ડ નથી</th>
                        <th style="border: 1px solid black;">ટોઇલેટ નથી</th>
                        <th style="border: 1px solid black;">પીવાના પાણીની સુવિધા નથી.</th>
                        <th style="border: 1px solid black;">જનધન ખાતુ નથી.</th>
                        <th style="border: 1px solid black;">જાતિનો દાખલો નથી.</th>
                        <th style="border: 1px solid black;">ઉજ્જવલા યોજના લાભ મળેલ નથી.</th>
                        <!--<th style="border: 1px solid black;">પીએમ કિસાન સન્માન નિધિ લાભ મળેલ નથી.</th>-->
                    </tr>
                </thead>
                <tbody style="border: 1px solid black">

                    {% for row in result %}
                    <tr style="border: 1px solid black">
                        <td style="border: 1px solid black">{{ loop.index }}</td>
<!--                        <td style="border: 1px solid black">{{ row.district }}</td>
                        <td style="border: 1px solid black">{{ row.taluka_name }}</td>-->
                        <td style="font-weight: bold;border: 1px solid black">{{ row.village_name }}</td>
                        <td style="border: 1px solid black">{{ row.gram_panchayat_name }}</td>
                        <td style="border: 1px solid black">{{ row.revenue_village_name }}</td>
                        <td style="border: 1px solid black">{{ row.faliya_name }}</td>
                        <td style="border: 1px solid black">{{ row.pvtg_name }}</td>
                        <td style="border: 1px solid black">{{ row.total_population }}</td>                        
                        <td style="border: 1px solid black">{{ row.pvtg_population }}</td>
                        <td style="border: 1px solid black">{{ row.pvtgs_hhs }}</td>
                        <td style="border: 1px solid black">{{ row.kachcha_house_count }}</td>
                        <td style="border: 1px solid black">{{ row.no_ration_card_count }}</td>
                        <td style="border: 1px solid black">{{ row.no_aadhaar_card_count }}</td>
                        <td style="border: 1px solid black">{{ row.no_pmjay_card_count }}</td>
                        <td style="border: 1px solid black">{{ row.no_electricity_available_count }}</td>
                        <td style="border: 1px solid black">{{ row.no_mgnrega_job_card_yes_count }}</td>
                        <td style="border: 1px solid black">{{ row.no_toilet_count }}</td>
                        <td style="border: 1px solid black">{{ row.poor_water_source_count }}</td>
                        <td style="border: 1px solid black">{{ row.has_no_jandhan_account_count }}</td>
                        <td style="border: 1px solid black">{{ row.has_no_caste_certificate_count }}</td>
                        <td style="border: 1px solid black">{{ row.has_no_ujjwala_yojana_count }}</td>
                        <!--<td style="border: 1px solid black">{{ row.has_pm_kisan_yojana_count }}</td>-->
                    </tr>
                    {% endfor %}

                    {% for row1 in result_total %}
                    <tr style="font-weight: bold; background-color: #f0f0f0;border: 1px solid black">
                        <td style="border: 1px solid black" colspan="6"></td>
                        <!--<td style="border: 1px solid black">{{ row1.village_name }}</td>-->
                        <td style="border: 1px solid black">{{ row1.total_population }}</td>
                        <td style="border: 1px solid black">{{ row1.pvtg_population }}</td>
                        <td style="border: 1px solid black">{{ row1.pvtgs_hhs }}</td>
                        <td style="border: 1px solid black">{{ row1.kachcha_house_count }}</td>
                        <td style="border: 1px solid black">{{ row1.no_ration_card_count }}</td>
                        <td style="border: 1px solid black">{{ row1.no_aadhaar_card_count }}</td>
                        <td style="border: 1px solid black">{{ row1.no_pmjay_card_count }}</td>
                        <td style="border: 1px solid black">{{ row1.no_electricity_available_count }}</td>
                        <td style="border: 1px solid black">{{ row1.no_mgnrega_job_card_yes_count }}</td>
                        <td style="border: 1px solid black">{{ row1.no_toilet_count }}</td>
                        <td style="border: 1px solid black">{{ row1.poor_water_source_count }}</td>
                        <td style="border: 1px solid black">{{ row1.has_no_jandhan_account_count }}</td>
                        <td style="border: 1px solid black">{{ row1.has_no_caste_certificate_count }}</td>
                        <td style="border: 1px solid black">{{ row1.has_no_ujjwala_yojana_count }}</td>
                        <!--<td style="border: 1px solid black">{{ row1.has_pm_kisan_yojana_count }}</td>-->
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>