<?php
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
?>

<header>
    <div class="wrap nav">
        <a href="LandingPage.php" class="brand" style="display: flex; align-items: center; gap: 10px; text-decoration: none; color: white; font-weight: bold; font-size: 20px;">
            <img src="logo.png" alt="Trojan Logo" style="height: 45px; width: auto;">

            <span>Trojan Marketplace</span>
        </a>

        <nav class="links" aria-label="primary">
            <a href="about.php">About</a>
            <a href="howitworks.php">How it Works</a>
            <a href="safety.php">Safety</a>
            <a href="voices.php">Voices</a>

            <?php if (($_SESSION['is_admin'] ?? 0) == 1): ?>
                <a href="Admin_Files/index.php" class="admin-btn">Admin</a>
            <?php endif; ?>

            <?php if (!empty($_SESSION['user_id'])): ?>
                <a href="saved_items.php" style="color:white; font-weight:bold;">♥ Saved</a>

                <a href="profiledb.php">My Account</a>
                <a href="logout.php" class="cta">Log out</a>
            <?php else: ?>

                <a href="loginPage.php" class="cta">Log in</a>
            <?php endif; ?>
        </nav>
    </div>
</header>