{% extends "base_dark.html" %}

{% block title %}Dashboard (Dark Mode){% endblock %}

{% block content %}
<div class="dashboard-wrapper" style="max-width: 1200px; margin: 80px auto 30px auto;">
    <div class="dashboard-container" style="display: flex; justify-content: space-between; gap: 20px;">
        <style>
            .dashboard-box {
                background: rgba(30, 30, 30, 0.85);
                padding: 20px;
                border-radius: 8px;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
                width: 100%;
                max-width: 300px;
                text-align: center;
                display: flex;
                flex-direction: column;
                align-items: center;
            }
            .dashboard-box h3 {
                margin-bottom: 15px;
                color: #00fff7;
            }
            .dashboard-box form, .dashboard-box a {
                margin-bottom: 10px;
                width: 100%;
            }
            .dashboard-box button, .dashboard-box a {
                width: 100%;
                text-align: center;
            }
        </style>

        <div class="dashboard-box">
            <h3>Administration</h3>
            {% if 'user_management' in session['permissions'] %}
                <form action="{{ url_for('user_management') }}" method="get">
                    <button type="submit" class="neon-button neon1"><span>👤 User Management</span></button>
                </form>
            {% endif %}
            {% if 'delete_requests' in session['permissions'] %}
                <form action="{{ url_for('delete_requests') }}" method="get">
                    <button type="submit" class="neon-button neon3"><span>🗑️ Delete-Requests</span></button>
                </form>
            {% endif %}
            {% if 'logs' in session['permissions'] %}
                <form action="{{ url_for('logs') }}" method="get">
                    <button type="submit" class="neon-button"><span>📜 Logs</span></button>
                </form>
            {% endif %}
            {% if 'changelogs' in session['permissions'] %}
                <form action="{{ url_for('add_changelog') }}" method="get">
                    <button type="submit" class="neon-button neon1"><span>📝 Add-Changelog</span></button>
                </form>
            {% endif %}
            <form action="{{ url_for('view_changelogs') }}" method="get">
                <button type="submit" class="neon-button neon2"><span>📋 Changelogs</span></button>
            </form>
        </div>
        <div class="dashboard-box">
            <h3>Private Tools</h3>
            {% if 'discord_bots' in session['permissions'] %}
                <form action="{{ url_for('dc_bots') }}" method="get">
                    <button type="submit" class="neon-button neon2"><span>🤖 Discord Bots</span></button>
                </form>
            {% endif %}
            {% if 'appointments' in session['permissions'] %}
                <form action="{{ url_for('appointments') }}" method="get">
                    <button type="submit" class="neon-button neon1"><span>📅 Termin Planer</span></button>
                </form>
            {% endif %}
            {% if 'view_license_keys' in session['permissions'] %}
                <form action="{{ url_for('license_keys') }}" method="get">
                    <button type="submit" class="neon-button neon1"><span>🛡️ ML Cheat Scanner</span></button>
                </form>
            {% endif %}
        </div>
        <div class="dashboard-box">
            <h3>Moonlab Tools</h3>
            {% if 'intranet' in session['permissions'] %}
                <form action="https://intra.moon-lab.de" method="get" target="_blank">
                    <button type="submit" class="neon-button neon2"><span>🌐 Moonlab-Intranet</span></button>
                </form>
            {% endif %}
            {% if 'create_event_feedback' in session['permissions'] %}
                <form action="{{ url_for('event_feedback') }}" method="get">
                    <button type="submit" class="neon-button"><span>📝 Event Feedback</span></button>
                </form>
            {% endif %}
            {% if 'view_event_feedback' in session['permissions'] %}
                <form action="{{ url_for('view_event_feedbacks') }}" method="get">
                    <button type="submit" class="neon-button"><span>📊 Event Feedback ansehen</span></button>
                </form>
            {% endif %}
            {% if "verify_age" in session["permissions"] %}
                <form action="{{ url_for('verify_age') }}" method="get">
                    <button type="submit" class="neon-button neon3"><span>🎂 Altersüberprüfung</span></button>
                </form>
            {% endif %}
            {% if 'events' in session['permissions'] %}
                <form action="{{ url_for('events') }}" method="get">
                    <button type="submit" class="neon-button neon2"><span>🎉 Events</span></button>
                </form>
            {% endif %}
            {% if 'ip_checker' in session['permissions'] %}
                <form action="{{ url_for('ip_checker') }}" method="get">
                    <button type="submit" class="neon-button neon3"><span>🌍 IP Checker</span></button>
                </form>
            {% endif %}
        </div>
    </div>

    <div style="display: flex; justify-content: center; gap: 20px; margin-top: 20px;">
        <form action="{{ url_for('logout') }}" method="get">
            <button type="submit" class="neon-button neon3"><span>🚪 Logout</span></button>
        </form>
        <form action="{{ url_for('settings') }}" method="get">
            <button type="submit" class="neon-button neon2"><span>⚙️ Einstellungen</span></button>
        </form>
    </div>
</div>
{% endblock %}
