<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>QCP-Omics Report</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet">
    <style>
        * {
            font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
            color: #4f5c69;
        }

        h1 {
            color: #1a5d9a;
        }

        h2 {
            color: #2071b7;
        }

        h3, h4 {
            margin: 10px 0;
        }

        hr {
            color: #2071b7;
            border-width: 1px;
            opacity: 1;
        }

        tbody th:first-child {
            position: sticky;
            left: 0;
            z-index: 1;
        }

        thead th {
            position: sticky;
            top: 0;
            z-index: 2;
        }

        p {
            margin: 15px 0 10px 0;
        }

        #toc {
            position: sticky;
            top: 0;
            height: 100vh;
            overflow-y: auto;
            padding-top: 1rem;
        }

        #toc a {
            text-decoration: none;
            color: #1a5d9a;
        }

        #toc a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
<div class="container-fluid">
    <div class="row">
        <!-- Table of Contents -->
        <nav id="toc" class="col-md-3 bg-light border-end ">
            <h2 class="fs-6 text-center mt-3">Table of Contents</h2>
            <ul class="list-unstyled ps-3">
                {% for i in range(data | length) %}
                    <li>
                        <a href="#section-{{ i }}" class="d-block mb-1">
                            {{ i + 1 }}. {{ data[i].step | replace("_", " ") | capitalize }}
                        </a>
                    </li>
                {% endfor %}
            </ul>
        </nav>

        <!-- Report Content -->
        <main class="col-md-9">
            <h1 class="text-center mb-4 fs-4 mt-4">QCP-Omics Report</h1>
            {% for i in range(data | length) %}
                <section id="section-{{ i }}">
                    {% if data[i].step == "identify_missing_values" %}
                        {% include "quality_control/identify_missing_values.jinja" %}
                    {% elif data[i].step == "handle_missing_values" %}
                        {% include "quality_control/handle_missing_values.jinja" %}
                    {% elif data[i].step == "handle_outliers" %}
                        {% include "quality_control/handle_outliers.jinja" %}
                    {% elif data[i].step == "split_train_test" %}
                        {% include "preprocessing/split_train_test.jinja" %}
                    {% elif data[i].step == "split_numerical_categorical" %}
                        {% include "preprocessing/split_num_cat.jinja" %}
                    {% elif data[i].step == "scale_numerical_features" %}
                        {% include "preprocessing/scale_features.jinja" %}
                    {% elif data[i].step == "remove_highly_correlated_features" %}
                        {% include "preprocessing/handle_correlated_features.jinja" %}
                    {% elif data[i].step == "create_new_features" %}
                        {% include "preprocessing/create_new_features.jinja" %}
                    {% elif data[i].step == "transform_numerical_features" %}
                        {% include "preprocessing/transform_features.jinja" %}
                    {% elif data[i].step == "dimensionality_reduction" %}
                        {% include "preprocessing/dimensionality_reduction.jinja" %}
                    {% elif data[i].step == "descriptive_statistics" %}
                        {% include "analysis/descriptive_statistics.jinja" %}
                    {% elif data[i].step == "pairwise_correlations_numerical" %}
                        {% include "analysis/pairwise_correlations_numerical.jinja" %}
                    {% elif data[i].step == "evaluate_distribution_target" %}
                        {% include "analysis/evaluate_distribution_target.jinja" %}
                    {% elif data[i].step == "evaluate_distribution_features" %}
                        {% include "analysis/evaluate_distribution_features.jinja" %}
                    {% endif %}
                </section>
            {% endfor %}
        </main>
    </div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
