<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Guarantee Letter {{ $member->full_name }}</title>

    {{-- <link rel="stylesheet" href="{{ asset('css/app.css') }}"> --}}

    <style>
        /* @font-face {
            font-family: Public Sans;
            src: url('{{asset('fonts/PublicSans-Medium.ttf')}}');
            src: url('{{asset('fonts/PublicSans-Medium.ttf')}}') format('truetype');
        } */

        body {
            font-family: 'Public Sans';
            color: #404040;
            font-size: 20px;
        }

        .text-sm {
            font-size: 18px;
        }
        .text-md {
            font-size: 20px;
        }
        .text-lg {
            font-size: 22px;
        }
        .text-gray {
            color: #919EAB;
        }

        #member-detail{
            
        }
        #member-detail td {
            width: 50%;
            padding: 10px 0px;
        }
        #member-detail td>div{
            margin-bottom: 5px;
        }

        .benefit-table-wrapper {
            border: 1px solid #E0E0E0;
            border-radius: 5px;
            overflow: hidden;
        }
        #benefit-table {
            width: 100%;
            border-collapse: collapse;
        }

        #benefit-table th, #benefit-table th {
            width: 50%;
        }

        #benefit-table th{
            font-size: 20px;
            font-weight: 400;
            padding: 15px;
            text-align: left;
        }

        #benefit-table tr:first-child {
            background: #F5F5F5;
            border-bottom: 1px solid #E0E0E0;
        }

        #benefit-table td {
            padding: 15px;
            font-size: 20px;
        }
    </style>
</head>
<body>
    <table style="width: 100%;">
        <tr>
            <td rowspan="4" style="width: 110px;">
                <img src="{{public_path('images/logo-linksehat-vertical-default.png')}}" width="100px">
            </td>
        </tr>

        <tr>
            <td class="text-lg">PT. Link Medis Sehat</td>
        </tr>
        <tr>
            <td class="text-sm"><span style="margin-bottom: 5px;">Graha Cempaka Mas Blok D/20<br >
                Jl. Let. Jend. Suprapto, Jakarta Pusat 10640</span><br/>
                <span>Whatsapp : +62 858-9000-8500</span> | <span>E-mail : helpdesk@linksehat.com</span>
            </td>
        </tr>
    </table>

    <table id="member-detail" style="margin-top: 20px; width: 100%;">
        <tr>
            <td><span style="color: #1890FF">GUARANTEE OF PAYMENT</span></td>
        </tr>

        <tr>
            <td>
                <div class="text-sm text-gray">Name of Patient</div>
                <div class="text-md">{{ $member->full_name }}</div>
            </td>
            <td>
                <div class="text-sm text-gray">Member ID</div>
                <div class="text-md">{{ $member->member_id }}</div>
            </td>
        </tr>

        <tr>
            <td>
                <div class="text-sm text-gray">Date of Birth</div>
                <div class="text-md">{{ \Carbon\Carbon::parse($member->birth_date)->format('d/m/Y') }}</div>
            </td>
            <td>
                <div class="text-sm text-gray">Policy Number</div>
                <div class="text-md">{{ $member->currentPolicy->code ?? '' }}</div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="text-sm text-gray">Date of Admission</div>
                @if (isset($requestLog))
                <div class="text-md">{{ !empty($requestLog->submission_date) ? \Carbon\Carbon::parse($requestLog->submission_date)->format('d/m/Y') : now()->format('d/m/Y') }}</div>
                @else
                    <div class="text-md">{{ $dateOfAdmission->format('d/m/Y') }}</div>
                @endif
            </td>
            <td>
                <div class="text-sm text-gray">Plan</div>
                <div class="text-md">{{ $member->currentPlan->code ?? '' }}</div>
            </td>
        </tr>
    </table>

    <div class="benefit-table-wrapper">
        <table id="benefit-table">
            <tr>
                <th class="text-lg" style="font-weight: 600">Detail Benefit</th>
                <!-- <th class="text-lg" style="font-weight: 600">Limit</th> -->
            </tr>

            
            {{-- <tr>
                <td class="text-lg">Medical Check Up</td>
                <td class="text-lg">As Charged</td>
            </tr> --}}
            @if ($member->currentPlan)
                @foreach ($member->currentPlan->corporateBenefits as $corporateBenefit)
                
                    <tr>
                        <td>{{ @$corporateBenefit->benefit->description ?? '' }}</td>
                        
                    </tr>
                @endforeach
            @endif
        </table>
    </div>

    <div class="benefit-table-wrapper"  style="margin-top: 20px; width: 100%;">
        <table id="benefit-table">
            <tr>
                <th class="text-lg" style="font-weight: 600">Term on Condition</th>
                <!-- <th class="text-lg" style="font-weight: 600">Limit</th> -->
            </tr>

            @if ($member->currentPlan)
                @foreach ($member->currentPlan->corporateBenefits as $corporateBenefit)
                
                    <tr>
                        <td>{{ @$corporateBenefit->benefit->description ?? '' }}</td>
                        
                    </tr>
                @endforeach
            @endif
        </table>
    </div>

    <div style="width: 100%; text-align: right; font-size: 10px; color: #777; margin-top: 20px;"><span style="padding: 15px;">Generated by Primecenter Linksehat at {{ now() }}</span></div>
</body>
</html>