<?php
session_start();
require '../includes/db.php';
if (!isset($_SESSION['user_id'])) { header("Location: ../login.php"); exit(); }
$settings = $conn->query("SELECT * FROM settings WHERE id=1")->fetch_assoc();
$primary = $settings['theme_primary'] ?? '#034C44';
?>
<!DOCTYPE html>
<html lang="bn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>মিশন</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body class="bg-gray-100">
    
    <div class="p-4 flex items-center text-white sticky top-0 z-50" style="background-color: <?php echo $primary; ?>;">
        <a href="account.php" class="mr-4"><i class="fas fa-chevron-left text-xl"></i></a>
        <h1 class="text-lg font-bold">মিশন</h1>
    </div>

    <div class="relative bg-gradient-to-r from-blue-500 to-purple-600 h-32 flex items-center px-6">
        <div class="w-12 h-12 rounded-full border-2 border-white overflow-hidden bg-gray-300">
            <img src="https://via.placeholder.com/150" class="w-full h-full object-cover">
        </div>
        <div class="ml-4 text-white">
            <p class="text-sm opacity-90">ইউজার আইডি</p>
            <h2 class="text-xl font-bold">৳ <?php echo number_format($_SESSION['balance'] ?? 0, 2); ?></h2>
        </div>
    </div>

    <div class="flex justify-around bg-white p-2 shadow-sm mb-4">
        <button class="text-red-500 font-bold border-b-2 border-red-500 pb-1 flex items-center gap-1"><i class="fas fa-rocket"></i> চলমান</button>
        <button class="text-gray-500 pb-1 flex items-center gap-1"><i class="far fa-clock"></i> শীঘ্রই আসছে</button>
        <button class="text-gray-500 pb-1 flex items-center gap-1"><i class="fas fa-check-circle"></i> শেষ</button>
    </div>

    <div class="p-3 space-y-3">
        <div class="bg-white rounded-xl p-4 shadow-sm relative overflow-hidden">
            <div class="flex justify-between items-start">
                <div class="flex gap-3">
                    <div class="w-12 h-12 bg-orange-100 rounded-full flex items-center justify-center text-orange-500 text-2xl">
                        <i class="fas fa-medal"></i>
                    </div>
                    <div>
                        <h3 class="font-bold text-gray-700">ফ্রি স্পিন সর্বোচ্চ বোনাস...</h3>
                        <p class="text-xs text-gray-400 mt-1">তারিখ: <?php echo date('Y.m.d'); ?>~2026.12.31</p>
                        <p class="text-xs text-gray-400">অবশিষ্ট: 19:53:27</p>
                    </div>
                </div>
                <button class="px-3 py-1 rounded-full border border-gray-300 text-xs text-gray-500">নিয়ম</button>
            </div>
            <div class="mt-3">
                <div class="flex justify-between text-xs font-bold text-gray-600 mb-1">
                    <span>লক্ষ্য: 0/3</span>
                    <span class="text-2xl font-bold text-gray-400 absolute bottom-4 left-4 opacity-10">0%</span>
                </div>
                <div class="w-full bg-gray-200 rounded-full h-2.5">
                    <div class="bg-blue-500 h-2.5 rounded-full" style="width: 0%"></div>
                </div>
            </div>
        </div>
    </div>

</body>
</html>