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

{% block title %}Changelogs{% endblock %}

{% block content %}
{% if session['theme'] == 'darkmode' %}
<style>
    .changelog-list-outer {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 60px;
    }
    .changelog-list-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: 700px;
        width: 100%;
        min-height: 300px;
        max-height: 500px;
        overflow-y: auto;
    }
    .changelog-list-container h2 {
        color: #00fff7;
        margin-bottom: 20px;
        text-align: center;
    }
    .changelog-item {
        background: rgba(40, 40, 40, 0.9);
        margin-bottom: 16px;
        padding: 14px 18px;
        border-radius: 8px;
        text-align: left;
        white-space: pre-wrap;
        color: white;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    .changelog-item .timestamp {
        font-size: 12px;
        color: #aaa;
        align-self: flex-end;
        margin-bottom: -4px;
    }
    .changelog-item .message {
        font-size: 15px;
        color: #ddd;
        margin: 0;
        line-height: 1.4;
    }
    .back-btn-row {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-bottom: 18px;
    }
    .back-button-dark {
        display: inline-block;
        text-align: center;
        width: auto;
        padding: 14px 28px;
    }
</style>
<div class="changelog-list-outer">
    <div class="back-btn-row">
        <a href="{{ url_for('dashboard') }}" class="neon-button neon3 back-button-dark"><span>Zurück</span></a>
    </div>
    <div class="changelog-list-container">
        <h2>Website Changelogs</h2>
        {% for changelog in changelogs %}
            <div class="changelog-item">
                <span class="timestamp">{{ changelog.timestamp }}</span>
                <div class="message">{{ changelog.text }}</div>
            </div>
        {% endfor %}
    </div>
</div>
{% else %}
<style>
    .changelog-list-outer {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 60px;
    }
    .changelog-list-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: 700px;
        width: 100%;
        min-height: 300px;
        max-height: 500px;
        overflow-y: auto;
    }
    .changelog-list-container h2 {
        color: #007BFF;
        margin-bottom: 20px;
        text-align: center;
    }
    .changelog-item {
        background: rgba(180, 180, 180, 0.9);
        margin-bottom: 16px;
        padding: 14px 18px;
        border-radius: 8px;
        text-align: left;
        white-space: pre-wrap;
        color: #333;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    .changelog-item .timestamp {
        font-size: 12px;
        color: #555;
        align-self: flex-end;
        margin-bottom: -4px;
    }
    .changelog-item .message {
        font-size: 15px;
        color: #333;
        margin: 0;
        line-height: 1.4;
    }
    .back-btn-row {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-bottom: 18px;
    }
    .back-button {
        background-color: #007BFF;
        color: white;
        border: none;
        padding: 10px 15px;
        cursor: pointer;
        border-radius: 4px;
        width: auto;
        text-align: center;
        display: inline-block;
    }
    .back-button:hover {
        background-color: #0056b3;
    }
</style>
<div class="changelog-list-outer">
    <div class="back-btn-row">
        <a href="{{ url_for('dashboard') }}" class="back-button">Zurück</a>
    </div>
    <div class="changelog-list-container">
        <h2>Website Changelogs</h2>
        {% for changelog in changelogs %}
            <div class="changelog-item">
                <span class="timestamp">{{ changelog.timestamp }}</span>
                <div class="message">{{ changelog.text }}</div>
            </div>
        {% endfor %}
    </div>
</div>
{% endif %}
{% endblock %}
