<?php
// Détection de la page actuelle dans l'admin pour appliquer la classe active dynamiquement
$current_admin_page = basename($_SERVER['PHP_SELF']);
?>
<link rel="stylesheet" href="css/sidebaradmin.css">
<link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>

<header class="navbar-admin">
    <div class="nav-left-group-admin">
        <div class="logo-admin">
            <a href="/parcotrip/admin/index.php">
                <i class='bx bx-trip'></i> Parco<span>Trip</span> <small style="font-size: 0.75rem; background: #ff4757; color: #fff; padding: 2px 6px; border-radius: 4px; margin-left: 5px; font-weight: 700;">ADMIN</small>
            </a>
        </div>
    </div>

    <button class="burger-menu-admin" id="burgerBtnAdmin" aria-label="Menu Admin">
        <span class="bar-admin"></span>
        <span class="bar-admin"></span>
        <span class="bar-admin"></span>
    </button>

    <nav class="nav-menu-admin" id="navMenuAdmin">
        <ul class="nav-links-admin">
            <li>
                <a href="index.php" class="<?php echo ($current_admin_page == 'index.php') ? 'active' : ''; ?>">
                    <i class='bx bx-grid-alt'></i> <span>Tableau de bord</span>
                </a>
            </li>

            <li class="dropdown-admin" id="dropdownAdmin">
                <div class="dropdown-trigger-admin <?php echo ($current_admin_page == 'modifsparcswait.php' || $current_admin_page == 'addparks.php') ? 'active' : ''; ?>">
                    <i class='bx bx-edit-alt'></i> <span>Modifications</span> <i class='bx bx-chevron-down arrow-icon-admin'></i>
                </div>
                <div class="dropdown-menu-admin">
                    <div class="dropdown-arrow-admin"></div>
                    <ul>
                        <li>
                            <a href="modifsparcswait.php" class="<?php echo ($current_admin_page == 'modifsparcswait.php') ? 'active' : ''; ?>">
                                <i class='bx bx-time-five'></i> Modifications Parcs Attentes
                            </a>
                        </li>
                        <li>
                            <a href="addparks.php" class="<?php echo ($current_admin_page == 'addparks.php') ? 'active' : ''; ?>">
                                <i class='bx bx-landscape'></i> Gestions Parcs / Coasters
                            </a>
                        </li>
                    </ul>
                </div>
            </li>

            <li>
                <a href="index.php">
                    <i class='bx bx-home-alt'></i> <span>Retour au Site</span>
                </a>
            </li>
            <li>
                <a href="logout-to-client.php" class="btn-logout-admin-item">
                    <i class='bx bx-log-out'></i> <span>Déconnexion Admin</span>
                </a>
            </li>
        </ul>
    </nav>
</header>

<script src="js/sidebaradmin.js"></script>