<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// dashboard.php
require_once 'Headphone/Head.php'; // Đã bao gồm logic kiểm tra session và kết nối db

// Lấy lại đầy đủ thông tin để hiển thị ở các Widget bên dưới
$total_recharge = $user_data ? $user_data['total_recharge'] : 0;
?>

<div class="absolute top-48 left-10 w-72 h-72 bg-cyan-500/5 rounded-full blur-3xl pointer-events-none"></div>
<div class="absolute top-96 right-10 w-72 h-72 bg-pink-500/5 rounded-full blur-3xl pointer-events-none"></div>

<div class="relative z-10 space-y-6">

    <div class="bg-gradient-to-r from-[#1c0d3a] to-[#0e061f] rounded-2xl p-6 neon-border-purple flex flex-col md:flex-row justify-between items-start md:items-center gap-4">
        <div>
            <h2 class="font-gaming text-lg sm:text-2xl font-black uppercase tracking-wider">
                Chào mừng chiến binh: <span class="text-transparent bg-clip-text bg-gradient-to-r from-cyan-400 to-purple-400"><?php echo htmlspecialchars($_SESSION['username']); ?></span>
            </h2>
            <p class="text-gray-400 text-xs sm:text-sm mt-1 font-input">Hệ thống phân phối tài khoản và dịch vụ game giá rẻ, uy tín hàng đầu.</p>
        </div>
        <div class="bg-cyan-500/10 px-4 py-2 rounded-xl border border-cyan-400/30 font-gaming text-xs text-cyan-400 animate-pulse">
            <i class="fa-solid fa-shield-halved mr-1"></i> Account Verified
        </div>
    </div>

    <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
        
        <div class="bg-[#130924]/80 backdrop-blur-md p-5 rounded-xl border border-purple-900/30 neon-border-cyan flex items-center justify-between">
            <div class="space-y-1">
                <span class="text-gray-400 text-xs font-gaming uppercase tracking-widest block">Số Dư Tài Khoản</span>
                <span class="font-gaming text-xl sm:text-2xl font-black text-cyan-400 neon-text-cyan">
                    <?php echo number_format($current_money, 0, ',', '.'); ?>
                </span>
                <span class="text-xs text-cyan-400 font-bold ml-0.5 font-gaming">VNĐ</span>
            </div>
            <div class="w-12 h-12 rounded-xl bg-cyan-500/10 flex items-center justify-center border border-cyan-500/30">
                <i class="fa-solid fa-coins text-cyan-400 text-xl"></i>
            </div>
        </div>

        <div class="bg-[#130924]/80 backdrop-blur-md p-5 rounded-xl border border-purple-900/30 shadow-[0_0_15px_rgba(236,72,153,0.1)] border-pink-500/30 flex items-center justify-between">
            <div class="space-y-1">
                <span class="text-gray-400 text-xs font-gaming uppercase tracking-widest block">Tổng Tích Lũy Nạp</span>
                <span class="font-gaming text-xl sm:text-2xl font-black text-pink-500 neon-text-pink">
                    <?php echo number_format($total_recharge, 0, ',', '.'); ?>
                </span>
                <span class="text-xs text-pink-500 font-bold ml-0.5 font-gaming">VNĐ</span>
            </div>
            <div class="w-12 h-12 rounded-xl bg-pink-500/10 flex items-center justify-center border border-pink-500/30">
                <i class="fa-solid fa-credit-card text-pink-500 text-xl"></i>
            </div>
        </div>

    </div>

            <div class="space-y-4">
        <h3 class="font-gaming text-sm sm:text-base font-bold tracking-widest text-purple-400 uppercase flex items-center gap-2">
            <span class="w-1.5 h-4 bg-purple-500 inline-block rounded-full"></span> Danh Mục Dịch Vụ
        </h3>

        <div class="grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4">
            
            <a href="Api-Bank/thue-acb.php" class="block bg-[#130924]/60 p-4 rounded-xl border border-purple-900/20 hover:border-cyan-400/50 transition-all text-center group cursor-pointer">
                <div class="w-12 h-12 rounded-full bg-cyan-500/10 flex items-center justify-center mx-auto mb-3 group-hover:scale-110 transition-transform">
                    <i class="fa-solid fa-building-columns text-cyan-400 text-lg"></i>
                </div>
                <h4 class="font-gaming text-xs sm:text-sm font-bold uppercase tracking-wider text-gray-200 group-hover:text-cyan-400">API BANK ACB</h4>
                <p class="text-[11px] text-gray-500 mt-1 font-input">Cập Nhật Tự Động 1S</p>
            </a>

            <a href="Api-Bank/thue-mb.php" class="block bg-[#130924]/60 p-4 rounded-xl border border-purple-900/20 hover:border-pink-500/50 transition-all text-center group cursor-pointer">
                <div class="w-12 h-12 rounded-full bg-pink-500/10 flex items-center justify-center mx-auto mb-3 group-hover:scale-110 transition-transform">
                    <i class="fa-solid fa-building-columns text-pink-500 text-lg"></i>
                </div>
                <h4 class="font-gaming text-xs sm:text-sm font-bold uppercase tracking-wider text-gray-200 group-hover:text-pink-500">API BANK MB</h4>
                <p class="text-[11px] text-gray-500 mt-1 font-input">Cập Nhật Tự Động 1S</p>
            </a>

            <a href="thue-cron.php" class="block bg-[#130924]/60 p-4 rounded-xl border border-purple-900/20 hover:border-purple-500/50 transition-all text-center group cursor-pointer">
                <div class="w-12 h-12 rounded-full bg-purple-500/10 flex items-center justify-center mx-auto mb-3 group-hover:scale-110 transition-transform">
                    <i class="fa-solid fa-bolt text-purple-400 text-lg"></i>
                </div>
                <h4 class="font-gaming text-xs sm:text-sm font-bold uppercase tracking-wider text-gray-200 group-hover:text-purple-400">CRON SIÊU TỐC</h4>
                <p class="text-[11px] text-gray-500 mt-1 font-input">Tốc Độ Từ 1s - 30s</p>
            </a>

            <a href="cay-thue.php" class="block bg-[#130924]/60 p-4 rounded-xl border border-purple-900/20 hover:border-emerald-500/50 transition-all text-center group cursor-pointer">
                <div class="w-12 h-12 rounded-full bg-emerald-500/10 flex items-center justify-center mx-auto mb-3 group-hover:scale-110 transition-transform">
                    <i class="fa-solid fa-comment-dollar text-emerald-400 text-lg"></i>
                </div>
                <h4 class="font-gaming text-xs sm:text-sm font-bold uppercase tracking-wider text-gray-200 group-hover:text-emerald-400">Cày Thuê Rank</h4>
                <p class="text-[11px] text-gray-500 mt-1 font-input">Tuyển đại cao thủ xử lý</p>
            </a>

        </div>
    </div>

    </div>


</div>

<?php 
// Nhúng chân trang đóng các thẻ HTML
require_once 'Headphone/Footer.php'; 
?>
