{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @package    mod_exaaifeedback
    @copyright  2026 GTN Solutions https://gtn-solutions.com
    @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
}}
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    {{#font_url}}
        <link href="{{font_url}}" rel="stylesheet">
    {{/font_url}}
    <style>
        @page {
            margin: 14mm;
        }
        body {
            font-family: {{{font_family_css}}};
            font-size: 12px;
            line-height: {{line_height}};
        }
        h1 { font-size: 18px; }
        h2 { font-size: 16px; }
        h3 { font-size: 14px; }
        h2.with-line {
            font-size: 14px;
            color: #555;
            margin-top: 20px;
            margin-bottom: 10px;
            border-bottom: 1px solid #ccc;
            padding-bottom: 5px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }
        th, td {
            padding: 6px 10px;
            border: 1px solid #dee2e6;
            text-align: left;
            vertical-align: top;
            width: 50%;
        }
        th {
            background-color: #f5f5f5;
            font-weight: bold;
        }
        .ai-response { text-align: justify; }
        .subtitle { color: #555; margin-bottom: 20px; }
    </style>
</head>
<body>

<table style="width: 100%; border-collapse: collapse;">
    <tr>
        <td style="vertical-align: bottom; border: none; padding: 0;">
            <h1 style="margin: 0 0 5px 0;">{{title}}</h1>
            {{#username}}
                <div class="subtitle">{{username}}</div>
            {{/username}}
        </td>
        {{#logo}}
            <td style="width: 4cm; vertical-align: top; text-align: right; border: none; padding: 0; padding-left: 5mm;">
                <img src="{{logo}}" style="max-width: 4cm; max-height: 6cm;">
            </td>
        {{/logo}}
    </tr>
</table>

{{#description}}
    <div style="margin-top: 0; text-align: justify;">{{{description}}}</div>
{{/description}}

{{#answers_html}}
    <h2 class="with-line">{{answers_heading}}</h2>
    {{{answers_html}}}
    <h2 class="with-line" style="page-break-before: always;">{{title}}</h2>
{{/answers_html}}

<div class="ai-response">{{{response_html}}}</div>

</body>
</html>
