<?php
$kategoriler = tabloOku("kategoriler", $conn);
?>
<nav class="navbar navbar-expand-lg navbar-dark bg-coffee shadow-sm py-3">
    <div class="container">
        <a class="navbar-brand fw-bold" href="?sayfa=main">
            <i class="bi bi-cup-hot text-coffee-gold me-2"></i> Barista's Choice Blog
        </a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navMenu">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navMenu">
            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                <li class="nav-item">
                    <a class="nav-link" href="?sayfa=main"><i class="bi bi-house-door me-1"></i> Anasayfa</a>
                </li>
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="kategoriDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                        <i class="bi bi-grid-fill me-1"></i> Kategoriler
                    </a>
                    <ul class="dropdown-menu border-0 shadow" aria-labelledby="kategoriDropdown">
                        <?php
                        foreach ($kategoriler as $kat) {
                            $katID = $kat["kategori_id"];
                            $katAd = $kat["kategori_ad"];
                            echo "<li><a class=\"dropdown-item\" href=\"?sayfa=kategori&kategoriID=$katID\">$katAd</a></li>";
                        }
                        ?>
                    </ul>
                </li>
            </ul>
            <div class="d-flex align-items-center gap-2">
                <a href="yonetim/download_zip.php" class="btn btn-outline-warning btn-sm rounded-pill px-4 py-2">
                    <i class="bi bi-file-earmark-zip-fill me-1"></i> Projeyi İndir (ZIP)
                </a>
                <a href="yonetim/" class="btn btn-outline-light btn-sm rounded-pill px-4 py-2">
                    <i class="bi bi-gear-fill me-1"></i> Yönetim Paneli
                </a>
            </div>
        </div>
    </div>
</nav>
