<?php
session_start();

// Periksa apakah pengguna sudah login
if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) {
    header("Location: ../login.php");
    exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>FORXZZHOST - PREMIUM CREATE</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Poppins:wght@300;400;600&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.7/tailwind.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
    
    <style>
        :root {
            --primary: #03e9f4;
            --secondary: #ff00c1;
        }
        body {
            font-family: 'Poppins', sans-serif;
            background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e);
            background-size: 400% 400%;
            animation: gradientBG 15s ease infinite;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            overflow-x: hidden;
        }
        @keyframes gradientBG {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        .glass-card {
            background: rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(25px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
            border-radius: 30px;
            width: 90%;
            max-width: 450px;
            padding: 40px 30px;
        }
        .orbitron { font-family: 'Orbitron', sans-serif; }
        
        /* Custom Option Cards */
        .option-container {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            margin-top: 10px;
        }
        .option-item {
            background: rgba(0,0,0,0.4);
            border: 2px solid rgba(255,255,255,0.1);
            padding: 15px 10px;
            border-radius: 15px;
            cursor: pointer;
            transition: 0.3s;
            text-align: center;
            color: #aaa;
        }
        .option-item i { font-size: 20px; margin-bottom: 5px; display: block; }
        .option-item.active {
            border-color: var(--primary);
            background: rgba(3, 233, 244, 0.15);
            color: #fff;
            box-shadow: 0 0 15px rgba(3, 233, 244, 0.3);
            transform: translateY(-3px);
        }

        .input-glow:focus {
            border-color: var(--primary);
            box-shadow: 0 0 15px rgba(3, 233, 244, 0.4);
            background: rgba(255, 255, 255, 0.1) !important;
        }
        
        .btn-neon {
            background: linear-gradient(90deg, #03e9f4, #ff00c1, #03e9f4);
            background-size: 200%;
            transition: 0.5s;
            text-transform: uppercase;
            letter-spacing: 2px;
            animation: moveGradient 3s linear infinite;
        }
        @keyframes moveGradient {
            0% { background-position: 0%; }
            100% { background-position: 200%; }
        }
        .btn-neon:hover { transform: scale(1.03); box-shadow: 0 0 30px var(--secondary); }

        .logo-glow {
            filter: drop-shadow(0 0 15px var(--primary));
            border: 3px solid var(--primary);
            transition: 0.5s;
        }
        .logo-glow:hover { transform: rotate(360deg); }
    </style>
</head>
<body>

<audio id="bgMusic" loop>
    <source src="../wlc.mp3" type="audio/mp3">
</audio>

<div class="glass-card">
    <div class="text-center">
        <img src="https://i.ibb.co/Chp50Rk/a29b813b2395ebe6b734489a308735c1.gif" 
             class="w-24 h-24 rounded-full object-cover mx-auto mb-4 logo-glow" 
             alt="Logo">
        <h2 class="orbitron text-2xl font-bold mb-1 text-white tracking-widest">FORXZZHOST</h2>
        <p class="text-[10px] text-gray-400 mb-8 orbitron tracking-[5px]">WEB EXECUTOR V2</p>
    </div>

    <form action="proses2.php" method="post" id="mainForm" class="space-y-6">
        <div>
            <label class="text-[10px] text-gray-400 ml-1 orbitron uppercase">Input Target Name</label>
            <input class="bg-black bg-opacity-50 border-2 border-gray-800 rounded-2xl py-4 px-4 text-white leading-tight focus:outline-none input-glow w-full text-center font-bold tracking-widest transition-all" 
                   id="text" type="text" name="text" placeholder="NAMA PANEL" required>
        </div>

        <div>
            <label class="text-[10px] text-gray-400 ml-1 orbitron uppercase">Select Mail Limit</label>
            <select name="nomor" id="real-select" style="display:none">
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
            </select>

            <div class="option-container">
                <div class="option-item" onclick="selectLimit('1', this)">
                    <i class="fas fa-envelope"></i> <span class="text-xs orbitron">1 MAIL</span>
                </div>
                <div class="option-item" onclick="selectLimit('2', this)">
                    <i class="fas fa-mail-bulk"></i> <span class="text-xs orbitron">3 MAIL</span>
                </div>
                <div class="option-item" onclick="selectLimit('3', this)">
                    <i class="fas fa-fire"></i> <span class="text-xs orbitron">5 MAIL</span>
                </div>
                <div class="option-item" onclick="selectLimit('4', this)">
                    <i class="fas fa-bolt"></i> <span class="text-xs orbitron">10 MAIL</span>
                </div>
                <div class="option-item col-span-2" onclick="selectLimit('5', this)">
                    <i class="fas fa-infinity text-pink-500"></i> <span class="text-xs orbitron">UNLIMITED</span>
                </div>
            </div>
        </div>

        <div class="pt-4 text-center">
            <button class="btn-neon text-white font-bold py-4 px-10 rounded-2xl focus:outline-none w-full orbitron shadow-lg" 
                    type="submit" name="buatweb" onclick="stopMusic()">
                <i class="fas fa-rocket mr-2"></i> CREATE NOW
            </button>
        </div>
    </form>
</div>

<script>
    const music = document.getElementById('bgMusic');

    // Play music on first click
    window.addEventListener('click', function() {
        music.play();
    }, { once: true });

    // Handle Visual Selection
    function selectLimit(val, element) {
        // Set value to hidden real select
        document.getElementById('real-select').value = val;
        
        // Update UI
        document.querySelectorAll('.option-item').forEach(el => el.classList.remove('active'));
        element.classList.add('active');
        
        // Haptic feel (vibrate if mobile)
        if(navigator.vibrate) navigator.vibrate(50);
    }

    // Stop music only when clicking create
    function stopMusic() {
        music.pause();
    }
</script>

</body>
</html>
