<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Regenerate Certificates</title>
    <!-- Bootstrap 5 CDN -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .pdf-container {
            width: 100%;
            height: 100vh; /* full screen height */
            border: none;
        }
    </style>
</head>
<body class="bg-light">

    <div class="container py-4">
        <!-- Title -->
        <h2 class="text-center mb-4">Reprint Certificate</h2>

        <!-- Member details -->
        <div class="card shadow-sm mb-4">
            <div class="card-header bg-success text-white">
                Certified Member Details (Ref: {{ $member->cert_serial }})
            </div>
            <div class="card-body">
                <div class="row g-3">
                    <div class="col-md-3">
                        <div class="p-3 border rounded bg-light">
                            <strong>Name:</strong> {{ $member->full_names }}
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="p-3 border rounded bg-light">
                            <strong>Course:</strong> {{ $member->course_name  }}
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="p-3 border rounded bg-light">
                             <strong>Issue Date:</strong> {{ \Carbon\Carbon::parse($member->approvaldate)->format('d M Y') }} 
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="p-3 border rounded bg-light">
                            <strong>Expiry Date:</strong> {{ \Carbon\Carbon::parse($member->experydate)->format('d M Y') }}
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- PDF Viewer -->
        <div class="card shadow-sm">
            <div class="card-header bg-secondary text-white">
                Certificate Preview
            </div>
            <div class="card-body p-0">
                <iframe    
                    src="{{ url('reprintcert/' . $refno) }}"
                    class="pdf-container">
                </iframe>
            </div>
        </div>

        <p class="mt-3 text-muted small text-center">St John Ambulance Kenya 2025</p>
    </div>

    <!-- Bootstrap JS Bundle -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
