<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{{ project_name }} - AutoML Report</title>
    <style>
        body { font-family: Arial, sans-serif; margin: 20px; }
        h1 { color: #2c3e50; }
        h2 { color: #34495e; }
        table { border-collapse: collapse; width: 60%; margin-bottom: 20px; }
        th, td { border: 1px solid #ccc; padding: 8px; text-align: center; }
        th { background-color: #f2f2f2; }
        img { max-width: 600px; margin: 10px 0; }
        .section { margin-bottom: 40px; }
    </style>
</head>
<body>
    <h1>{{ project_name }} - AutoML Report</h1>
    <p><strong>Generated on:</strong> {{ date }}</p>

    <div class="section">
        <h2>Model Information</h2>
        <p><strong>Best Model:</strong> {{ model_info.name }}</p>
        <p><strong>Parameters:</strong></p>
        <pre>{{ model_info.params }}</pre>
    </div>

    <div class="section">
        <h2>Evaluation Metrics</h2>
        <table>
            <tr>
                <th>Metric</th>
                <th>Value</th>
            </tr>
            {% for key, value in metrics.items() %}
            <tr>
                <td>{{ key }}</td>
                <td>{{ "%.4f"|format(value) }}</td>
            </tr>
            {% endfor %}
        </table>
    </div>

    <div class="section">
        <h2>Evaluation Plots</h2>
        {% for plot in plots %}
            <img src="{{ plot }}" alt="plot">
        {% endfor %}
    </div>

    <div class="section">
        <h2>EDA Report</h2>
        {% if eda_report %}
            <iframe src="{{ eda_report }}" width="100%" height="600px"></iframe>
        {% else %}
            <p>No EDA report available.</p>
        {% endif %}
    </div>
</body>
</html>
