<?php if (basename($_SERVER['PHP_SELF']) == 'status_card.php') { die('Access Denied'); } ?>

<div class="lg:col-span-4 flex flex-col gap-6">
    <div class="bg-white dark:bg-slate-800 rounded-3xl shadow-sm border border-gray-100 dark:border-slate-700 p-8 flex flex-col items-center justify-center text-center relative overflow-hidden transition-all duration-500" id="guardian_main_box" style="<?php echo $guardianStatus ? 'border-top: 6px solid #10b981;' : 'border-top: 6px solid #64748b; filter: grayscale(50%);'; ?>">
        
        <div class="w-20 h-20 rounded-full flex items-center justify-center text-4xl mb-4 transition-colors duration-500 shadow-inner" id="guardian_icon_box" style="<?php echo $guardianStatus ? 'background-color: #d1fae5; color: #10b981;' : 'background-color: #f1f5f9; color: #94a3b8;'; ?>">
            <?php echo $guardianStatus ? '🛡️' : '💤'; ?>
        </div>
        
        <h2 class="text-lg font-black text-gray-800 dark:text-white mb-2" id="guardian_title">
            <?php echo $guardianStatus ? 'نگهبان شبکه فعال است' : 'نگهبان شبکه خاموش است'; ?>
        </h2>
        <p class="text-[11px] text-gray-500 dark:text-gray-400 font-bold mb-6 px-4">
            با خاموش کردن این دکمه، مانیتورینگ تهاجمی متوقف شده و محدودسازی کاربران فقط به عهده کرون‌جاب کُند خود پاسارگارد خواهد بود.
        </p>

        <label class="relative inline-flex items-center cursor-pointer">
            <input type="checkbox" id="guardian_toggle" class="sr-only peer" <?php echo $guardianStatus ? 'checked' : ''; ?>>
            <div class="w-14 h-7 bg-gray-200 peer-focus:outline-none rounded-full peer dark:bg-slate-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-6 after:w-6 after:transition-all dark:border-gray-600 peer-checked:bg-emerald-500"></div>
            <span class="mr-3 text-sm font-black text-gray-900 dark:text-gray-300 transition-colors" id="guardian_toggle_text">
                <?php echo $guardianStatus ? 'فعال (Monitoring)' : 'غیرفعال (Paused)'; ?>
            </span>
        </label>
    </div>

    <div class="bg-gradient-to-br from-indigo-600 to-blue-700 rounded-3xl shadow-lg p-6 text-white relative overflow-hidden">
        <div class="absolute -left-6 -bottom-6 opacity-10 text-8xl">🎯</div>
        <div class="relative z-10">
            <span class="text-xs font-bold text-indigo-200">جلوی ضرر گرفته شده (امروز)</span>
            <div class="text-4xl font-black mt-1 mb-2 tracking-tighter" id="total_caught">0</div>
            <span class="text-[10px] bg-black/20 px-2 py-1 rounded-lg">اکانت پرخطر پیش از اورشوت لیمیت شدند</span>
        </div>
    </div>
</div>