@php
    $logo_1 = ltrim($images->gatepass_logo1 ?? '', '/');
    $logo_2 = ltrim($images->gatepass_logo2 ?? '', '/');
@endphp

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>KIA Receipt</title>
    <style>
       body {
            font-family: Arial, sans-serif;
            font-size: 14px;
            margin: 20px;
            display: flex;
            justify-content: center; /* center horizontally */
            background: #f5f5f5; /* subtle background to show boundaries */
            position: relative; /* just in case */
        }
        
        .receipt-box {
            border: 1px solid #000;
            padding: 20px;
            width: 800px;
            max-width: 90vw; /* responsive */
            background: #fff;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        .header {
            display: flex;
            justify-content: space-between;
        }
        .header img {
            height: 40px;
        }
        .company-details {
            text-align: left;
        }
        .receipt-no {
            color: red;
            font-weight: bold;
            font-size: 18px;
        }
        .section {
            margin-top: 15px;
            border: 1px solid #000;
            padding: 10px;
        }
        .section span {
            display: inline-block;
            min-width: 150px;
        }
        .line {
            border-bottom: 1px solid #000;
            margin: 5px 0;
        }
        .amount-box {
            border: 1px solid #000;
            padding: 5px;
            width: 150px;
            font-size: 18px;
            font-weight: normal;
        }
        .footer {
            display: flex;
            justify-content: space-between;
            margin-top: 20px;
        }
        .stamp {
            width: 100px;
            height: 100px;
            background: url('stamp-placeholder.png') no-repeat center center;
            background-size: contain;
        }
        .italic {
            font-style: italic;
            font-size: 12px;
        }

        /* Updated Print button style from your first snippet */
        .print-button {
            position: fixed;
            bottom: 120px;
            left: 50%;
            transform: translateX(-50%);
            padding: 7px 20px;
            font-size: 16px;
            background-color: #6f7b91;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
            transition: background-color 0.3s ease;
            z-index: 9999;
        }
        .print-button:hover {
            background-color: #0056b3;
        }

        /* Hide print button when printing */
        @media print {
            .print-button {
                display: none !important;
            }
        }
    </style>
</head>
<body>

<div class="receipt-box">
    <div class="header">
        <div style="display: flex; align-items: center; justify-content: space-between;">
        
        <div style="display: flex; flex-direction: column; align-items: center;">
          <img class="gp_logo" 
               src="{{ asset('uploads/global_configuration/gatepass_logo_one/' . $logo_1) }}" 
               alt="Left Logo" 
               style="height: 80px; width: 170px;">
          <span style="font-size: 15px; font-weight: normal; margin-top: 5px;">
              Movement that inspires
          </span>
        </div>
        
        <img class="gp_logo" 
             src="{{ asset('uploads/global_configuration/gatepass_logo_two/' . $logo_2) }}" 
             alt="Right Logo" 
             style="height: 100px; width: 150px;margin-left: 140px;">
        </div>

        <div class="company-details">
        <strong>
            <span style="
                font-size: 20px;
                display: inline-block;
                border-bottom: 3px solid black;
                width: 330px;">SHIVAM KIA</span>
        </strong><br>
        
        SAVAN IB AUTOMOTIVE PVT. LTD.<br>
        Plot No. 1, Survey No. 392, Meldi Mata Temple,<br>
        Jamnagar - Rajkot Highway, Hapa. Jamnagar - 361120.
        </div>
    </div>
    <p>____________________________________________________________________________________________________</p>
    <div class="section">
        <strong>Receipt No. JM(N) (Cash): ___________________________</strong><span class="receipt-no"></span><span style="float: right;"><strong>Date: {{ $data->date ?? '____________________' }}</span></strong>
    </div>

    <div class="section">
        <p>Received With Thanks From: {{ $data->seller_detail ?? '____________________' }}</p>
        <p>As Payment Towards Vehicle: _____________________________________________ Color: {{ $data->colour ?? '____________________' }}</p>
        <p>Vehicle Variant: {{ $data->variant ?? '____________________' }}</p>
        <p>For Vehicle / Accessories / Insurance / Registration:________________________________________________________</p>
        <p>HPA / HYPO With: {{ $data->HPA ?? '____________________' }}</p>
        <p>Amount in Words: {{ $data->amount_in_words ?? '____________________' }}</p>
    </div>

    <div class="footer">
        <div>
            <p>K.E.C.: {{ $data->sales_person_name ?? '____________________' }}</p>
            <div class="amount-box">Rs. {{ $data->amount ?? '____________________' }}</div>
            <p class="italic">*Subject to realization of cheque</p>
        </div>
        <div style="text-align: right;">
            <p>For, SAVAN IB AUTOMOTIVE PVT. LTD.</p>
            <div style="width: 120px; height: 120px;">
            </div>
        </div>
    </div>
</div>

<!-- Print Button -->
<button class="print-button" onclick="window.print()">Print</button>

</body>
</html>
