{% extends "admin/base_site.html" %}
{% load static %}

{% block title %}{{ page_title }} | Django Admin{% endblock %}

{% block content %}
<div class="debug-console">
    <h1>{{ page_title }}</h1>
    
    <div class="debug-header" style="margin: 20px 0; padding: 20px; border-radius: 8px; background: #fff3cd; border: 1px solid #ffeaa7;">
        <p style="margin: 0; color: #856404;">
            <strong>⚠ Read-Only Debug Information</strong><br>
            This page displays system configuration for debugging purposes. No sensitive data (passwords, API keys) is shown.
        </p>
        <p style="margin: 10px 0 0 0; color: #666; font-size: 14px;">
            Last checked: {{ checked_at|date:"Y-m-d H:i:s" }}
        </p>
    </div>
    
    {% for section in sections %}
    <div class="debug-section" style="margin: 20px 0; padding: 20px; border: 1px solid #ddd; border-radius: 8px; background: #fff;">
        <h3 style="margin: 0 0 15px 0; font-size: 18px; color: #333; padding-bottom: 10px; border-bottom: 2px solid #007bff;">
            {{ section.title }}
        </h3>
        
        <table style="width: 100%; border-collapse: collapse;">
            {% for key, value in section.items.items %}
            <tr style="border-bottom: 1px solid #f0f0f0;">
                <td style="padding: 12px 10px; color: #666; width: 250px; font-weight: 600;">{{ key }}:</td>
                <td style="padding: 12px 10px; font-family: monospace; color: #333; word-break: break-all;">
                    {% if value is True %}
                        <span style="color: #28a745; font-weight: bold;">✓ True</span>
                    {% elif value is False %}
                        <span style="color: #dc3545; font-weight: bold;">✗ False</span>
                    {% elif value is None %}
                        <span style="color: #6c757d;">None</span>
                    {% else %}
                        {{ value }}
                    {% endif %}
                </td>
            </tr>
            {% endfor %}
        </table>
    </div>
    {% endfor %}
    
    <div style="margin: 20px 0; padding: 15px; background: #f8f9fa; border-radius: 8px;">
        <p style="margin: 0; color: #666; font-size: 14px;">
            <strong>Security Note:</strong> This console does not display sensitive information like API keys or passwords.
            For full configuration details, access the Django settings file directly on the server.
        </p>
    </div>
</div>

<style>
.debug-console {
    max-width: 1200px;
    margin: 0 auto;
}
</style>
{% endblock %}
