<?php
$current_page = basename($_SERVER['PHP_SELF']);
?>
<!-- Sidebar -->
<aside class="w-64 bg-[#5c1a1b] text-white flex flex-col h-full shadow-xl flex-shrink-0">
    <div class="h-20 flex items-center justify-center border-b border-[#7b2c2d]">
        <h2 class="text-xl font-bold font-serif tracking-wider">Admin Kutz'</h2>
    </div>
    
    <nav class="flex-1 px-4 py-6 space-y-2 overflow-y-auto">
        <a href="index.php" class="flex items-center space-x-3 <?php echo $current_page == 'index.php' ? 'bg-[#7b2c2d] text-white' : 'text-gray-300 hover:bg-white hover:text-[#7b2c2d]'; ?> px-4 py-3 rounded-lg transition mb-4">
            <i data-lucide="layout-dashboard" class="w-5 h-5"></i>
            <span class="font-medium">Tableau de bord</span>
        </a>
        
        <div class="text-xs font-bold text-gray-500 uppercase tracking-wider px-4 mt-6 mb-2">Contenu</div>
        <a href="pages.php" class="flex items-center space-x-3 <?php echo ($current_page == 'pages.php' || $current_page == 'pages-edit.php') ? 'bg-[#7b2c2d] text-white' : 'text-gray-300 hover:bg-white hover:text-[#7b2c2d]'; ?> px-4 py-3 rounded-lg transition">
            <i data-lucide="file-text" class="w-5 h-5"></i>
            <span class="font-medium">Pages</span>
        </a>
        
        <a href="articles.php" class="flex items-center space-x-3 <?php echo ($current_page == 'articles.php' || $current_page == 'articles-edit.php') ? 'bg-[#7b2c2d] text-white' : 'text-gray-300 hover:bg-white hover:text-[#7b2c2d]'; ?> px-4 py-3 rounded-lg transition">
            <i data-lucide="newspaper" class="w-5 h-5"></i>
            <span class="font-medium">Actualités</span>
        </a>
        
        <a href="documents.php" class="flex items-center space-x-3 <?php echo $current_page == 'documents.php' ? 'bg-[#7b2c2d] text-white' : 'text-gray-300 hover:bg-white hover:text-[#7b2c2d]'; ?> px-4 py-3 rounded-lg transition">
            <i data-lucide="file-archive" class="w-5 h-5"></i>
            <span class="font-medium">Arrêtés & Bulletins</span>
        </a>

        <div class="text-xs font-bold text-gray-500 uppercase tracking-wider px-4 mt-6 mb-2">La Commune</div>
        <a href="conseil.php" class="flex items-center space-x-3 <?php echo $current_page == 'conseil.php' ? 'bg-[#7b2c2d] text-white' : 'text-gray-300 hover:bg-white hover:text-[#7b2c2d]'; ?> px-4 py-3 rounded-lg transition">
            <i data-lucide="users" class="w-5 h-5"></i>
            <span class="font-medium">Conseil Municipal</span>
        </a>

        <a href="personnel.php" class="flex items-center space-x-3 <?php echo $current_page == 'personnel.php' ? 'bg-[#7b2c2d] text-white' : 'text-gray-300 hover:bg-white hover:text-[#7b2c2d]'; ?> px-4 py-3 rounded-lg transition">
            <i data-lucide="hard-hat" class="w-5 h-5"></i>
            <span class="font-medium">Personnel Communal</span>
        </a>

        <div class="text-xs font-bold text-gray-500 uppercase tracking-wider px-4 mt-6 mb-2">Vie du Village</div>
        <a href="associations.php" class="flex items-center space-x-3 <?php echo $current_page == 'associations.php' ? 'bg-[#7b2c2d] text-white' : 'text-gray-300 hover:bg-white hover:text-[#7b2c2d]'; ?> px-4 py-3 rounded-lg transition">
            <i data-lucide="users-2" class="w-5 h-5"></i>
            <span class="font-medium">Associations</span>
        </a>

        <a href="agenda.php" class="flex items-center space-x-3 <?php echo $current_page == 'agenda.php' ? 'bg-[#7b2c2d] text-white' : 'text-gray-300 hover:bg-white hover:text-[#7b2c2d]'; ?> px-4 py-3 rounded-lg transition">
            <i data-lucide="calendar-days" class="w-5 h-5"></i>
            <span class="font-medium">Agenda Manifestations</span>
        </a>

        <a href="reservations.php" class="flex items-center space-x-3 <?php echo $current_page == 'reservations.php' ? 'bg-[#7b2c2d] text-white' : 'text-gray-300 hover:bg-white hover:text-[#7b2c2d]'; ?> px-4 py-3 rounded-lg transition">
            <i data-lucide="calendar" class="w-5 h-5"></i>
            <span class="font-medium">Réservations Salles</span>
        </a>

        <div class="text-xs font-bold text-gray-500 uppercase tracking-wider px-4 mt-6 mb-2">Configuration</div>
        <a href="settings.php" class="flex items-center space-x-3 <?php echo $current_page == 'settings.php' ? 'bg-[#7b2c2d] text-white' : 'text-gray-300 hover:bg-white hover:text-[#7b2c2d]'; ?> px-4 py-3 rounded-lg transition">
            <i data-lucide="settings" class="w-5 h-5"></i>
            <span class="font-medium">Réglages / Cookies</span>
        </a>

        <a href="backup.php" class="flex items-center space-x-3 <?php echo $current_page == 'backup.php' ? 'bg-[#7b2c2d] text-white' : 'text-gray-300 hover:bg-white hover:text-[#7b2c2d]'; ?> px-4 py-3 rounded-lg transition">
            <i data-lucide="save" class="w-5 h-5"></i>
            <span class="font-medium">Sauvegarde</span>
        </a>
    </nav>
    
    <div class="p-4 border-t border-[#7b2c2d]">
        <a href="logout.php" class="flex items-center space-x-3 text-gray-300 hover:text-white w-full px-4 py-2 transition">
            <i data-lucide="log-out" class="w-5 h-5"></i>
            <span>Déconnexion</span>
        </a>
    </div>
</aside>
