<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>REYNA/L6M - Control Panel</title>
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: #0f0f1a;
            font-family: 'Poppins', sans-serif;
            position: relative;
            overflow: hidden;
        }

        body::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(45deg, #1a1a2e, #16213e);
            animation: gradientBG 15s ease infinite;
        }

        .container {
            position: relative;
            z-index: 1;
            text-align: center;
            padding: 40px;
            background: rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.1);
            width: 400px;
        }

        .loader {
            width: 120px;
            height: 120px;
            border: 3px solid transparent;
            border-top: 3px solid #4f46e5;
            border-right: 3px solid #4f46e5;
            border-radius: 50%;
            margin: 20px auto;
            animation: spin 1s linear infinite;
            position: relative;
        }

        .loader::before {
            content: '';
            position: absolute;
            top: 5px;
            left: 5px;
            right: 5px;
            bottom: 5px;
            border: 3px solid transparent;
            border-top: 3px solid #8b5cf6;
            border-right: 3px solid #8b5cf6;
            border-radius: 50%;
            animation: spin 1.5s linear infinite reverse;
        }

        .loader-error {
            width: 120px;
            height: 120px;
            border: 3px solid #ef4444;
            border-radius: 50%;
            margin: 20px auto;
            position: relative;
            animation: pulse 2s infinite;
        }

        .loader-error::before {
            content: '';
            position: absolute;
            top: 5px;
            left: 5px;
            right: 5px;
            bottom: 5px;
            border: 3px solid #ef4444;
            border-radius: 50%;
            animation: pulse 2s infinite 0.3s;
        }

        .message {
            color: #fff;
            font-size: 18px;
            margin: 20px 0;
            opacity: 0;
            animation: fadeIn 0.5s ease forwards;
        }

        .sub-message {
            color: #a0aec0;
            font-size: 14px;
            margin-top: 10px;
            opacity: 0;
            animation: fadeIn 0.5s ease forwards 0.3s;
        }

        .error-message {
            color: #ef4444;
            font-size: 18px;
            margin: 20px 0;
            opacity: 0;
            animation: fadeIn 0.5s ease forwards;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        @keyframes gradientBG {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes pulse {
            0% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.1); opacity: 0.5; }
            100% { transform: scale(1); opacity: 1; }
        }

        .glow {
            position: absolute;
            width: 500px;
            height: 500px;
            background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, transparent 70%);
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            pointer-events: none;
            z-index: 0;
        }

        .title {
            color: #fff;
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 30px;
            opacity: 0;
            animation: fadeIn 0.5s ease forwards;
        }

        .divider {
            width: 50%;
            height: 2px;
            background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
            margin: 20px auto;
        }
    </style>
</head>
<body>
    <div class="glow"></div>
    <div class="container">
        <h1 class="title">REYNA/L6M</h1>
        {% if program_running == 'true' %}
            <div class="loader"></div>
            <p class="message">Program Çalışıyor</p>
            <p class="sub-message">Lisans doğrulama sayfasına yönlendiriliyorsunuz...</p>
            <div class="divider"></div>
            <p class="sub-message" style="font-size: 12px; margin-top: 20px;">
                REYNA/L6M © 2024 | v1.0.0
            </p>
            <script>
                setTimeout(function() {
                    window.location.href = '/login';
                }, 2000);
            </script>
        {% else %}
            <div class="loader-error"></div>
            <p class="error-message">Program Çalışmıyor!</p>
            <p class="sub-message">
                Lütfen programı başlatın ve tekrar deneyin.
            </p>
            <div class="divider"></div>
            <p class="sub-message" style="font-size: 12px; margin-top: 20px;">
                REYNA/L6M © 2024 | v1.0.0
            </p>
        {% endif %}
    </div>
</body>
</html>