<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Visitor Out Notification</title>
</head>
<body style="margin:0;padding:0;background:#ffffff;font-family:Arial,Helvetica,sans-serif;">

<table width="100%" cellpadding="0" cellspacing="0" style="background:#ffffff;">
    <tr>
        <td align="center">

            <table width="700" cellpadding="0" cellspacing="0" style="background:#ffffff;border:1px solid #e5e7eb;">

                <!-- Header -->
                <tr>
                    <td style="background:#0f766e;padding:20px;text-align:center;">
                        {{-- <h2 style="margin:0;color:#ffffff;">
                            Visitor Out Notification
                        </h2> --}}
                        <h2 style="margin:0;color:#ffffff;">
                            {{ $entry->type === 'InterUnitStaff'
                                ? 'Employee Out Notification'
                                : 'Visitor Out Notification'
                            }}
                        </h2>
                    </td>
                </tr>

                <!-- Content -->
                <tr>
                    <td style="padding:25px;">

                        <p style="margin-top:0;">
                            {!! $greeting !!}
                        </p>

                        <p>
                            A {{ $entry->type === 'InterUnitStaff' ? 'Employee' : 'Visitor' }} has checked out. Please find the details below:
                        </p>

                        <table width="100%" cellpadding="10" cellspacing="0"
                               style="border-collapse:collapse;margin-top:15px;">

                            <tr>
                                {{-- <td style="border:1px solid #d1d5db;width:30%;font-weight:bold;">
                                    Visitor Name
                                </td> --}}
                                <td style="border:1px solid #d1d5db;width:30%;font-weight:bold;">
                                    {{ $entry->type === 'InterUnitStaff' ? 'Employee Name' : 'Visitor Name' }}
                                </td>
                                <td style="border:1px solid #d1d5db;">
                                    {{ $entry?->name ?? '-' }}
                                </td>
                            </tr>

                            <tr>
                                <td style="border:1px solid #d1d5db;font-weight:bold;">
                                    Mobile Number
                                </td>
                                <td style="border:1px solid #d1d5db;">
                                    {{ $entry?->mobile_number ?? '-' }}
                                </td>
                            </tr>

                            <tr>
                                {{-- <td style="border:1px solid #d1d5db;font-weight:bold;">
                                    Company
                                </td> --}}
                                <td style="border:1px solid #d1d5db;font-weight:bold;">
                                    {{ $entry->type === 'InterUnitStaff' ? 'Unit' : 'Company' }}
                                </td>
                                <td style="border:1px solid #d1d5db;">
                                    {{ $entry?->company ?? '-' }}
                                </td>
                            </tr>

                            <tr>
                                <td style="border:1px solid #d1d5db;font-weight:bold;">
                                    Purpose of Visit
                                </td>
                                <td style="border:1px solid #d1d5db;">
                                    {{ $entry?->purpose_of_visit ?? '-' }}
                                </td>
                            </tr>

                            <tr>
                                <td style="border:1px solid #d1d5db;font-weight:bold;">
                                    No of Persons
                                </td>
                                <td style="border:1px solid #d1d5db;">
                                    {{ $entry?->number_of_person ?? '-' }}
                                </td>
                            </tr>

                            <tr>
                                <td style="border:1px solid #d1d5db;font-weight:bold;">
                                    Out Time
                                </td>
                                <td style="border:1px solid #d1d5db;">
                                    {{ $entry?->out_time?->format('d-m-Y h:i A') ?? '-' }}
                                </td>
                            </tr>

                        </table>

                        <br>

                        <p>
                            {!! $wishes !!}
                        </p>

                    </td>
                </tr>

                <!-- Footer -->
                <tr>
                    <td style="padding:15px;text-align:center;border-top:1px solid #e5e7eb;font-size:12px;color:#666;">
                        © {{ date('Y') }} {{ $company }}<br>
                        Visitor Management System
                    </td>
                </tr>

            </table>

        </td>
    </tr>
</table>

</body>
</html>
