from django.core.management.base import BaseCommand
from config.models import Icongroup, Icon


class Command(BaseCommand):
    help = 'Seed la base de données avec des icônes FontAwesome 4 essentielles'

    def handle(self, *args, **options):
        self.stdout.write('🌱 Début du seeding des icônes FontAwesome 4...')
        
        # Création des groupes d'icônes
        icon_groups = self.create_icon_groups()
        
        # Création des icônes
        self.create_icons(icon_groups)
        
        self.stdout.write(
            self.style.SUCCESS('✅ Seeding des icônes terminé avec succès!')
        )

    def create_icon_groups(self):
        """Créer les groupes d'icônes FontAwesome 4, 5 et 6"""
        groups_data = [
            {'libelle': 'fa'},   # FontAwesome 4 (toutes les icônes)
            {'libelle': 'fas'},  # FontAwesome 5/6 Solid
            {'libelle': 'far'},  # FontAwesome 5/6 Regular
            {'libelle': 'fab'},  # FontAwesome 5/6 Brands
        ]
        
        created_groups = []
        for group_data in groups_data:
            group, created = Icongroup.objects.get_or_create(
                libelle=group_data['libelle']
            )
            if created:
                self.stdout.write(f'  ➕ Groupe créé: {group.libelle}')
            else:
                self.stdout.write(f'  ℹ️  Groupe existant: {group.libelle}')
            created_groups.append(group)
        
        return created_groups

    def create_icons(self, icon_groups):
        """Créer les icônes FontAwesome 4, 5 et 6 essentielles"""
        
        # Icônes FontAwesome 4 (fa) - Les plus utilisées
        fa_group = next((g for g in icon_groups if g.libelle == 'fa'), None)
        if fa_group:
            fa_icons = [
                # Navigation et interface
                'fa-home', 'fa-user', 'fa-users', 'fa-user-plus', 'fa-user-minus',
                'fa-user-secret', 'fa-user-times', 'fa-user-circle', 'fa-user-circle-o',
                
                # Outils et configuration
                'fa-cog', 'fa-cogs', 'fa-wrench', 'fa-tools', 'fa-hammer', 'fa-screwdriver',
                'fa-toolbox', 'fa-sliders', 'fa-toggle-on', 'fa-toggle-off',
                
                # Communication
                'fa-search', 'fa-search-plus', 'fa-search-minus', 'fa-envelope', 'fa-envelope-o',
                'fa-envelope-square', 'fa-phone', 'fa-phone-square', 'fa-fax',
                'fa-address-book', 'fa-address-book-o', 'fa-address-card', 'fa-address-card-o',
                
                # Localisation et temps
                'fa-map-marker', 'fa-map', 'fa-calendar', 'fa-calendar-o', 'fa-clock-o', 'fa-history',
                
                # Actions et interactions
                'fa-heart', 'fa-heart-o', 'fa-star', 'fa-star-o', 'fa-star-half', 'fa-star-half-o',
                'fa-thumbs-up', 'fa-thumbs-down', 'fa-thumbs-o-up', 'fa-thumbs-o-down',
                'fa-hand-o-up', 'fa-hand-o-down', 'fa-hand-o-left', 'fa-hand-o-right',
                
                # Fichiers et médias
                'fa-download', 'fa-upload', 'fa-save', 'fa-edit', 'fa-pencil', 'fa-pencil-square-o',
                'fa-trash', 'fa-trash-o', 'fa-plus', 'fa-minus', 'fa-times', 'fa-check',
                'fa-check-circle', 'fa-check-circle-o', 'fa-check-square', 'fa-check-square-o',
                'fa-info-circle', 'fa-exclamation-triangle', 'fa-exclamation-circle', 'fa-question-circle',
                
                # Sécurité et accès
                'fa-lock', 'fa-unlock', 'fa-key', 'fa-shield', 'fa-eye', 'fa-eye-slash',
                
                # Navigation et direction
                'fa-arrow-left', 'fa-arrow-right', 'fa-arrow-up', 'fa-arrow-down',
                'fa-arrow-circle-left', 'fa-arrow-circle-right', 'fa-arrow-circle-up', 'fa-arrow-circle-down',
                'fa-chevron-left', 'fa-chevron-right', 'fa-chevron-up', 'fa-chevron-down',
                'fa-caret-left', 'fa-caret-right', 'fa-caret-up', 'fa-caret-down',
                'fa-angle-left', 'fa-angle-right', 'fa-angle-up', 'fa-angle-down',
                'fa-long-arrow-left', 'fa-long-arrow-right', 'fa-long-arrow-up', 'fa-long-arrow-down',
                
                # Interface utilisateur
                'fa-bars', 'fa-list', 'fa-list-alt', 'fa-list-ol', 'fa-list-ul',
                'fa-th', 'fa-th-large', 'fa-th-list', 'fa-table', 'fa-columns',
                
                # Fichiers et dossiers
                'fa-file', 'fa-file-o', 'fa-file-text', 'fa-file-text-o', 'fa-file-archive-o',
                'fa-file-audio-o', 'fa-file-code-o', 'fa-file-excel-o', 'fa-file-image-o',
                'fa-file-pdf-o', 'fa-file-powerpoint-o', 'fa-file-video-o', 'fa-file-word-o',
                'fa-folder', 'fa-folder-o', 'fa-folder-open', 'fa-folder-open-o',
                
                # Médias et contenu
                'fa-image', 'fa-picture-o', 'fa-video-camera', 'fa-music', 'fa-play',
                'fa-pause', 'fa-stop', 'fa-forward', 'fa-backward', 'fa-fast-forward',
                'fa-step-forward', 'fa-step-backward', 'fa-volume-up', 'fa-volume-down',
                'fa-volume-off', 'fa-microphone', 'fa-microphone-slash', 'fa-camera', 'fa-camera-retro',
                
                # Liens et partage
                'fa-link', 'fa-unlink', 'fa-external-link', 'fa-share', 'fa-share-alt',
                'fa-share-square', 'fa-share-square-o', 'fa-retweet', 'fa-reply', 'fa-reply-all',
                'fa-forward', 'fa-comment', 'fa-comments', 'fa-comment-o', 'fa-comments-o',
                
                # Réseaux sociaux et communication
                'fa-heart', 'fa-heart-o', 'fa-smile-o', 'fa-frown-o', 'fa-meh-o',
                
                # Marqueurs et indicateurs
                'fa-bookmark', 'fa-bookmark-o', 'fa-flag', 'fa-flag-o', 'fa-tag', 'fa-tags',
                'fa-certificate', 'fa-trophy', 'fa-circle', 'fa-circle-o', 'fa-square', 'fa-square-o',
                
                # Technologie et appareils
                'fa-mobile', 'fa-tablet', 'fa-laptop', 'fa-desktop', 'fa-tv', 'fa-gamepad',
                'fa-headphones', 'fa-keyboard-o', 'fa-mouse-pointer', 'fa-wifi', 'fa-signal',
                
                # Notifications et alertes
                'fa-bell', 'fa-bell-o', 'fa-bell-slash', 'fa-bell-slash-o', 'fa-exclamation',
                'fa-exclamation-triangle', 'fa-exclamation-circle', 'fa-info', 'fa-info-circle',
                'fa-question', 'fa-question-circle',
                
                # État et statut
                'fa-spinner', 'fa-circle-o-notch', 'fa-refresh', 'fa-undo', 'fa-repeat',
                'fa-history', 'fa-clock-o', 'fa-stopwatch', 'fa-tachometer', 'fa-bar-chart',
                'fa-bar-chart-o', 'fa-line-chart', 'fa-pie-chart', 'fa-area-chart',
                
                # Formes géométriques
                'fa-circle', 'fa-circle-o', 'fa-square', 'fa-square-o', 'fa-dot-circle-o',
                'fa-circle-thin', 'fa-square-thin', 'fa-diamond', 'fa-diamond-o',
                
                # Icônes spéciales
                'fa-coffee', 'fa-beer', 'fa-glass', 'fa-cutlery', 'fa-birthday-cake',
                'fa-gift', 'fa-leaf', 'fa-tree', 'fa-car', 'fa-bus', 'fa-train',
                'fa-plane', 'fa-rocket', 'fa-ship', 'fa-bicycle', 'fa-motorcycle',
                'fa-taxi', 'fa-truck', 'fa-ambulance', 'fa-medkit', 'fa-stethoscope',
                'fa-heartbeat', 'fa-pulse', 'fa-hospital-o', 'fa-building-o', 'fa-bank',
                'fa-credit-card', 'fa-money', 'fa-eur', 'fa-usd', 'fa-gbp', 'fa-jpy',
                'fa-rub', 'fa-btc', 'fa-bitcoin', 'fa-calculator', 'fa-calculator-o'
            ]
            
            self.create_icons_in_group(fa_group, fa_icons, 'fa')
        
        # Icônes FontAwesome 5/6 Solid (fas) - Les plus utilisées
        fas_group = next((g for g in icon_groups if g.libelle == 'fas'), None)
        if fas_group:
            fas_icons = [
                # Navigation et interface
                'fa-home', 'fa-user', 'fa-users', 'fa-user-friends', 'fa-user-plus', 'fa-user-minus',
                'fa-user-edit', 'fa-user-cog', 'fa-user-shield', 'fa-user-tie', 'fa-user-graduate',
                'fa-user-ninja', 'fa-user-astronaut', 'fa-user-check', 'fa-user-clock',
                
                # Outils et configuration
                'fa-cog', 'fa-cogs', 'fa-wrench', 'fa-tools', 'fa-hammer', 'fa-screwdriver',
                'fa-toolbox', 'fa-gear', 'fa-sliders', 'fa-toggle-on', 'fa-toggle-off',
                
                # Communication
                'fa-search', 'fa-search-plus', 'fa-search-minus', 'fa-search-location',
                'fa-envelope', 'fa-envelope-open', 'fa-envelope-square', 'fa-phone', 'fa-phone-square',
                'fa-phone-volume', 'fa-phone', 'fa-fax', 'fa-address-book', 'fa-address-card',
                
                # Localisation et temps
                'fa-map-marker-alt', 'fa-map', 'fa-map-pin', 'fa-map-signs', 'fa-route',
                'fa-calendar', 'fa-calendar-alt', 'fa-calendar-check', 'fa-calendar-plus',
                'fa-calendar-minus', 'fa-calendar-times', 'fa-clock', 'fa-hourglass',
                'fa-hourglass-start', 'fa-hourglass-half', 'fa-hourglass-end',
                
                # Actions et interactions
                'fa-heart', 'fa-star', 'fa-star-half', 'fa-thumbs-up', 'fa-thumbs-down',
                'fa-hand-paper', 'fa-hand-rock', 'fa-hand-scissors', 'fa-hand-lizard', 'fa-hand-spock',
                'fa-hand-point-up', 'fa-hand-point-down', 'fa-hand-point-left', 'fa-hand-point-right',
                
                # Fichiers et médias
                'fa-download', 'fa-upload', 'fa-save', 'fa-edit', 'fa-pen', 'fa-pencil',
                'fa-trash', 'fa-trash-can', 'fa-trash-restore', 'fa-trash-restore-alt',
                'fa-plus', 'fa-minus', 'fa-times', 'fa-check', 'fa-check-circle', 'fa-check-square',
                'fa-info-circle', 'fa-exclamation-triangle', 'fa-exclamation-circle', 'fa-question-circle',
                
                # Sécurité et accès
                'fa-lock', 'fa-unlock', 'fa-key', 'fa-shield', 'fa-shield-virus',
                'fa-eye', 'fa-eye-slash', 'fa-eye-dropper', 'fa-eye-low-vision',
                
                # Navigation et direction
                'fa-arrow-left', 'fa-arrow-right', 'fa-arrow-up', 'fa-arrow-down',
                'fa-arrow-circle-left', 'fa-arrow-circle-right', 'fa-arrow-circle-up', 'fa-arrow-circle-down',
                'fa-chevron-left', 'fa-chevron-right', 'fa-chevron-up', 'fa-chevron-down',
                'fa-caret-left', 'fa-caret-right', 'fa-caret-up', 'fa-caret-down',
                'fa-angle-left', 'fa-angle-right', 'fa-angle-up', 'fa-angle-down',
                'fa-long-arrow-left', 'fa-long-arrow-right', 'fa-long-arrow-up', 'fa-long-arrow-down',
                
                # Interface utilisateur
                'fa-bars', 'fa-list', 'fa-list-alt', 'fa-list-ol', 'fa-list-ul',
                'fa-th', 'fa-th-large', 'fa-th-list', 'fa-table', 'fa-columns',
                'fa-window-maximize', 'fa-window-minimize', 'fa-window-restore', 'fa-window-close',
                
                # Fichiers et dossiers
                'fa-file', 'fa-file-alt', 'fa-file-archive', 'fa-file-audio', 'fa-file-code',
                'fa-file-csv', 'fa-file-excel', 'fa-file-image', 'fa-file-pdf', 'fa-file-powerpoint',
                'fa-file-video', 'fa-file-word', 'fa-folder', 'fa-folder-open', 'fa-folder-plus',
                'fa-folder-minus', 'fa-folder-times', 'fa-folder-check',
                
                # Médias et contenu
                'fa-image', 'fa-images', 'fa-video', 'fa-video-slash', 'fa-music', 'fa-play',
                'fa-pause', 'fa-stop', 'fa-forward', 'fa-backward', 'fa-fast-forward', 'fa-fast-backward',
                'fa-step-forward', 'fa-step-backward', 'fa-volume-up', 'fa-volume-down', 'fa-volume-mute',
                'fa-volume-off', 'fa-microphone', 'fa-microphone-slash', 'fa-camera', 'fa-camera-retro',
                
                # Liens et partage
                'fa-link', 'fa-unlink', 'fa-external-link-alt', 'fa-share', 'fa-share-alt',
                'fa-share-square', 'fa-share-alt-square', 'fa-retweet', 'fa-reply', 'fa-reply-all',
                'fa-forward', 'fa-comment', 'fa-comments', 'fa-comment-alt', 'fa-comment-dots',
                'fa-comment-slash', 'fa-comment-medical', 'fa-comment-dollar',
                
                # Réseaux sociaux et communication
                'fa-heart', 'fa-heart-broken', 'fa-heartbeat', 'fa-smile', 'fa-frown', 'fa-meh',
                'fa-grin', 'fa-grin-alt', 'fa-grin-beam', 'fa-grin-hearts', 'fa-grin-squint',
                'fa-grin-squint-tears', 'fa-grin-stars', 'fa-grin-tears', 'fa-grin-tongue',
                'fa-grin-tongue-squint', 'fa-grin-tongue-wink', 'fa-grin-wink',
                
                # Marqueurs et indicateurs
                'fa-bookmark', 'fa-flag', 'fa-flag-checkered', 'fa-tag', 'fa-tags',
                'fa-certificate', 'fa-award', 'fa-trophy', 'fa-medal', 'fa-badge',
                'fa-circle', 'fa-square', 'fa-dot-circle', 'fa-square-full',
                
                # Technologie et appareils
                'fa-mobile', 'fa-mobile-alt', 'fa-tablet', 'fa-tablet-alt', 'fa-laptop',
                'fa-laptop-code', 'fa-desktop', 'fa-tv', 'fa-gamepad', 'fa-headphones',
                'fa-headphones-alt', 'fa-keyboard', 'fa-mouse', 'fa-mouse-pointer',
                'fa-wifi', 'fa-bluetooth', 'fa-bluetooth-b', 'fa-signal', 'fa-signal-1',
                'fa-signal-2', 'fa-signal-3', 'fa-signal-4', 'fa-signal-5',
                
                # Notifications et alertes
                'fa-bell', 'fa-bell-slash', 'fa-bell-on', 'fa-bell-off', 'fa-exclamation',
                'fa-exclamation-triangle', 'fa-exclamation-circle', 'fa-info', 'fa-info-circle',
                'fa-question', 'fa-question-circle', 'fa-question-square',
                
                # État et statut
                'fa-spinner', 'fa-circle-notch', 'fa-sync', 'fa-sync-alt', 'fa-redo',
                'fa-redo-alt', 'fa-undo', 'fa-undo-alt', 'fa-history', 'fa-clock',
                'fa-stopwatch', 'fa-tachometer-alt', 'fa-chart-line', 'fa-chart-bar',
                'fa-chart-pie', 'fa-chart-area', 'fa-chart-column',
                
             
            ]
            
            self.create_icons_in_group(fas_group, fas_icons, 'fas')
        
        # Icônes FontAwesome 5/6 Regular (far) - Icônes régulières
        far_group = next((g for g in icon_groups if g.libelle == 'far'), None)
        if far_group:
            far_icons = [
                # Utilisateurs et profils
                'fa-user', 'fa-user-circle', 'fa-user-square', 'fa-id-badge', 'fa-id-card',
                'fa-address-book', 'fa-address-card', 'fa-user-tie', 'fa-user-graduate',
                
                # Émotions et réactions
                'fa-heart', 'fa-heart-broken', 'fa-smile', 'fa-frown', 'fa-meh',
                'fa-grin', 'fa-grin-alt', 'fa-grin-beam', 'fa-grin-hearts', 'fa-grin-squint',
                'fa-grin-squint-tears', 'fa-grin-stars', 'fa-grin-tears', 'fa-grin-tongue',
                'fa-grin-tongue-squint', 'fa-grin-tongue-wink', 'fa-grin-wink',
                'fa-sad-tear', 'fa-sad-cry', 'fa-angry', 'fa-dizzy', 'fa-surprise',
                'fa-tired', 'fa-kiss', 'fa-kiss-beam', 'fa-kiss-wink-heart', 'fa-laugh',
                'fa-laugh-beam', 'fa-laugh-squint', 'fa-laugh-wink', 'fa-grimace',
                
                # Évaluation et notation
                'fa-star', 'fa-star-half', 'fa-thumbs-up', 'fa-thumbs-down',
                'fa-hand-point-up', 'fa-hand-point-down', 'fa-hand-point-left', 'fa-hand-point-right',
                
                # Communication et médias
                'fa-eye', 'fa-eye-slash', 'fa-comment', 'fa-comments', 'fa-comment-alt',
                'fa-comment-dots', 'fa-comment-slash', 'fa-comment-medical', 'fa-comment-dollar',
                'fa-envelope', 'fa-envelope-open', 'fa-envelope-square', 'fa-paper-plane',
                'fa-bell', 'fa-bell-slash', 'fa-phone', 'fa-phone-square', 'fa-phone-volume',
                
                # Temps et calendrier
                'fa-calendar', 'fa-calendar-alt', 'fa-calendar-check', 'fa-calendar-plus',
                'fa-calendar-minus', 'fa-calendar-times', 'fa-calendar-day', 'fa-calendar-week',
                'fa-calendar-month', 'fa-clock', 'fa-hourglass', 'fa-hourglass-start',
                'fa-hourglass-half', 'fa-hourglass-end', 'fa-stopwatch', 'fa-history',
                
                # Fichiers et dossiers
                'fa-file', 'fa-file-alt', 'fa-file-archive', 'fa-file-audio', 'fa-file-code',
                'fa-file-csv', 'fa-file-excel', 'fa-file-image', 'fa-file-pdf', 'fa-file-powerpoint',
                'fa-file-video', 'fa-file-word', 'fa-folder', 'fa-folder-open', 'fa-folder-plus',
                'fa-folder-minus', 'fa-folder-times', 'fa-folder-check',
                
                # Médias et contenu
                'fa-image', 'fa-images', 'fa-video', 'fa-video-slash', 'fa-music',
                'fa-play-circle', 'fa-pause-circle', 'fa-stop-circle', 'fa-play',
                'fa-pause', 'fa-stop', 'fa-forward', 'fa-backward', 'fa-fast-forward',
                'fa-fast-backward', 'fa-step-forward', 'fa-step-backward',
                'fa-volume-up', 'fa-volume-down', 'fa-volume-mute', 'fa-volume-off',
                'fa-microphone', 'fa-microphone-slash', 'fa-camera', 'fa-camera-retro',
                
                # Marqueurs et indicateurs
                'fa-bookmark', 'fa-flag', 'fa-flag-checkered', 'fa-tag', 'fa-tags',
                'fa-certificate', 'fa-award', 'fa-trophy', 'fa-medal', 'fa-badge',
                'fa-circle', 'fa-square', 'fa-dot-circle', 'fa-square-full',
                'fa-clipboard', 'fa-clipboard-list', 'fa-clipboard-check', 'fa-clipboard-copy',
                
                # Formes et éléments visuels
                'fa-circle', 'fa-square', 'fa-dot-circle', 'fa-square-full',
                'fa-circle-notch', 'fa-dot-circle', 'fa-circle-dot', 'fa-circle-half-stroke',
                'fa-square', 'fa-square-full', 'fa-square-check', 'fa-square-minus',
                'fa-square-plus', 'fa-square-xmark', 'fa-square-arrow-up-right',
                
                # Interface et navigation
                'fa-window-maximize', 'fa-window-minimize', 'fa-window-restore', 'fa-window-close',
                'fa-compass', 'fa-map', 'fa-map-marker-alt', 'fa-map-pin', 'fa-map-signs',
                'fa-route', 'fa-location-arrow', 'fa-crosshairs', 'fa-bullseye',
                
                # État et statut
                'fa-spinner', 'fa-sync', 'fa-sync-alt', 'fa-redo', 'fa-redo-alt',
                'fa-undo', 'fa-undo-alt', 'fa-rotate', 'fa-rotate-left', 'fa-rotate-right',
                'fa-rotate-180', 'fa-rotate-270', 'fa-rotate-90', 'fa-rotate-back',
                'fa-rotate-backward', 'fa-rotate-forward', 'fa-rotate-left', 'fa-rotate-right',
                
    
            ]
            
            self.create_icons_in_group(far_group, far_icons, 'far')
        
        # Icônes FontAwesome 5/6 Brands (fab) - Marques populaires
        fab_group = next((g for g in icon_groups if g.libelle == 'fab'), None)
        if fab_group:
            fab_icons = [
                # Réseaux sociaux majeurs
                'fa-facebook', 'fa-facebook-f', 'fa-facebook-messenger', 'fa-facebook-square',
                'fa-twitter', 'fa-twitter-square', 'fa-instagram', 'fa-instagram-square',
                'fa-linkedin', 'fa-linkedin-in', 'fa-linkedin-square', 'fa-youtube',
                'fa-youtube-square', 'fa-tiktok', 'fa-snapchat', 'fa-snapchat-ghost',
                'fa-snapchat-square', 'fa-pinterest', 'fa-pinterest-p', 'fa-pinterest-square',
                
                # Plateformes de développement
                'fa-github', 'fa-github-alt', 'fa-github-square', 'fa-gitlab', 'fa-git',
                'fa-bitbucket', 'fa-stack-overflow', 'fa-codepen', 'fa-jsfiddle',
                'fa-rebel', 'fa-empire', 'fa-git-square', 'fa-git-alt',
                
                # Services Google
                'fa-google', 'fa-google-plus', 'fa-google-plus-square', 'fa-google-drive',
                'fa-google-play', 'fa-google-wallet', 'fa-chrome', 'fa-firefox',
                'fa-safari', 'fa-edge', 'fa-internet-explorer', 'fa-opera',
                
                # Entreprises technologiques
                'fa-apple', 'fa-apple-pay', 'fa-microsoft', 'fa-windows', 'fa-xbox',
                'fa-amazon', 'fa-aws', 'fa-adobe', 'fa-adobe-creative-cloud',
                'fa-adobe-acrobat-reader', 'fa-adobe-photoshop', 'fa-adobe-illustrator',
                'fa-adobe-indesign', 'fa-adobe-premiere-pro', 'fa-adobe-after-effects',
                
                # Services de streaming et médias
                'fa-spotify', 'fa-netflix', 'fa-hulu', 'fa-disney-plus', 'fa-hbo',
                'fa-vimeo', 'fa-vimeo-square', 'fa-vimeo-v', 'fa-dailymotion',
                'fa-soundcloud', 'fa-mixcloud', 'fa-deezer', 'fa-tidal',
                
                # Messagerie et communication
                'fa-whatsapp', 'fa-whatsapp-square', 'fa-telegram', 'fa-telegram-plane',
                'fa-discord', 'fa-slack', 'fa-slack-hash', 'fa-skype',
                'fa-skype-for-business', 'fa-zoom', 'fa-teams', 'fa-slack',
                
               
                
                # Paiements et e-commerce
                'fa-paypal', 'fa-stripe', 'fa-cc-visa', 'fa-cc-mastercard',
                'fa-cc-amex', 'fa-cc-discover', 'fa-cc-jcb', 'fa-cc-diners-club',
                'fa-bitcoin', 'fa-ethereum', 'fa-litecoin', 'fa-dogecoin',
                'fa-cc-apple-pay', 'fa-cc-paypal', 'fa-cc-stripe',
                
                # CMS et plateformes web
                'fa-wordpress', 'fa-wordpress-simple', 'fa-drupal', 'fa-joomla',
                'fa-magento', 'fa-opencart', 'fa-prestashop', 'fa-woocommerce',
                'fa-shopify', 'fa-squarespace', 'fa-wix', 'fa-webflow',
                
                # Outils de développement
                'fa-node-js', 'fa-react', 'fa-angular', 'fa-vue-js',
                'fa-bootstrap', 'fa-sass', 'fa-less', 'fa-npm',
                'fa-yarn', 'fa-docker', 'fa-kubernetes', 'fa-aws',
                'fa-digital-ocean', 'fa-heroku', 'fa-vercel', 'fa-netlify',
                
                # Réseaux professionnels
                'fa-stack-exchange', 'fa-stack-overflow', 'fa-reddit', 'fa-reddit-alien',
                'fa-reddit-square', 'fa-quora', 'fa-medium', 'fa-medium-m',
                'fa-dev', 'fa-hashnode', 'fa-substack', 'fa-newsletter',
                
                # Services de design et créativité
                'fa-behance', 'fa-behance-square', 'fa-dribbble', 'fa-dribbble-square',
                'fa-figma', 'fa-sketch', 'fa-invision', 'fa-framer',
               'fa-unsplash', 'fa-500px', 'fa-flickr',
                
               
           
            ]
            
            self.create_icons_in_group(fab_group, fab_icons, 'fab')

    def create_icons_in_group(self, group, icon_names, group_prefix):
        """Créer les icônes dans un groupe spécifique"""
        for icon_name in icon_names:
            # Enlever le préfixe du groupe si présent
            if icon_name.startswith('fa-'):
                libelle = icon_name
            else:
                libelle = f'fa-{icon_name}'
            
            icon, created = Icon.objects.get_or_create(
                group=group,
                libelle=libelle
            )
            
            if created:
                self.stdout.write(f'  ➕ Icône créée: {group.libelle} {libelle}')
            else:
                self.stdout.write(f'  ℹ️  Icône existante: {group.libelle} {libelle}')
