<?php
function renderAdminSidebar($currentPage = '') {
    $navItems = [
        'dashboard' => ['url' => '/files/atasteofafricanmarketplace/superadmin/dashboard.php', 'icon' => 'fas fa-tachometer-alt', 'label' => 'Dashboard'],
        'coaches' => ['url' => '/files/atasteofafricanmarketplace/superadmin/coaches.php', 'icon' => 'fas fa-users', 'label' => 'Manage Coaches'],
        'coach-applications' => ['url' => '/files/atasteofafricanmarketplace/superadmin/coach-applications.php', 'icon' => 'fas fa-user-plus', 'label' => 'Coach Applications'],
        'users' => ['url' => '/files/atasteofafricanmarketplace/superadmin/users.php', 'icon' => 'fas fa-user-friends', 'label' => 'Manage Users'],
        'appointments' => ['url' => '/files/atasteofafricanmarketplace/superadmin/appointments.php', 'icon' => 'fas fa-calendar', 'label' => 'Appointments'],
        'toa-wheel-services' => ['url' => '/files/atasteofafricanmarketplace/superadmin/toa-wheel-services.php', 'icon' => 'fas fa-cog', 'label' => 'TOA Wheel Services'],
        'toa-members' => ['url' => '/files/atasteofafricanmarketplace/superadmin/toa-members.php', 'icon' => 'fas fa-users-cog', 'label' => 'TOA Members'],
        'content' => ['url' => '/files/atasteofafricanmarketplace/superadmin/content.php', 'icon' => 'fas fa-edit', 'label' => 'Website Content'],
        'settings' => ['url' => '/files/atasteofafricanmarketplace/superadmin/settings.php', 'icon' => 'fas fa-cogs', 'label' => 'System Settings']
    ];
    
    echo '<div class="bg-emerald-800 text-white w-64 flex-shrink-0">';
    echo '<div class="p-6">';
    echo '<h1 class="text-xl font-bold">Superadmin Panel</h1>';
    echo '<p class="text-emerald-200 text-sm mt-1">Website Management</p>';
    echo '</div>';
    
    echo '<nav class="mt-6">';
    foreach ($navItems as $key => $item) {
        $isActive = $currentPage === $key;
        $activeClass = $isActive ? 'bg-emerald-700 text-white' : 'hover:bg-emerald-700 text-emerald-100';
        echo '<a href="' . $item['url'] . '" class="flex items-center px-6 py-3 ' . $activeClass . '">';
        echo '<i class="' . $item['icon'] . ' mr-3"></i>';
        echo $item['label'];
        echo '</a>';
    }
    
    echo '<div class="border-t border-emerald-700 mt-6 pt-6">';
    echo '<a href="/files/atasteofafricanmarketplace/api/auth/logout.php" class="flex items-center px-6 py-3 hover:bg-red-600 text-emerald-100">';
    echo '<i class="fas fa-sign-out-alt mr-3"></i>';
    echo 'Logout';
    echo '</a>';
    echo '</div>';
    echo '</nav>';
    echo '</div>';
}
?>