<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}Association E-Cosplay{% endblock %}</title>
    {{ pwa() }}
    {% block meta %}
        <meta name="description" content="{% block description %}CRM E-Cosplay - Plateforme de gestion de la Association E-Cosplay{% endblock %}">
    {% endblock %}
    <script type="application/ld+json">
    {
        "@context": "https://schema.org",
        "@type": "Organization",
        "name": "CRM E-Cosplay",
        "url": "https://crm.e-cosplay.fr",
        "logo": "https://crm.e-cosplay.fr/logo.jpg",
        "email": "client@e-cosplay.fr",
        "telephone": "+33679348802",
        "address": {
            "@type": "PostalAddress",
            "streetAddress": "42 rue de Saint-Quentin",
            "addressLocality": "Saint-Quentin",
            "postalCode": "02100",
            "addressCountry": "FR"
        },
        "sameAs": [
            "https://www.e-cosplay.fr"
        ]
    }
    </script>
    <script type="application/ld+json">
    {
        "@context": "https://schema.org",
        "@type": "WebSite",
        "name": "CRM E-Cosplay",
        "url": "https://crm.e-cosplay.fr"
    }
    </script>
    {% if breadcrumbs is defined and breadcrumbs is not empty %}
    <script type="application/ld+json">
    {
        "@context": "https://schema.org",
        "@type": "BreadcrumbList",
        "itemListElement": [
            {% for breadcrumb in breadcrumbs %}
            {
                "@type": "ListItem",
                "position": {{ loop.index }},
                "name": {{ breadcrumb.name|json_encode|raw }}{% if not loop.last and breadcrumb.url is defined and breadcrumb.url is not empty %},
                "item": {{ absolute_url(breadcrumb.url)|json_encode|raw }}{% endif %}
            }{% if not loop.last %},{% endif %}
            {% endfor %}
        ]
    }
    </script>
    {% endif %}
    {% block og %}
        <meta property="og:title" content="{% block og_title %}{{ block('title') }}{% endblock %}">
        <meta property="og:description" content="{% block og_description %}{{ block('description') }}{% endblock %}">
        <meta property="og:type" content="{% block og_type %}website{% endblock %}">
        <meta property="og:url" content="{{ app.request.uri }}">
        <meta property="og:locale" content="fr_FR">
        <meta property="og:site_name" content="CRM E-Cosplay">
        {% block og_image %}
            <meta property="og:image" content="https://crm.e-cosplay.fr/logo.jpg">
        {% endblock %}
        <meta name="twitter:card" content="summary_large_image">
        <meta name="twitter:title" content="{{ block('og_title') }}">
        <meta name="twitter:description" content="{{ block('og_description') }}">
    {% endblock %}
    {% block stylesheets %}{% endblock %}
    {% block javascripts %}
        {{ vite_asset('app.js') }}
    {% endblock %}
    {% block head %}{% endblock %}
</head>
<body class="{% block body_class %}min-h-screen flex flex-col{% endblock %} glass-bg text-[#111827]">
    {% block header %}
    <header class="sticky top-0 z-50 glass-heavy" >
        <nav class="max-w-7xl mx-auto px-4 lg:px-8" role="navigation" aria-label="Navigation principale" itemscope itemtype="https://schema.org/SiteNavigationElement">
            <div class="flex justify-between items-center h-16">
                <div class="flex-shrink-0">
                    <a href="{{ path('app_home') }}" class="flex items-center group" aria-label="CRM E-Cosplay - Retour a l'accueil">
                        <img class="h-10 md:h-12 w-auto" src="{{ 'logo.jpg' | imagine_filter('navbar_logo') }}" alt="CRM E-Cosplay" loading="eager">
                    </a>
                </div>

                <div class="hidden lg:flex items-center gap-1">
                    {% set current_route = app.request.attributes.get('_route') %}
                    <a href="{{ path('app_home') }}" itemprop="url" class="px-4 py-2 text-xs font-bold uppercase tracking-wider transition-all {{ current_route == 'app_home' ? 'bg-[#fabf04] text-gray-900 shadow-[0_2px_12px_rgba(250,191,4,0.3)]' : 'text-gray-600 hover:text-gray-900 hover:bg-white/50' }}"><span itemprop="name">Accueil</span></a>
                </div>

                <div class="flex items-center gap-3">
                    {% if app.user %}
                        <a href="{{ path('app_espace_client_index') }}" class="btn-gold px-4 py-2 text-xs font-bold uppercase tracking-wider hidden lg:inline-flex">Espace Client</a>
                        <a href="{{ path('app_espace_prestataire_index') }}" class="btn-glass px-4 py-2 text-xs font-bold uppercase tracking-wider hidden lg:inline-flex">Espace Prestataire</a>
                        <a href="#" class="btn-glass p-2 flex items-center justify-center" aria-label="Mon compte">
                            <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/></svg>
                        </a>
                    {% else %}
                        <a href="{{ path('app_home') }}" class="btn-glass p-2 flex items-center justify-center" aria-label="Connexion">
                            <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/></svg>
                        </a>
                    {% endif %}

                    <button id="mobile-menu-btn" class="lg:hidden btn-gold p-2" aria-label="Ouvrir le menu de navigation" aria-expanded="false" aria-controls="mobile-menu">
                        <svg id="menu-icon-open" class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/></svg>
                        <svg id="menu-icon-close" class="w-5 h-5 hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/></svg>
                    </button>
                </div>
            </div>
        </nav>

        <div id="mobile-menu" class="hidden lg:hidden border-t border-white/20 px-4 pb-4" role="menu">
            <div class="pt-3 space-y-2">
                <a href="{{ path('app_home') }}" class="block px-4 py-3 text-sm font-bold {{ current_route == 'app_home' ? 'bg-[#fabf04] text-gray-900' : 'text-gray-700 hover:bg-white/50' }}" role="menuitem">Accueil</a>
                {% if app.user %}
                    <a href="{{ path('app_espace_client_index') }}" class="block px-4 py-3 text-sm font-bold text-gray-700 hover:bg-white/50" role="menuitem">Espace Client</a>
                    <a href="{{ path('app_espace_prestataire_index') }}" class="block px-4 py-3 text-sm font-bold text-gray-700 hover:bg-white/50" role="menuitem">Espace Prestataire</a>
                {% else %}
                    <a href="{{ path('app_home') }}" class="block px-4 py-3 text-sm font-bold bg-[#fabf04] text-gray-900 text-center" role="menuitem">Connexion</a>
                {% endif %}
            </div>
        </div>
    </header>
    {% endblock %}

    {% block main %}
    <main class="flex-1 {% block main_class %}{% endblock %}">
        {% block body %}{% endblock %}
    </main>
    {% endblock %}

    <footer class="bg-yellow-400 border-t-8 border-gray-900 text-gray-900 mt-auto">
        <div class="max-w-7xl mx-auto py-12 px-4 lg:px-8">
            <div class="grid grid-cols-1 md:grid-cols-3 gap-12 mb-12 border-b-4 border-gray-900 pb-12">
                <div class="space-y-4">
                    <h3 class="text-3xl font-black uppercase tracking-tighter italic border-b-4 border-gray-900 inline-block">Nous Contacter</h3>
                    <p class="font-bold text-lg leading-tight">42 RUE DE SAINT-QUENTIN<br>02800 BEAUTOR, FRANCE</p>
                    <a href="mailto:client@e-cosplay.fr" class="inline-block bg-gray-900 text-white px-4 py-2 font-black uppercase text-sm hover:bg-indigo-600 transition-colors">
                        client@e-cosplay.fr
                    </a>
                </div>

                <div class="space-y-6">
                    <h3 class="text-3xl font-black uppercase tracking-tighter italic border-b-4 border-gray-900 inline-block">Nous Suivre</h3>
                    <div class="flex gap-4">
                        <a href="https://www.facebook.com/assocationecosplay" class="w-12 h-12 border-4 border-gray-900 flex items-center justify-center hover:bg-white transition-all">
                            <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>
                        </a>
                        <a href="https://www.instagram.com/asso_ecosplay/" class="w-12 h-12 border-4 border-gray-900 flex items-center justify-center hover:bg-white transition-all">
                            <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"/></svg>
                        </a>
                    </div>
                </div>

                <div class="space-y-4">
                    <h3 class="text-3xl font-black uppercase tracking-tighter italic border-b-4 border-gray-900 inline-block">E-Cosplay</h3>
                    <p class="font-bold text-gray-800 italic leading-snug">
                        CRM E-Cosplay est la plateforme de gestion de l'association E-Cosplay.
                        Retrouvez vos factures, commandes et devis directement en un seul endroit.
                    </p>
                </div>
            </div>

            <div class="flex flex-col md:flex-row justify-between items-center gap-6">
                <div class="text-center md:text-left">
                    <p class="font-black uppercase text-sm">&copy; {{ "now"|date("Y") }} E-COSPLAY</p>
                    <p class="text-[10px] font-bold opacity-70">RNA N°W022006988</p>
                </div>
                <div class="flex flex-wrap justify-center gap-3">
                    <a href="{{ path('app_legal_mention_legal') }}" class="text-[10px] font-black uppercase bg-gray-900 text-white px-2 py-1 hover:bg-indigo-600 transition-colors">Mentions Legales</a>
                    <a href="{{ path('app_legal_cookie') }}" class="text-[10px] font-black uppercase bg-gray-900 text-white px-2 py-1 hover:bg-indigo-600 transition-colors">Cookies</a>
                    <a href="{{ path('app_legal_cgu') }}" class="text-[10px] font-black uppercase bg-gray-900 text-white px-2 py-1 hover:bg-indigo-600 transition-colors">CGU</a>
                    <a href="{{ path('app_legal_cgv') }}" class="text-[10px] font-black uppercase bg-gray-900 text-white px-2 py-1 hover:bg-indigo-600 transition-colors">CGV</a>
                    <a href="{{ path('app_legal_rgpd') }}" class="text-[10px] font-black uppercase bg-gray-900 text-white px-2 py-1 hover:bg-indigo-600 transition-colors">RGPD</a>
                    <a href="{{ path('app_legal_hebergement') }}" class="text-[10px] font-black uppercase bg-gray-900 text-white px-2 py-1 hover:bg-indigo-600 transition-colors">Hebergement</a>
                    <a href="{{ path('app_legal_tarif') }}" class="text-[10px] font-black uppercase bg-gray-900 text-white px-2 py-1 hover:bg-indigo-600 transition-colors">Tarifs</a>
                    <a href="{{ path('app_legal_conformite') }}" class="text-[10px] font-black uppercase bg-gray-900 text-white px-2 py-1 hover:bg-indigo-600 transition-colors">Conformite</a>
                    <a href="{{ path('app_status') }}" class="text-[10px] font-black uppercase bg-gray-900 text-white px-2 py-1 hover:bg-indigo-600 transition-colors">Status</a>
                </div>
            </div>
        </div>
    </footer>

    <div id="cookie-banner" class="hidden fixed bottom-4 left-4 right-4 z-50 glass-heavy p-4 max-w-4xl mx-auto">
        <div class="flex flex-col sm:flex-row items-center justify-between gap-4">
            <p class="text-sm text-gray-700">
                Ce site utilise des cookies pour mesurer l'audience. <a href="{{ path('app_legal_cookie') }}" class="text-indigo-600 underline hover:text-indigo-800">En savoir plus</a>
            </p>
            <div class="flex gap-2">
                <button id="cookie-refuse" class="btn-glass px-4 py-2 text-xs font-bold uppercase tracking-wider">Refuser</button>
                <button id="cookie-accept" class="btn-gold px-4 py-2 text-xs font-bold uppercase tracking-wider text-gray-900">Accepter</button>
            </div>
        </div>
    </div>
</body>
</html>
