<?php
$settings = getSettings();
$currentPage = basename($_SERVER['PHP_SELF']);
$navLinks = [
    ['label' => 'Home',         'file' => 'index.php'],
    ['label' => 'About',        'file' => 'about.php'],
    ['label' => 'Sectors',      'file' => 'sectors.php'],
    ['label' => 'Exhibitors',   'file' => 'exhibitors.php'],
    ['label' => 'Book a Stand', 'file' => 'register.php', 'button' => true],
    ['label' => 'Gallery',      'file' => 'gallery.php'],
    ['label' => 'FAQ',          'file' => 'faq.php'],
    ['label' => 'Contact',      'file' => 'contact.php'],
];
?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo e($pageTitle ?? SITE_NAME); ?></title>
    <meta name="description" content="<?php echo e($pageDesc ?? $settings['seo_home_desc']); ?>">
    <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&family=Roboto+Condensed:wght@400;700&display=swap" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="<?php echo BASE_URL; ?>/assets/css/style.css">
    <?php if (isset($extraCss)) echo $extraCss; ?>
</head>
<body>
<!-- Top Bar -->
<div class="top-bar">
    <div class="container d-flex justify-content-between align-items-center">
        <span>16–18 November 2026 · Millennium Hall, Addis Ababa</span>
        <span>
            <a href="tel:<?php echo e(preg_replace('/[^0-9+]/','',$settings['phone'])); ?>"><?php echo e($settings['phone']); ?></a>
            <span class="mx-2">|</span>
            <a href="mailto:<?php echo e($settings['email']); ?>"><?php echo e($settings['email']); ?></a>
        </span>
    </div>
</div>

<!-- Middle Bar -->
<div class="middle-bar">
    <div class="container d-flex justify-content-between align-items-center">
        <a href="<?php echo BASE_URL; ?>/index.php" class="nav-brand-link">
            <div class="nav-brand">ETHIOPIA FOOD EXPO</div>
            <small style="color:var(--text-secondary);font-size:0.75rem;">16th Edition · 2026</small>
        </a>
        <div class="text-end">
            <small style="color:var(--text-muted);font-size:0.72rem;">By</small>
            <a href="<?php echo e($settings['parent_site']); ?>" target="_blank" style="color:var(--text-secondary);font-size:0.78rem;text-decoration:none;font-weight:600;">INEXPO GROUP</a>
        </div>
    </div>
</div>

<!-- Navbar -->
<nav class="navbar navbar-expand-lg bottom-bar" id="mainNav">
    <div class="container">
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navCollapse">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navCollapse">
            <ul class="navbar-nav ms-auto">
                <?php foreach ($navLinks as $link):
                    $isActive = $currentPage === $link['file'];
                    $class = 'nav-link' . ($isActive ? ' active' : '');
                    if (!empty($link['button'])) $class .= ' btn-stand';
                ?>
                <li class="nav-item">
                    <a class="<?php echo $class; ?>" href="<?php echo BASE_URL; ?>/<?php echo $link['file']; ?>">
                        <?php echo e($link['label']); ?>
                    </a>
                </li>
                <?php endforeach; ?>
            </ul>
        </div>
    </div>
</nav>
