<header>
    <div class="logo">
        <a href="index.php?page=dashboard">WCS Admin</a>
    </div>
    
    <nav>
        <ul class="nav-menu">
            <li><a href="index.php?page=dashboard">Dashboard</a></li>
            
            <!-- Attendance Dropdown -->
            <li class="dropdown">
                <a href="#" class="dropbtn">Attendance <i class="fas fa-caret-down"></i></a>
                <div class="dropdown-content">
                    <a href="index.php?page=attendance_kiosk">Kiosk</a>
                    <a href="index.php?page=attendance_kiosk_manual">Manual Kiosk</a>
                    <a href="index.php?page=attendance_manual">Review Grid</a>
                </div>
            </li>

            <!-- Reports Dropdown -->
             <li class="dropdown">
                <a href="#" class="dropbtn">Reports <i class="fas fa-caret-down"></i></a>
                <div class="dropdown-content">
                    <a href="index.php?page=reports">General Reports</a>
                    <a href="index.php?page=attendance_monthly">Monthly Attendance</a>
                    <a href="index.php?page=worship_reports">Worship Reports</a>
                    <a href="index.php?page=issues">Operations Reports</a>
                </div>
            </li>
            
            <!-- Rosters Dropdown -->
            <li class="dropdown">
                <a href="#" class="dropbtn">Rosters <i class="fas fa-caret-down"></i></a>
                <div class="dropdown-content">
                    <a href="index.php?page=services">Services</a>
                    <a href="index.php?page=roster">Rosters</a>
                </div>
            </li>

            <!-- Admin Dropdown -->
            <?php if (hasRole('roster_manager')): ?>
            <li class="dropdown">
                <a href="#" class="dropbtn">Admin <i class="fas fa-caret-down"></i></a>
                <div class="dropdown-content">
                    <a href="index.php?page=members">Members</a>
                    <?php if(hasRole('admin')): ?>
                        <a href="index.php?page=users">User Management</a>
                        <a href="index.php?page=activity_logs">Activity Logs</a>
                    <?php endif; ?>
                    <a href="api/logout.php" style="color: var(--danger-color);">Logout</a>
                </div>
            </li>
            <?php endif; ?>

            <!-- Streaming Dropdown -->
             <li class="dropdown">
                <a href="#" class="dropbtn">Streaming <i class="fas fa-caret-down"></i></a>
                <div class="dropdown-content">
                    <a href="index.php?page=streaming_dashboard">Dashboard</a>
                    <a href="index.php?page=streaming_input">Manual Input</a>
                    <a href="index.php?page=streaming_reports">Reports</a>
                    <?php if (hasRole('admin')): ?>
                        <a href="index.php?page=streaming_config">Configuration</a>
                    <?php endif; ?>
                </div>
            </li>

            <!-- Calendar -->
            <?php if (hasRole('roster_manager')): ?>
            <li><a href="index.php?page=calendar_manager">Calendar</a></li>
            <?php endif; ?>

            <!-- Settings -->
            <?php if (hasRole('admin')): ?>
            <li><a href="index.php?page=settings">Settings</a></li>
            <?php endif; ?>
            
            <?php if (!hasRole('roster_manager')): ?>
                 <li><a href="api/logout.php">Logout</a></li>
            <?php endif; ?>
        </ul>
        
        <div class="hamburger">
            <span class="bar"></span>
            <span class="bar"></span>
            <span class="bar"></span>
        </div>
    </nav>
</header>
