{# Python code overlay component #}
{% if session.get('show_code') %}
<div id="pythonCodeOverlay" class="code-overlay bg-light border-start show">
    <div class="overlay-header d-flex justify-content-between align-items-center px-3 py-2 border-bottom">
        <strong>Python Code</strong>
        <button class="btn btn-sm btn-outline-secondary" onclick="toggleCodeOverlay(false)">
            <i class="bi bi-x-lg"></i>
        </button>
    </div>
    <div class="overlay-content p-3">
        {% for stype, script in session['python_code'].items() %}
            <pre><code class="language-python">{{ script }}</code></pre>
        {% endfor %}
        <a href="{{ url_for('design.design_files.download', filetype='python') }}">Download <i class="bi bi-download"></i></a>
    </div>
</div>
{% endif %} 