{% if session['theme'] == 'darkmode' %}
    {% extends "base_dark.html" %}
{% else %}
    {% extends "base.html" %}
{% endif %}

{% block title %}Logs{% endblock %}

{% block content %}
{% if session['theme'] == 'darkmode' %}
<style>
    .logs-container {
        background: rgba(20, 20, 20, 0.95);
        padding: 30px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.7);
        max-width: 800px;
        width: 100%;
        min-height: 300px;
        max-height: 80vh;
        overflow-y: auto;
        margin: 0 auto;
        text-align: center;
    }
    .log-entry {
        width: 100%;
        padding: 12px;
        margin: 8px 0;
        border-radius: 8px;
        background: rgba(40, 40, 40, 0.9);
        color: #fff;
        text-align: left;
    }
    .logs-back-btn-row {
        display: flex;
        justify-content: center;
        margin-bottom: 18px;
    }
    .logs-back-btn {
        display: inline-block;
        text-align: center;
        width: auto;
        padding: 14px 28px;
    }
</style>
<div style="display:flex; flex-direction:column; align-items:center; width:100%;">
    <div class="logs-back-btn-row">
        <a href="{{ url_for('dashboard') }}" class="neon-button neon3 logs-back-btn"><span>Zurück</span></a>
    </div>
    <div class="logs-container">
        <h2>Logs</h2>
        {% for log in logs %}
            <div class="log-entry">
                <p><strong>Datum:</strong> {{ log.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</p>
                <p><strong>Nachricht:</strong> {{ log.message }}</p>
            </div>
        {% endfor %}
    </div>
</div>
{% else %}
<style>
    .logs-container {
        background: rgba(255,255,255,0.9);
        padding: 30px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        max-width: 800px;
        width: 100%;
        min-height: 300px;
        max-height: 80vh;
        overflow-y: auto;
        margin: 0 auto;
        text-align: center;
    }
    .log-entry {
        width: 100%;
        padding: 12px;
        margin: 8px 0;
        border-radius: 8px;
        background: rgba(180, 180, 180, 0.9);
        color: #333;
        text-align: left;
    }
    .logs-back-btn-row {
        display: flex;
        justify-content: center;
        margin-bottom: 18px;
    }
    .logs-back-btn {
        background-color: #007BFF;
        color: white;
        border: none;
        padding: 10px 15px;
        cursor: pointer;
        border-radius: 4px;
        width: auto;
        text-align: center;
        display: inline-block;
        text-decoration: none;
    }
    .logs-back-btn:hover {
        background-color: #0056b3;
    }
</style>
<div style="display:flex; flex-direction:column; align-items:center; width:100%;">
    <div class="logs-back-btn-row">
        <a href="{{ url_for('dashboard') }}" class="logs-back-btn">Zurück</a>
    </div>
    <div class="logs-container">
        <h2>Logs</h2>
        {% for log in logs %}
            <div class="log-entry">
                <p><strong>Datum:</strong> {{ log.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</p>
                <p><strong>Nachricht:</strong> {{ log.message }}</p>
            </div>
        {% endfor %}
    </div>
</div>
{% endif %}
{% endblock %}
