<?php
/**
 * Payroll Navigation Tabs Component
 * Replicates Excel file tab navigation
 */

$currentTab = $currentTab ?? 'home';
?>

<style>
.payroll-nav-tabs {
    background: white;
    border-radius: 5px;
    padding: 10px 15px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.payroll-nav-tabs ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 8px;
}

.payroll-nav-tabs li {
    display: inline-block;
    position: relative;
}

.payroll-nav-tabs a {
    padding: 8px 12px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px 4px 0 0;
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
    border: 1px solid #ddd;
    border-bottom: none;
}

.payroll-nav-tabs a:hover {
    background: #e0e0e0;
    color: #000;
}

.payroll-nav-tabs a.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
    font-weight: bold;
}

.payroll-nav-tabs a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #4CAF50;
}
</style>

<div class="payroll-nav-tabs">
    <ul>
        <li>
            <a href="<?php echo BASE_URL; ?>/modules/payroll/home.php" 
               class="<?php echo $currentTab === 'home' ? 'active' : ''; ?>">
                Home
            </a>
        </li>
        <li>
            <a href="<?php echo BASE_URL; ?>/modules/payroll/instructions.php" 
               class="<?php echo $currentTab === 'instructions' ? 'active' : ''; ?>">
                Instructions
            </a>
        </li>
        <li>
            <a href="<?php echo BASE_URL; ?>/modules/employee/employee_master_complete.php" 
               class="<?php echo $currentTab === 'employee_master' ? 'active' : ''; ?>">
                Employee Master Sheet
            </a>
        </li>
        <?php if (isHRAdmin() || isSuperAdmin()): ?>
        <li>
            <a href="<?php echo BASE_URL; ?>/modules/employee/employee_master_change_list.php" 
               class="<?php echo $currentTab === 'employee_master_change' ? 'active' : ''; ?>">
                Employee Master Change
            </a>
        </li>
        <?php endif; ?>
        <li>
            <a href="<?php echo BASE_URL; ?>/modules/attendance/attendance_excel_grid.php" 
               class="<?php echo $currentTab === 'attendance' ? 'active' : ''; ?>">
                Attendance
            </a>
        </li>
        <li>
            <a href="<?php echo BASE_URL; ?>/modules/payroll/salary_register.php" 
               class="<?php echo $currentTab === 'salary_register' ? 'active' : ''; ?>">
                Salary Register
            </a>
        </li>
        <li>
            <a href="<?php echo BASE_URL; ?>/modules/employee/new_joinee_statutory.php" 
               class="<?php echo $currentTab === 'new_joinee' ? 'active' : ''; ?>">
                New Joinee Statutory
            </a>
        </li>
        <li>
            <a href="<?php echo BASE_URL; ?>/modules/overtime/list.php" 
               class="<?php echo $currentTab === 'overtime' ? 'active' : ''; ?>">
                Over Time
            </a>
        </li>
        <li>
            <a href="<?php echo BASE_URL; ?>/modules/exit/list.php" 
               class="<?php echo $currentTab === 'resigned' ? 'active' : ''; ?>">
                Resigned & Abscondee
            </a>
        </li>
        <li>
            <a href="<?php echo BASE_URL; ?>/modules/leave/list.php" 
               class="<?php echo $currentTab === 'leave_form' ? 'active' : ''; ?>">
                Leave Form
            </a>
        </li>
    </ul>
</div>
