<!-- Sidebar de navigation -->
<div class="sidebar">
    <a href="index.php" class="logo">
        <img src="img/logo.png" alt="Kaubuntu.re">
    </a>
    
    <nav class="sidebar-nav">
        <a href="index.php" class="nav-item" data-title="Accueil">
            <i class="fas fa-home"></i> <span>Accueil</span>
        </a>
        <a href="direct.php" class="nav-item" data-title="Direct">
            <i class="fas fa-broadcast-tower"></i> <span>Direct</span>
        </a>
        
        <div class="nav-divider"></div>

        <?php
        // Afficher les catégories prioritaires
        if (defined('PRIORITY_CATEGORIES') && !empty(PRIORITY_CATEGORIES)) {
            // Tableau associatif des icônes pour les catégories
            $categoryIcons = [
                1 => 'fas fa-music',           // Musique
                5 => 'fas fa-running',          // Sport
                11 => 'fas fa-globe',           // Actualité & Politique
                2 => 'fas fa-film',             // Films
                3 => 'fas fa-video',            // Émissions & Séries
                4 => 'fas fa-gamepad',          // Jeux
                6 => 'fas fa-laugh',            // Humour
                7 => 'fas fa-palette',          // Art
                8 => 'fas fa-spa',              // Bien-être
                9 => 'fas fa-tshirt',           // Mode
                10 => 'fas fa-random',          // Divers
                12 => 'fas fa-dollar-sign',     // Finance
                13 => 'fas fa-graduation-cap',  // Education
                14 => 'fas fa-fist-raised',     // Activism
                15 => 'fas fa-microscope',      // Science & Technology
                16 => 'fas fa-paw',             // Animals
                17 => 'fas fa-child',           // Kids
                18 => 'fas fa-utensils'         // Food
            ];
            
            foreach (PRIORITY_CATEGORIES as $id => $name) {
                $icon = isset($categoryIcons[$id]) ? $categoryIcons[$id] : 'fas fa-folder';
                echo '<a href="categories.php?id=' . $id . '" class="nav-item" data-title="' . htmlspecialchars($name) . '">';
                echo '<i class="' . $icon . '"></i> <span>' . htmlspecialchars($name) . '</span>';
                echo '</a>';
            }
        }
        ?>
        
        <div class="nav-divider"></div>
        
        <div class="category-title">
            <i class="fas fa-hashtag"></i> <span>Hashtags</span>
        </div>
        
        <?php 
        if (defined('IMPORTANT_TAGS') && !empty(IMPORTANT_TAGS)):
            foreach (IMPORTANT_TAGS as $tag):
                $encodedTag = urlencode('#' . $tag);
        ?>
        <a href="recherche.php?q=<?php echo $encodedTag; ?>" class="tag-item" data-title="<?php echo htmlspecialchars($tag); ?>">
            <i class="fas fa-hashtag tag-icon"></i> <span><?php echo htmlspecialchars($tag); ?></span>
        </a>
        <?php 
            endforeach;
        endif;
        ?>
    </nav>
</div>
