<!DOCTYPE html>
<html lang="es">
<head>
  <meta charset="UTF-8">
  <title><?= $title ?? 'ContratandoGT' ?></title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="<?= base_url('css/bootstrap.min.css') ?>">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet">
  <link rel="stylesheet" href="<?= base_url('css/style.css') ?>">
</head>
<body>

<nav class="navbar navbar-expand-lg bg-white shadow-sm">
  <div class="container">
    <a class="navbar-brand logo" href="<?= base_url('/') ?>">
      <img src="<?= base_url('img/logo_1.png') ?>" alt="Logo">
    </a>
    <button class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#menu">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="menu">
      <ul class="navbar-nav mx-auto">
        <li class="nav-item"><a class="nav-link" href="<?= base_url('/') ?>">Inicio</a></li>
        <li class="nav-item"><a class="nav-link" href="<?= base_url('empleo') ?>">Empleos</a></li>
        <li class="nav-item"><a class="nav-link" href="<?= base_url('empresa') ?>">Empresas</a></li>
        <li class="nav-item"><a class="nav-link" href="<?= base_url('recursos') ?>">Recursos</a></li>
      </ul>
        <?php if (session()->get('logueado')): ?>
            <!-- Usuario logueado -->
                <a href="<?= base_url('perfil') ?>" class="btn btn-outline-primary me-2">
                    <i class="bi bi-person-circle"></i> <?= session()->get('usuario_nombre') ?>
                </a>
                <a href="<?= base_url('logout') ?>" class="btn btn-danger">
                    <i class="bi bi-box-arrow-right"></i> Cerrar sesión
                </a>
        <?php else: ?>
      <button type="button" class="btn btn-outline-primary me-2" data-bs-toggle="modal" data-bs-target="#loginModal">Login</button>
      <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#registroModal">Registrarse</button>
        <?php endif; ?>
    </div>
  </div>
</nav>