/* Documentation vitrine — extrait du bloc <style> historique de
   templates/bo/documentation.html.twig, rattaché aux jetons (tokens.css).
   Les hexadécimaux restants sont des accents hors échelle, conservés à
   l'identique (les migrer changerait le rendu). */

        /* Hero Section */
        .doc-hero {
            background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
            padding: 80px 0 50px;
            position: relative;
            overflow: hidden;
        }

        .doc-hero::before {
            content: '';
            position: absolute;
            top: 10%;
            left: 5%;
            width: 100px;
            height: 100px;
            background: rgba(255,255,255,0.1);
            border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
            animation: float 6s ease-in-out infinite;
        }

        .doc-hero::after {
            content: '';
            position: absolute;
            bottom: 10%;
            right: 10%;
            width: 150px;
            height: 150px;
            background: rgba(255,255,255,0.1);
            border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
            animation: float 8s ease-in-out infinite;
        }

        @keyframes float {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-20px); }
        }

        .documentation-container {
            background: #f8f9fa;
            padding: 40px 0 80px;
        }

        /* Layout avec sidebar */
        .doc-layout {
            display: grid;
            grid-template-columns: 280px minmax(0, 1fr);
            gap: 30px;
            position: relative;
        }

        .doc-layout > * { min-width: 0; }

        /* Sidebar navigation */
        .doc-sidebar {
            position: sticky;
            top: 20px;
            height: fit-content;
            max-height: calc(100vh - 100px);
            overflow-y: auto;
            background: white;
            border-radius: 16px;
            padding: 24px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        }

        .doc-sidebar::-webkit-scrollbar {
            width: 6px;
        }

        .doc-sidebar::-webkit-scrollbar-track {
            background: var(--color-surface-alt);
            border-radius: 10px;
        }

        .doc-sidebar::-webkit-scrollbar-thumb {
            background: var(--color-border-strong);
            border-radius: 10px;
        }

        .doc-sidebar::-webkit-scrollbar-thumb:hover {
            background: var(--color-text-muted);
        }

        .sidebar-title {
            font-size: 0.875rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--color-text-light);
            margin-bottom: 16px;
        }

        /* Champ de recherche */
        .doc-search {
            position: relative;
            margin-bottom: 24px;
        }

        .doc-search input {
            width: 100%;
            padding: 10px 16px 10px 40px;
            border: 2px solid var(--color-border);
            border-radius: 8px;
            /* Mobile d'abord : sous 16px, Safari iOS zoome au focus et ne dézoome pas */
            font-size: 1rem;
            transition: all 0.3s;
        }

        @media (min-width: 992px) {
            .doc-search input { font-size: 0.875rem; }
        }

        .doc-search input:focus {
            outline: none;
            border-color: var(--color-primary);
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        .doc-search i {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--color-text-muted);
        }

        /* Table des matières */
        .doc-toc {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .doc-toc-item {
            margin-bottom: 8px;
        }

        .doc-toc-link {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            color: var(--color-text-light);
            text-decoration: none;
            border-radius: 6px;
            font-size: 0.875rem;
            transition: all 0.2s;
            font-weight: 500;
        }

        .doc-toc-link:hover {
            background: var(--color-surface-alt);
            color: var(--color-primary);
        }

        .doc-toc-link.active {
            background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
            color: white;
        }

        .doc-toc-link i {
            font-size: 0.75rem;
            opacity: 0.6;
        }

        .doc-toc-link.active i {
            opacity: 1;
        }

        /* Main content */
        .doc-content {
            background: white;
            border-radius: 16px;
            padding: 48px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
            line-height: 1.7;
            min-height: 70vh;
            /* Zoom texte 200 % : mots longs et libellés techniques se coupent
               proprement au lieu de déborder de leur bloc. */
            overflow-wrap: break-word;
        }

        /* Section accordion */
        .doc-section {
            margin-bottom: 32px;
            border: 2px solid var(--color-border);
            border-radius: 12px;
            overflow: hidden;
            transition: all 0.3s;
        }

        .doc-section.active {
            border-color: var(--color-primary);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
        }

        .doc-section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 20px 24px;
            background: var(--color-surface);
            cursor: pointer;
            transition: all 0.3s;
            border: none;
            width: 100%;
            text-align: left;
        }

        .doc-section.active .doc-section-header {
            background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
            color: white;
        }

        .doc-section-header:hover {
            background: var(--color-surface-alt);
        }

        .doc-section.active .doc-section-header:hover {
            background: linear-gradient(135deg, #5568d3 0%, #6a3f8c 100%);
        }

        .doc-section-title {
            display: flex;
            align-items: center;
            gap: 12px;
            margin: 0;
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--color-text);
        }

        .doc-section.active .doc-section-title {
            color: white;
        }

        .doc-section-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            background: white;
            border-radius: 8px;
            color: var(--color-primary);
            font-size: 1.125rem;
        }

        .doc-section.active .doc-section-icon {
            background: rgba(255, 255, 255, 0.2);
            color: white;
        }

        .doc-section-toggle {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            background: white;
            border-radius: 50%;
            color: var(--color-primary);
            transition: transform 0.3s;
        }

        .doc-section.active .doc-section-toggle {
            transform: rotate(180deg);
            background: rgba(255, 255, 255, 0.2);
            color: white;
        }

        .doc-section-body {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.5s ease-out;
        }

        .doc-section.active .doc-section-body {
            max-height: 50000px;
            transition: max-height 0.8s ease-in;
        }

        .doc-section-content {
            padding: 32px 24px;
        }

        /* Markdown styling */
        .doc-content h1 {
            color: var(--color-text);
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 3px solid var(--color-primary);
        }

        .doc-content h2 {
            color: #334155;
            font-size: 1.875rem;
            font-weight: 600;
            margin-top: 2.5rem;
            margin-bottom: 1rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid var(--color-border);
        }

        .doc-content h3 {
            color: #475569;
            font-size: 1.5rem;
            font-weight: 600;
            margin-top: 2rem;
            margin-bottom: 0.75rem;
        }

        .doc-content h4 {
            color: var(--color-text-light);
            font-size: 1.25rem;
            font-weight: 600;
            margin-top: 1.5rem;
            margin-bottom: 0.5rem;
        }

        .doc-content p {
            margin-bottom: 1rem;
            color: #475569;
        }

        .doc-content ul, .doc-content ol {
            margin-bottom: 1rem;
            padding-left: 2rem;
        }

        .doc-content li {
            margin-bottom: 0.5rem;
            color: #475569;
        }

        .doc-content code {
            background: var(--color-surface-alt);
            padding: 3px 8px;
            border-radius: 4px;
            font-family: 'Monaco', 'Courier New', monospace;
            font-size: 0.9em;
            color: #e11d48;
        }

        .doc-content pre {
            background: var(--color-text);
            color: var(--color-border);
            padding: 24px;
            border-radius: 12px;
            overflow-x: auto;
            margin-bottom: 1.5rem;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }

        .doc-content pre code {
            background: transparent;
            color: var(--color-border);
            padding: 0;
        }

        .doc-content table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 1.5rem;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
            border-radius: 8px;
            overflow: hidden;
        }

        .doc-content table th,
        .doc-content table td {
            padding: 12px 16px;
            border: 1px solid var(--color-border);
            text-align: left;
        }

        .doc-content table th {
            background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
            font-weight: 600;
            color: white;
            border: none;
        }

        .doc-content blockquote {
            border-left: 4px solid var(--color-primary);
            padding-left: 20px;
            margin-left: 0;
            margin-right: 0;
            padding: 16px 20px;
            background: var(--color-surface);
            border-radius: 0 8px 8px 0;
            color: var(--color-text-light);
            font-style: italic;
        }

        .doc-content hr {
            border: none;
            border-top: 2px solid var(--color-border);
            margin: 3rem 0;
        }

        .doc-content a {
            color: var(--color-primary);
            text-decoration: none;
            font-weight: 500;
            transition: color 0.2s;
        }

        .doc-content a:hover {
            color: var(--color-secondary);
            text-decoration: underline;
        }

        .back-link {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 12px 24px;
            background: white;
            color: var(--color-primary);
            text-decoration: none;
            font-weight: 600;
            border-radius: 50px;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
            transition: all 0.3s;
            margin-bottom: 30px;
        }

        .back-link:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
            background: var(--color-primary);
            color: white;
        }

        /* Message pas de résultats */
        .no-results {
            display: none;
            padding: 20px;
            text-align: center;
            color: var(--color-text-light);
            background: var(--color-surface);
            border-radius: 8px;
            margin-top: 16px;
        }

        .no-results.show {
            display: block;
        }

        /* Classes utilitaires Bootstrap employées dans le balisage de cette page :
           le layout vitrine ne charge pas Bootstrap, elles étaient sans effet. */
        .me-2 { margin-inline-end: 0.5rem; }
        .mb-2 { margin-bottom: 0.5rem; }
        .mb-0 { margin-bottom: 0; }

        /* Message d'erreur quand le fichier de documentation est absent : sans
           Bootstrap, `alert alert-warning` ne peignait rien du tout. */
        .alert {
            display: flex;
            align-items: flex-start;
            gap: var(--primitive-space-2);
            padding: var(--primitive-space-4);
            border-radius: var(--radius-md);
            border: 1px solid transparent;
        }
        .alert-warning {
            background: var(--color-warning-light);
            border-color: var(--color-warning);
            color: var(--primitive-amber-600);
        }

        /* Highlight search results */
        .highlight {
            background: #fef3c7;
            padding: 2px 4px;
            border-radius: 3px;
        }

        /* Smooth scrolling */
        html {
            scroll-behavior: smooth;
        }

        /* Responsive */
        @media (max-width: 992px) {
            .doc-layout {
                grid-template-columns: minmax(0, 1fr);
            }

            .doc-sidebar {
                position: relative;
                top: 0;
                max-height: none;
                margin-bottom: 20px;
            }

            .doc-content {
                padding: 32px 24px;
            }
        }

        @media (max-width: 768px) {
            .doc-hero {
                padding: 60px 0 40px;
            }

            .documentation-container {
                padding: 30px 15px 60px;
            }

            .doc-content {
                padding: 24px 16px;
                border-radius: 12px;
            }

            .doc-content h1 {
                font-size: 2rem;
            }

            .doc-content h2 {
                font-size: 1.5rem;
            }

            .doc-content h3 {
                font-size: 1.25rem;
            }

            .doc-section-header {
                padding: 16px;
            }

            .doc-section-title {
                font-size: 1.125rem;
            }

            .doc-section-content {
                padding: 24px 16px;
            }
        }

        /* ==========================================
           Widget Catalog Styles
           ========================================== */
        .widget-catalog {
            margin-bottom: 2rem;
        }

        .widget-catalog-title {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--color-text);
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .widget-catalog-title i {
            color: var(--color-primary);
        }

        .widget-filters {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
        }

        .widget-filter-btn {
            padding: 0.4rem 1rem;
            border-radius: 20px;
            border: 2px solid var(--color-border);
            background: white;
            color: var(--color-text-light);
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .widget-filter-btn:hover {
            border-color: var(--color-primary);
            color: var(--color-primary);
        }

        .widget-filter-btn.active {
            background: var(--color-primary);
            border-color: var(--color-primary);
            color: white;
        }

        .widget-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .widget-card {
            background: white;
            border: 2px solid var(--color-border);
            border-radius: 12px;
            padding: 1.25rem;
            cursor: pointer;
            transition: all 0.25s ease;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .widget-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0,0,0,0.1);
            border-color: var(--color-border-strong);
        }

        .widget-card.active {
            border-color: var(--color-primary);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
        }

        .widget-card-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .widget-card-icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            flex-shrink: 0;
        }

        .widget-card-name {
            font-weight: 700;
            font-size: 0.95rem;
            color: var(--color-text);
        }

        .widget-card-desc {
            font-size: 0.82rem;
            color: var(--color-text-light);
            line-height: 1.4;
        }

        .widget-card-badge {
            display: inline-block;
            padding: 0.15rem 0.6rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            align-self: flex-start;
        }

        /* Category colors */
        .cat-contenu .widget-card-icon { background: rgba(102, 126, 234, 0.12); color: var(--color-primary); }
        .cat-contenu .widget-card-badge { background: rgba(102, 126, 234, 0.12); color: var(--color-primary); }
        .cat-interactif .widget-card-icon { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
        .cat-interactif .widget-card-badge { background: rgba(245, 158, 11, 0.12); color: #d97706; }
        .cat-social .widget-card-icon { background: rgba(16, 185, 129, 0.12); color: #10b981; }
        .cat-social .widget-card-badge { background: rgba(16, 185, 129, 0.12); color: #059669; }
        .cat-media .widget-card-icon { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
        .cat-media .widget-card-badge { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
        .cat-ecommerce .widget-card-icon { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
        .cat-ecommerce .widget-card-badge { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

        .widget-detail-panel {
            background: var(--color-surface);
            border: 2px solid var(--color-border);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            display: none;
            animation: slideDown 0.3s ease;
        }

        .widget-detail-panel.show {
            display: block;
        }

        .widget-detail-panel h4 {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1rem;
            font-size: 1.1rem;
        }

        .widget-detail-close {
            margin-left: auto;
            background: none;
            border: none;
            color: var(--color-text-muted);
            cursor: pointer;
            font-size: 1.2rem;
            padding: 0.25rem;
        }

        .widget-detail-close:hover {
            color: #475569;
        }

        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .widget-count {
            font-size: 0.85rem;
            color: var(--color-text-muted);
            font-weight: 400;
            margin-left: 0.5rem;
        }

        @media (max-width: 992px) {
            .widget-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 576px) {
            .widget-grid {
                grid-template-columns: 1fr;
            }
            .widget-filters {
                gap: 0.35rem;
            }
            .widget-filter-btn {
                padding: 0.3rem 0.75rem;
                font-size: 0.8rem;
            }
        }
