<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>TargetViz Report</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
            margin: 0;
            padding: 20px;
        }
        h1, h2 {
            color: #333;
        }
        .img-responsive {
            max-width: 100%;
            height: auto;
        }
        .center-img {
            display: block;
            margin-left: auto;
            margin-right: auto;
        }
        .flex-container {
            display: flex;
            justify-content: space-between;
        }
        .histogram {
            width: 48%;
        }
        .table-container {
            width: 48%;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9em; /* Slightly reduce font size */
        }
        th, td {
            border: 1px solid #ddd;
            padding: 4px; /* Reduce padding */
            text-align: left;
            line-height: 1.2; /* Reduce line height */
        }
        th {
            background-color: #f2f2f2;
        }
    </style>
</head>
<body>
    <h1>Analysis of the Relationship of Variables to a Target Variable</h1>

    <div>
        {% block content %}
        <h2>TARGET</h2>
        <div class="flex-container">
            <div class="histogram">
                {% block target_histogram %}
                <img class="img-responsive center-img" src="{{ result_dict.target_histogram }}" alt="Target Variable Histogram" style="width:100%;">
                {% endblock target_histogram %}
            </div>
            <div class="table-container">
                {% block target_table %}
                {{ result_dict.target_table | safe }}
                {% endblock target_table %}
            </div>
        </div>
        {% endblock %}
    </div>
</body>
</html>
