<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= $title ?? 'Error' ?> — BOAFO</title>
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&family=Inter:wght@400;500&display=swap" rel="stylesheet">
    <!-- Bootstrap 5 -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- FontAwesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="<?= APP_URL ?>/assets/css/boafo.css">
</head>
<body class="bg-light d-flex align-items-center justify-content-center" style="min-height: 100vh;">
    <div class="container text-center">
        <div class="row justify-content-center">
            <div class="col-md-6 col-lg-5">
                <div class="card border-0 shadow-lg p-5 glass-card card-hover-effect">
                    <div class="mb-4">
                        <span class="badge bg-danger-subtle text-danger rounded-pill px-4 py-2 fs-5 font-outfit fw-bold"><?= $code ?? 500 ?></span>
                    </div>
                    <div class="error-icon-box mb-4 text-danger">
                        <i class="fa-solid fa-triangle-exclamation display-1 animate-pulse"></i>
                    </div>
                    <h1 class="fw-bold font-outfit text-dark mb-3"><?= htmlspecialchars($title ?? 'An Error Occurred') ?></h1>
                    <p class="text-muted mb-4"><?= htmlspecialchars($message ?? 'We apologize, but something went wrong. Please try again later or return home.') ?></p>
                    <div class="d-flex justify-content-center gap-3">
                        <a href="<?= APP_URL ?>" class="btn btn-primary rounded-pill px-4 shadow-sm"><i class="fa-solid fa-house me-2"></i> Go Home</a>
                        <button onclick="history.back()" class="btn btn-outline-secondary rounded-pill px-4"><i class="fa-solid fa-arrow-left me-2"></i> Go Back</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
