@extends('layouts.app')
@section('title', 'Admission Form')

@section('content')
<style>
    .report-container {
        width: 800px;
        margin: 0 auto;
        padding: 30px;
        font-family: Arial, sans-serif;
        background: #fff;
        /* border: 1px solid #ddd; */
        color: #000; /* Ensure all text is black */
    }

    .header {
        text-align: center;
        margin-bottom: 20px;
        color: #000;
    }

    .header h2 {
        margin: 0;
        font-size: 28px;
        font-weight: bold;
        color: #000;
    }

    .header p {
        margin: 2px;
        font-size: 14px;
        color: #000;
    }

    .form-title {
        text-align: center;
        font-size: 20px;
        font-weight: bold;
        margin: 30px 0 10px;
        text-decoration: underline;
        color: #000;
    }

    table.info-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
        font-size: 14px;
        color: #000;
    }

    .info-table td {
        padding: 8px 6px;
        vertical-align: top;
        color: #000;
    }

    .info-table td.labels {
        font-weight: bold;
        width: 180px;
        color: #000;
    }

    .photo-box {
        width: 130px;
        height: 160px;
        border: 2px solid #000;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 12px;
        margin-left: auto;
        color: #000;
    }

    .declaration {
        margin-top: 40px;
        font-size: 14px;
        color: #000;
    }

    .signatures {
        margin-top: 60px;
        display: flex;
        justify-content: space-between;
        font-size: 14px;
        color: #000;
    }

    .sign-line {
        width: 45%;
        border-top: 1px solid #000;
        text-align: center;
        padding-top: 4px;
        color: #000;
    }

    @media print {
        .no-print {
            display: none;
        }
    }
</style>

<div class="report-container">
    <div class="header">
        <h2>TITAN FITNESS CENTER</h2>
        <p>AS Tower, Beside Mimi Super Market, HillView R/A, Probortok Circle, Panchlaish, , Chittagong, Bangladesh</p>
        <p>Phone: +01853-426222</p>
    </div>

    <div class="form-title">Admission Form</div>

    <table class="info-table">
        <tr>
            <td class="labels">Member ID:</td>
            <td style="border-bottom:1px solid black;">{{ $contact->contact_id }}</td>
            <td rowspan="6" style="text-align: right;">
                <div class="photo-box">
                    @if(!empty($contact->profile_image) && file_exists(public_path('images/' . $contact->profile_image)))
                        <img src="{{ asset('images/' . $contact->profile_image) }}" alt="Profile Image" style="max-width: 100%; max-height: 100%;">
                    @else
                        <span>Photo<br>Here</span>
                    @endif
                </div>
            </td>
        </tr>
        <tr>
            <td class="labels">Full Name:</td>
            <td style="border-bottom:1px solid black;">{{ $contact->name }}</td>
        </tr>
        <tr>
            <td class="labels">Address:</td>
            <td style="border-bottom:1px solid black;">{{ $contact->address_line_1 }} {{ $contact->address_line_2 }}</td>
        </tr>
        <tr>
            <td class="labels">Contact Number:</td>
            <td style="border-bottom:1px solid black;">{{ $contact->mobile }}</td>
        </tr>
        <tr>
            <td class="labels">Family Number:</td>
            <td style="border-bottom:1px solid black;">{{ $contact->alternate_number }}</td>
        </tr>
        <tr>
            <td class="labels">Email:</td>
            <td style="border-bottom:1px solid black;">{{ $contact->email }}</td>
        </tr>
        <tr>
            <td class="labels">Birth Date:</td>
            <td style="border-bottom:1px solid black;">{{ \Carbon\Carbon::parse($contact->dob)->format('Y-m-d') ?? '' }}</td>
        </tr>
        <tr>
            <td class="labels">Date of Admission:</td>
            <td style="border-bottom:1px solid black;">{{ \Carbon\Carbon::parse($contact->custom_field9)->format('Y-m-d') }}</td>
        </tr>
        <tr>
            <td class="labels">Membership Type:</td>
            <td style="border-bottom:1px solid black;">{{ $contact->custom_field1 }}</td>
        </tr>
        <tr>
            <td class="labels">Membership Start:</td>
            <td style="border-bottom:1px solid black;">{{ $contact->custom_field3 }}</td>
        </tr>
        <tr>
            <td class="labels">Membership Expiry:</td>
            <td style="border-bottom:1px solid black;">{{ $contact->custom_field4 }}</td>
        </tr>
        <tr>
            <td class="labels">Blood Group:</td>
            <td style="border-bottom:1px solid black;">{{ $contact->custom_field7 }}</td>
        </tr>
        <tr>
            <td class="labels">Member Group:</td>
            <td style="border-bottom:1px solid black;">{{ $contact->group_name }}</td>
        </tr>
        <tr>
            <td class="labels">Health Status:</td>
            <td style="border-bottom:1px solid black;">{{ $contact->custom_field6 }}</td>
        </tr>
        <tr>
            <td class="labels">NID Number:</td>
            <td style="border-bottom:1px solid black;">{{ $contact->custom_field8 }}</td>
        </tr>
        <tr>
            <td class="labels">Admitted By:</td>
            <td></td>
        </tr>
    </table>

    <div class="declaration">
        <p>
            I hereby agree to follow all the rules and regulations of this gym and I confirm that all the information provided is true.
        </p>
    </div>

    <div class="signatures">
        <div class="sign-line">Member Signature</div>
        <div class="sign-line">On Behalf of GYM</div>
    </div>
</div>

<div class="no-print" style="text-align: center; margin-top: 20px;">
    <button onclick="window.print()" class="btn btn-primary">Print</button>
</div>
@endsection
