<?php require __DIR__ . '/../layouts/header.php'; ?>

<div class="card border-0 shadow-sm rounded-4 mx-auto" style="max-width:820px;">
    <div class="card-body p-5 text-center">
        <div class="display-3 fw-bold mb-3">500</div>
        <h1 class="h3 fw-bold mb-3"><?= e(trans('system_error')) ?></h1>
        <p class="text-muted mb-4"><?= e(trans('something_went_wrong')) ?></p>

        <?php if (!empty($errorMessage) && has_permission('errors.view')): ?>
            <div class="alert alert-warning text-start rounded-4">
                <?= e((string) $errorMessage) ?>
            </div>
        <?php endif; ?>

        <div class="d-flex gap-2 justify-content-center flex-wrap">
            <a href="<?= e(base_path('')) ?>" class="btn btn-primary rounded-3"><?= e(trans('go_home')) ?></a>
            <?php if (is_logged_in()): ?>
                <a href="<?= e(base_path('dashboard')) ?>" class="btn btn-outline-secondary rounded-3"><?= e(trans('back_dashboard')) ?></a>
            <?php endif; ?>
        </div>
    </div>
</div>

<?php require __DIR__ . '/../layouts/footer.php'; ?>
