<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ module.name }} - STRACONX Documentation</title>
    <!-- Tabler Icons -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest/tabler-icons.min.css">
    <!-- Google Fonts: Outfit & Inter -->
    <link
        href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=Inter:wght@300;400;500;600&display=swap"
        rel="stylesheet">
    <style>
        :root {
            --strx-navy: #002B49;
            --strx-navy-light: #004e80;
            --strx-celeste: #3AB5E5;
            --strx-celeste-muted: rgba(58, 181, 229, 0.1);
            --strx-bg: #F8FAFC;
            --strx-white: #ffffff;
            --strx-text: #1e293b;
            --strx-text-light: #64748b;
            --border: #e2e8f0;
            --radius: 0px;
            --shadow: 0 4px 20px rgba(0, 43, 73, 0.05);
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Inter', sans-serif;
            color: var(--strx-text);
            background-color: var(--strx-white);
            line-height: 1.6;
        }

        h1,
        h2,
        h3,
        h4 {
            font-family: 'Outfit', sans-serif;
            color: var(--strx-navy);
            font-weight: 700;
        }

        .container {
            max-width: 1100px;
            margin: 0 auto;
            padding: 40px 20px;
        }

        /* --- NAVIGATION --- */
        .doc-navigation {
            display: flex;
            background: var(--strx-bg);
            padding: 8px;
            border-radius: 0px;
            margin-bottom: 40px;
            border: 1px solid var(--border);
            overflow-x: auto;
            gap: 5px;
            position: sticky;
            top: 20px;
            z-index: 100;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        }

        .nav-tab {
            flex: 1;
            padding: 12px 20px;
            border: none;
            background: transparent;
            color: var(--strx-text-light);
            font-family: 'Outfit', sans-serif;
            font-weight: 600;
            cursor: pointer;
            border-radius: 0px;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            white-space: nowrap;
        }

        .nav-tab i {
            font-size: 1.1rem;
        }

        .nav-tab:hover {
            color: var(--strx-navy);
            background: rgba(0, 43, 73, 0.05);
        }

        .nav-tab.active {
            background: var(--strx-navy);
            color: white;
            box-shadow: 0 4px 10px rgba(0, 43, 73, 0.2);
        }

        /* --- CONTENT SECTIONS --- */
        .tab-panel {
            display: none;
            animation: slideUp 0.4s ease-out;
        }

        .tab-panel.active {
            display: block;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .content-card {
            background: white;
            border: 1px solid var(--border);
            border-radius: 0px;
            padding: 40px;
            margin-bottom: 30px;
            box-shadow: var(--shadow);
        }

        .section-header {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 25px;
            border-bottom: 2px solid var(--strx-celeste-muted);
            padding-bottom: 15px;
        }

        .section-header i {
            background: var(--strx-celeste-muted);
            color: var(--strx-celeste);
            width: 45px;
            height: 45px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 0px;
            font-size: 1.5rem;
        }

        /* --- MARKDOWN STYLES --- */
        .markdown-content h2 {
            margin-top: 30px;
            margin-bottom: 15px;
            border-left: 4px solid var(--strx-celeste);
            padding-left: 15px;
        }

        .markdown-content h3 {
            margin-top: 25px;
            margin-bottom: 12px;
            color: var(--strx-navy-light);
        }

        .markdown-content p {
            margin-bottom: 15px;
            color: #475569;
            font-size: 1.05rem;
        }

        .markdown-content ul,
        .markdown-content ol {
            margin-left: 25px;
            margin-bottom: 20px;
        }

        .markdown-content li {
            margin-bottom: 10px;
            color: #475569;
        }

        .markdown-content code {
            background: #f1f5f9;
            padding: 3px 8px;
            border-radius: 0px;
            font-size: 0.9em;
            border: 1px solid #e2e8f0;
            color: #e11d48;
        }

        .markdown-content pre {
            background: #0f172a;
            color: #f8fafc;
            padding: 20px;
            border-radius: 0px;
            overflow-x: auto;
            margin-bottom: 20px;
        }

        /* --- SCREENSHOTS GRID --- */
        .screenshot-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 25px;
            margin-top: 30px;
        }

        .screenshot-item {
            border: 2px solid var(--border);
            border-radius: 0px;
            overflow: hidden;
            box-shadow: var(--shadow);
            background: white;
        }

        .screenshot-item img {
            width: 100%;
            display: block;
        }

        /* --- CHANGELOG LIST --- */
        .changelog-entry {
            border-left: 4px solid var(--strx-celeste);
            padding-left: 25px;
            margin-bottom: 40px;
            position: relative;
        }

        .changelog-version {
            display: inline-block;
            background: var(--strx-navy);
            color: white;
            padding: 4px 12px;
            border-radius: 0px;
            font-weight: 700;
            font-family: 'Outfit', sans-serif;
            margin-bottom: 15px;
            font-size: 1.1rem;
        }

        /* --- FOOTER --- */
        .doc-footer {
            margin-top: 60px;
            padding: 40px;
            background: var(--strx-navy);
            border-radius: 0px;
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .license-info {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .license-info i {
            font-size: 2.5rem;
            color: var(--strx-celeste);
        }

        .company-logo {
            height: 45px;
            width: auto;
            display: block;
        }

        @media (max-width: 900px) {
            .doc-navigation {
                flex-wrap: wrap;
                justify-content: center;
                gap: 8px;
                padding: 12px;
                position: relative;
                top: 0;
            }

            .nav-tab {
                flex: none;
                width: calc(50% - 10px);
                padding: 10px;
                font-size: 0.85rem;
                justify-content: flex-start;
            }

            .content-card {
                padding: 30px 20px;
            }

            .doc-footer {
                flex-direction: column;
                text-align: center;
                gap: 25px;
            }
        }
    </style>
</head>

<body>

    <div class="container">
        <!-- NAVIGATION -->
        <nav class="doc-navigation">
            <button class="nav-tab active" onclick="showPanel(this, 'panel-readme')"><i class="ti ti-info-circle"></i>
                Information</button>
            <button class="nav-tab" onclick="showPanel(this, 'panel-usage')"><i class="ti ti-rocket"></i> Usage</button>
            <button class="nav-tab" onclick="showPanel(this, 'panel-config')"><i class="ti ti-settings"></i>
                Configuration</button>
            <button class="nav-tab" onclick="showPanel(this, 'panel-dev')"><i class="ti ti-code"></i>
                Development</button>
            <button class="nav-tab" onclick="showPanel(this, 'panel-tests')"><i class="ti ti-checkbox"></i>
                Tests</button>
            <button class="nav-tab" onclick="showPanel(this, 'panel-history')"><i class="ti ti-history"></i>
                Changelog</button>
        </nav>

        <!-- PANEL: README -->
        <div id="panel-readme" class="tab-panel active">
            <div class="content-card">
                <div class="section-header"><i class="ti ti-file-description"></i>
                    <h2>General Description</h2>
                </div>
                <div class="markdown-content">{{ content.readme }}</div>
                {% if module.screenshots %}
                <h3 style="margin-top: 40px; margin-bottom: 20px;">Visual Gallery</h3>
                <div class="screenshot-grid">
                    {% for img in module.screenshots %}
                    <div class="screenshot-item"><img src="{{ img }}" alt="Screenshot"></div>
                    {% endfor %}
                </div>
                {% endif %}
            </div>
        </div>

        <!-- PANEL: USAGE -->
        <div id="panel-usage" class="tab-panel">
            <div class="content-card">
                <div class="section-header"><i class="ti ti-player-play"></i>
                    <h2>Usage Details</h2>
                </div>
                <div class="markdown-content">{{ content.usage }}</div>
            </div>
        </div>

        <!-- PANEL: CONFIGURATION -->
        <div id="panel-config" class="tab-panel">
            <div class="content-card">
                <div class="section-header"><i class="ti ti-adjustments-horizontal"></i>
                    <h2>Configuration Guide</h2>
                </div>
                <div class="markdown-content">{{ content.config }}</div>
            </div>
        </div>

        <!-- PANEL: DEVELOPMENT -->
        <div id="panel-dev" class="tab-panel">
            <div class="content-card">
                <div class="section-header"><i class="ti ti-terminal-2"></i>
                    <h2>Technical Reference</h2>
                </div>
                <div class="markdown-content">{{ content.development }}</div>
            </div>
        </div>

        <!-- PANEL: TESTS -->
        <div id="panel-tests" class="tab-panel">
            <div class="content-card">
                <div class="section-header"><i class="ti ti-test-pipe"></i>
                    <h2>Validation & Tests</h2>
                </div>
                <div class="markdown-content">{{ content.tests }}</div>
            </div>
        </div>

        <!-- PANEL: HISTORY -->
        <div id="panel-history" class="tab-panel">
            <div class="content-card">
                <div class="section-header"><i class="ti ti-list-check"></i>
                    <h2>Release History</h2>
                </div>
                <div class="changelog-list">{{ content.changelog }}</div>
            </div>
        </div>

        <!-- FOOTER -->
        <footer class="doc-footer">
            <div class="license-info">
                <i class="ti ti-certificate"></i>
                <div>
                    <h3 style="color:white; margin:0;">Odoo OPL-1 License</h3>
                    <p style="opacity:0.8; font-size: 0.85rem;">Author: {{ module.author }}</p>
                </div>
            </div>
            <div style="text-align: right;">
                <img src="/logo.png" class="company-logo" alt="STRACONX S.A."
                    onerror="this.src='https://initium.cloud/logo.svg';">
            </div>
        </footer>
    </div>

    <script>
        function showPanel(btn, panelId) {
            document.querySelectorAll('.nav-tab').forEach(b => b.classList.remove('active'));
            btn.classList.add('active');
            document.querySelectorAll('.tab-panel').forEach(p => p.classList.remove('active'));
            document.getElementById(panelId).classList.add('active');
        }
    </script>
</body>

</html>