<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><?= $title ?? 'Job Portal' ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body { background: #f4f6f9; }
        .navbar-brand { font-weight: 700; }
        .auth-card { max-width: 480px; margin: 60px auto; }
        .hero { padding: 80px 0; background: linear-gradient(135deg, #0d6efd, #0a58ca); color: #fff; }

        @media (max-width: 575.98px) {
            .auth-card { margin: 24px auto; }
            .hero { padding: 40px 0; }
            .hero h1 { font-size: 1.6rem; }
        }
    </style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
    <div class="container">
        <a class="navbar-brand" href="<?= base_url() ?>">Job Portal</a>
        <div class="d-flex gap-2">
            <?php if (session()->get('user_id')): ?>
                <a href="<?= base_url('admin') ?>" class="btn btn-outline-primary btn-sm">Dashboard</a>
                <a href="<?= base_url('logout') ?>" class="btn btn-outline-secondary btn-sm">Logout</a>
            <?php else: ?>
                <a href="<?= base_url('login') ?>" class="btn btn-outline-primary btn-sm">Log In</a>
                <a href="<?= base_url('register') ?>" class="btn btn-primary btn-sm">Sign Up</a>
            <?php endif; ?>
        </div>
    </div>
</nav>

<?php if (session()->getFlashdata('success')): ?>
    <div class="container mt-3"><div class="alert alert-success"><?= esc(session()->getFlashdata('success')) ?></div></div>
<?php endif; ?>
<?php if (session()->getFlashdata('error')): ?>
    <div class="container mt-3"><div class="alert alert-danger"><?= esc(session()->getFlashdata('error')) ?></div></div>
<?php endif; ?>

<?= $this->renderSection('content') ?>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
