<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}Moonlab{% endblock %}</title>
    <link rel="stylesheet" href="/static/style.css">
    <link rel="icon" href="/static/logo.png" type="image/png">
    <style>
        @import url('https://fonts.googleapis.com/css?family=Exo:400,700');

        html, body {
            height: 100%;
            overflow: hidden;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Exo', sans-serif;
            margin: 0;
            color: white;
            overflow: hidden;
        }

        .area {
            background: #000;
            width: 100%;
            height: 100vh;
            position: fixed;
            top: 0;
            left: 0;
            z-index: -1;
        }

        .circles {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
        }

        .circles li {
            position: absolute;
            display: block;
            list-style: none;
            width: 20px;
            height: 20px;
            background: rgba(255, 255, 255, 0.2);
            animation: animate 25s linear infinite;
            bottom: -150px;
        }

        .circles li:nth-child(1) {
            left: 25%;
            width: 80px;
            height: 80px;
            animation-delay: 0s;
        }

        .circles li:nth-child(2) {
            left: 10%;
            width: 20px;
            height: 20px;
            animation-delay: 2s;
            animation-duration: 12s;
        }

        .circles li:nth-child(3) {
            left: 70%;
            width: 20px;
            height: 20px;
            animation-delay: 4s;
        }

        .circles li:nth-child(4) {
            left: 40%;
            width: 60px;
            height: 60px;
            animation-delay: 0s;
            animation-duration: 18s;
        }

        .circles li:nth-child(5) {
            left: 65%;
            width: 20px;
            height: 20px;
            animation-delay: 0s;
        }

        .circles li:nth-child(6) {
            left: 75%;
            width: 110px;
            height: 110px;
            animation-delay: 3s;
        }

        .circles li:nth-child(7) {
            left: 35%;
            width: 150px;
            height: 150px;
            animation-delay: 7s;
        }

        .circles li:nth-child(8) {
            left: 50%;
            width: 25px;
            height: 25px;
            animation-delay: 15s;
            animation-duration: 45s;
        }

        .circles li:nth-child(9) {
            left: 20%;
            width: 15px;
            height: 15px;
            animation-delay: 2s;
            animation-duration: 35s;
        }

        .circles li:nth-child(10) {
            left: 85%;
            width: 150px;
            height: 150px;
            animation-delay: 0s;
            animation-duration: 11s;
        }

        @keyframes animate {
            0% {
                transform: translateY(0) rotate(0deg);
                opacity: 1;
                border-radius: 0;
            }
            100% {
                transform: translateY(-1000px) rotate(720deg);
                opacity: 0;
                border-radius: 50%;
            }
        }

        .content-wrapper {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

        .form-container {
            position: relative;
            z-index: 1;
            background: rgba(30, 30, 30, 0.85);
            padding: 30px;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
            width: 100%;
            max-width: 400px;
            text-align: center;
            backdrop-filter: blur(4px);
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .theme-toggle {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 60px;
            height: 60px;
            border-radius: 16px;
            background-color: gray;
            background-size: 70%;
            background-position: center;
            background-repeat: no-repeat;
            cursor: pointer;
            box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
            transition: background-image 0.3s ease;
        }

        .neon-button {
            width: 100%;
            padding: 14px 20px;
            font-size: 15px;
            font-weight: bold;
            border: 2px solid;
            color: inherit;
            background: transparent;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            transition: 0.3s;
            box-shadow: 0 0 8px currentColor, 0 0 14px currentColor inset;
            margin: 10px 0;
            border-radius: 6px;
        }

        .neon1 { color: #00fff7; border-color: #00fff7; }
        .neon2 { color: #ff00ff; border-color: #ff00ff; }
        .neon3 { color: #39ff14; border-color: #39ff14; }

        .neon-button::before {
            content: '';
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 100%;
            background: currentColor;
            z-index: 0;
            transform: scaleX(0);
            transform-origin: left;
            transition: 0.3s ease-in-out;
        }

        .neon-button:hover::before {
            transform: scaleX(1);
        }

        .neon-button span {
            position: relative;
            z-index: 1;
            transition: color 0.3s;
        }

        .neon-button:hover span {
            color: #111;
        }

        .logout-button {
            color: #ff4d4d;
            border-color: #ff4d4d;
        }

        .logout-button:hover span {
            color: #111;
        }
    </style>
</head>
<body>
<div class="area">
    <ul class="circles">
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</div>

{% include "top_bar.html" %}

<div class="content-wrapper">
    {% block content %}
    {% endblock %}
</div>

<div class="theme-toggle" id="themeToggle" style="background-image: url('/static/{{ 'night-mode.png' if session['theme'] == 'lightmode' else 'light-mode.png' }}');"></div>

<script>
    const themeToggle = document.getElementById('themeToggle');
    themeToggle.addEventListener('click', () => {
        fetch('/toggle-theme', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json'
            },
            credentials: 'same-origin'
        }).then(response => {
            if (response.ok) {
                location.reload();
            } else {
                console.error('Failed to toggle theme:', response.statusText);
            }
        });
    });
</script>
</body>
</html>