<?php
// modules/store/widgets/success_box.php
// جلوگیری از دسترسی مستقیم به فایل
if (basename($_SERVER['PHP_SELF']) == 'success_box.php') {
    die('Access Denied');
}
?>

<div class="bg-white dark:bg-slate-800 border-2 border-emerald-500 rounded-3xl overflow-hidden mb-12 shadow-2xl animate-pulse-once flex flex-col" id="successContainer">
    
    <div class="bg-emerald-50 dark:bg-emerald-900/30 p-6 border-b border-emerald-100 dark:border-emerald-800 flex flex-col sm:flex-row justify-between items-center gap-4 shrink-0">
        <div>
            <h2 class="text-xl font-black text-emerald-800 dark:text-emerald-400 mb-1">🎉 <?php echo count($purchasedConfigs); ?> اشتراک با موفقیت صادر شد</h2>
            <p class="text-sm text-emerald-700 dark:text-emerald-500 font-bold">برای تحویل به مشتری، روی لینک‌ها کلیک کنید یا از فایل خروجی استفاده نمایید.</p>
        </div>
        <div class="flex gap-2">
            <button onclick="downloadConfigsTxt()" class="bg-emerald-600 hover:bg-emerald-700 text-white font-bold py-2.5 px-4 rounded-xl shadow transition text-sm flex items-center gap-2">
                📄 دانلود فایل TXT
            </button>
            <button onclick="downloadConfigsExcel()" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-2.5 px-4 rounded-xl shadow transition text-sm flex items-center gap-2">
                📊 دانلود Excel
            </button>
        </div>
    </div>

    <div class="p-6 overflow-x-auto border-b border-gray-100 dark:border-slate-700">
        <table class="w-full text-sm text-left text-gray-600 dark:text-gray-300" dir="ltr">
            <thead class="bg-emerald-100 dark:bg-emerald-900/50 text-emerald-800 dark:text-emerald-400">
                <tr>
                    <th class="px-4 py-3 rounded-tl-xl font-bold">Username</th>
                    <th class="px-4 py-3 font-bold">Config Link (Click to Copy)</th>
                    <th class="px-4 py-3 text-center rounded-tr-xl font-bold">QR</th>
                </tr>
            </thead>
            <tbody class="divide-y divide-emerald-50 dark:divide-emerald-900/20">
                <?php foreach($purchasedConfigs as $c): ?>
                <tr class="hover:bg-emerald-50 dark:hover:bg-slate-700 transition">
                    <td class="px-4 py-3 font-black text-gray-800 dark:text-gray-100"><?php echo htmlspecialchars($c['account_username']); ?></td>
                    <td class="px-4 py-3">
                        <div class="flex items-center gap-2 cursor-pointer group w-fit" onclick="copyTableLink('<?php echo htmlspecialchars($c['config_link']); ?>', this)">
                            <span class="truncate max-w-[250px] md:max-w-[450px] inline-block font-mono text-xs text-blue-600 dark:text-blue-400"><?php echo htmlspecialchars($c['config_link']); ?></span>
                            <span class="copy-badge opacity-0 group-hover:opacity-100 transition text-emerald-600 dark:text-emerald-400 text-xs bg-emerald-100 dark:bg-emerald-900 px-2 py-1 rounded font-bold">Copy</span>
                        </div>
                    </td>
                    <td class="px-4 py-3 text-center">
                       <button type="button" onclick="showQRModal('<?php echo htmlspecialchars($c['config_link']); ?>', '<?php echo htmlspecialchars($c['account_username']); ?>')" class="text-xl hover:scale-110 transition-transform bg-gray-100 dark:bg-slate-700 p-1.5 rounded-lg border border-gray-200 dark:border-slate-600">📱</button>
                    </td>
                </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>

    <?php if(count($purchasedConfigs) == 1): 
        $singleUser = $purchasedConfigs[0]['account_username'];
        // استخراج ID سرور برای اتصال API
        $stmtSrv = $pdo->prepare("SELECT server_id FROM inventory WHERE account_username = ? LIMIT 1");
        $stmtSrv->execute([$singleUser]);
        $targetServerId = $stmtSrv->fetchColumn() ?: 1;
    ?>
        <div class="p-6 md:p-8 bg-[#f4f5f7] dark:bg-slate-900 relative min-h-[400px]" id="live_sub_dashboard">
            
            <div id="sub_loading" class="absolute inset-0 bg-white/80 dark:bg-slate-900/80 backdrop-blur z-20 flex flex-col items-center justify-center transition-opacity">
                <div class="animate-spin w-10 h-10 border-4 border-emerald-600 border-t-transparent rounded-full mb-4"></div>
                <p class="font-bold text-gray-600 dark:text-gray-300 animate-pulse">در حال اتصال به سرور و دریافت زنده اطلاعات...</p>
            </div>

            <div class="flex justify-between items-center mb-6">
                <h3 class="text-xl font-black text-gray-800 dark:text-white flex items-center gap-2">
                    <svg class="w-6 h-6 text-emerald-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
                    نمایش زنده وضعیت اشتراک
                </h3>
                <span class="bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-400 font-mono font-bold px-3 py-1 rounded-lg text-sm" dir="ltr">@<?php echo $singleUser; ?></span>
            </div>

            <div class="grid grid-cols-1 lg:grid-cols-12 gap-6 mb-6">
                <div id="sub_status_card" class="lg:col-span-8 bg-[#eafbf1] dark:bg-[#064e3b]/80 border border-[#d1f4e0] dark:border-[#065f46] rounded-2xl p-6 md:p-8 shadow-sm flex flex-col justify-between transition-colors">
                    <div class="flex justify-between items-start">
                        <div class="text-start">
                            <h2 id="sub_status_badge" class="text-[32px] sm:text-[40px] leading-none font-black text-[#10b981] dark:text-emerald-400 flex items-center gap-3">
                                در حال بررسی...
                            </h2>
                            <span class="text-[11px] font-bold text-gray-500 dark:text-emerald-200/70 mt-2 block">وضعیت حساب</span>
                        </div>
                        <div class="text-center">
                            <span class="block text-2xl mb-1 text-gray-500 dark:text-emerald-200 font-light leading-none">∞</span>
                            <span class="font-black text-lg text-gray-900 dark:text-white">نامحدود</span>
                        </div>
                    </div>

                    <div class="flex justify-between items-end mt-4">
                        <div class="shrink-0 flex flex-col items-center">
                            <div class="sub-circle-wrap" id="sub_pie_chart">
                                <div class="sub-inside-circle" id="sub_percent_text">0%</div>
                            </div>
                            <span class="text-[10px] text-gray-500 dark:text-emerald-200 mt-3 font-bold">مصرف شده</span>
                        </div>

                        <div class="space-y-5 w-full max-w-[220px]">
                            <div class="flex justify-between items-center">
                                <span class="text-gray-500 dark:text-emerald-100/70 text-xs font-bold">ترافیک مصرفی</span>
                                <span id="sub_used" class="font-bold text-gray-900 dark:text-white font-mono text-sm" dir="ltr">0 MB</span>
                            </div>
                            <div class="flex justify-between items-center">
                                <span class="text-gray-500 dark:text-emerald-100/70 text-xs font-bold">حد کل</span>
                                <span id="sub_limit" class="font-bold text-gray-900 dark:text-white font-mono text-sm" dir="ltr">0 GB</span>
                            </div>
                            <div class="flex justify-between items-center pt-1 border-t border-[#d1f4e0] dark:border-[#065f46]">
                                <span class="text-gray-500 dark:text-emerald-100/70 text-xs font-bold">باقی‌مانده</span>
                                <span id="sub_remain" class="font-black text-[#10b981] dark:text-emerald-400 font-mono text-sm" dir="ltr">0 MB</span>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="lg:col-span-4 flex flex-col gap-4">
                    <div class="bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-2xl p-6 shadow-sm flex justify-between items-center h-full">
                        <span class="text-xs font-bold text-gray-500">ترافیک کل</span>
                        <span id="sub_total_main" class="text-xl sm:text-[22px] font-black font-mono text-gray-900 dark:text-white tracking-tight" dir="ltr">0 MB</span>
                    </div>
                    <div class="bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-2xl p-6 shadow-sm flex justify-between items-center h-full">
                        <span class="text-xs font-bold text-gray-500">تاریخ انقضا</span>
                        <span id="sub_expire_main" class="text-lg font-black text-gray-900 dark:text-white font-mono" dir="ltr">∞</span>
                    </div>
                    <div class="bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-2xl p-6 shadow-sm flex justify-between items-center h-full">
                        <span class="text-xs font-bold text-gray-500">آخرین اتصال</span>
                        <span id="sub_last_conn" class="text-xs font-bold text-gray-400 dark:text-gray-500 flex items-center gap-2" dir="ltr">نامشخص</span>
                    </div>
                </div>
            </div>

            <div class="grid grid-cols-1 lg:grid-cols-12 gap-6">
                <div class="lg:col-span-7 flex flex-col">
                    <div class="flex justify-between items-center mb-4 px-1">
                        <h3 class="font-black text-gray-800 dark:text-white flex items-center gap-2 text-sm">
                            <svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"></path></svg>
                            لینک‌های پیکربندی (زنده)
                        </h3>
                    </div>
                    <div id="sub_configs_list" class="space-y-3 overflow-y-auto custom-scrollbar pe-1 max-h-[350px]"></div>
                </div>

                <div class="lg:col-span-5 bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-2xl p-6 shadow-sm flex flex-col h-[350px]">
                    <h3 class="font-black text-gray-800 dark:text-white text-sm mb-6">آمار مصرف</h3>
                    <div class="flex-1 w-full relative">
                        <canvas id="subUsageChart"></canvas>
                    </div>
                </div>
            </div>

            <style>
                .sub-circle-wrap { width: 120px; height: 120px; background: #c6f6d5; border-radius: 50%; position: relative; }
                .sub-circle-wrap .sub-inside-circle { width: 96px; height: 96px; border-radius: 50%; background: #eafbf1; line-height: 96px; text-align: center; margin-top: 12px; margin-left: 12px; position: absolute; z-index: 100; font-weight: 900; font-size: 1.5rem; color: #1f2937; }
                html.dark .sub-circle-wrap { background: #065f46; }
                html.dark .sub-circle-wrap .sub-inside-circle { background: #064e3b; color: #f8fafc; }
            </style>
            
            <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
            <script>
                document.addEventListener('DOMContentLoaded', function() {
                    const username = '<?php echo addslashes($singleUser); ?>';
                    const serverId = '<?php echo $targetServerId; ?>';
                    const apiUrl = '../pasarguard/pasarguard_api.php';
                    let subChartInstance = null;

                    function formatBytesExactSub(bytes) {
                        if (!+bytes || bytes <= 0) return '0 MB';
                        const k = 1024, dm = 2, sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
                        const i = Math.floor(Math.log(bytes) / Math.log(k));
                        return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
                    }

                    function setSubPieProgress(percent) {
                        let p = Math.min(100, Math.max(0, percent));
                        let deg = (p / 100) * 360;
                        document.getElementById('sub_pie_chart').style.background = `conic-gradient(#10b981 ${deg}deg, transparent 0)`;
                    }

                    function renderSubChart() {
                        const ctx = document.getElementById('subUsageChart').getContext('2d');
                        if(subChartInstance) subChartInstance.destroy();
                        
                        subChartInstance = new Chart(ctx, {
                            type: 'line',
                            data: {
                                labels: ['', '', '', 'Live', '', '', ''],
                                datasets: [{
                                    data: [null, null, null, 10, null, null, null],
                                    borderColor: '#3b82f6', borderWidth: 2,
                                    pointBackgroundColor: '#fff', pointBorderColor: '#3b82f6',
                                    pointBorderWidth: 3, pointRadius: 5, spanGaps: true
                                }]
                            },
                            options: {
                                responsive: true, maintainAspectRatio: false,
                                plugins: { legend: { display: false }, tooltip: { enabled: false } },
                                scales: {
                                    y: { display: false, min: 0, max: 20 },
                                    x: { grid: { color: 'rgba(156, 163, 175, 0.2)', borderDash: [4, 4], drawBorder: false }, ticks: { font: { family: 'Vazirmatn', size: 10 }, color: '#9ca3af' } }
                                },
                                layout: { padding: { top: 20, bottom: 10 } }
                            }
                        });
                    }

                    function parseConfigType(link) {
                        let name = 'Config', type = 'VLESS';
                        try {
                            if(link.startsWith('vless://')) type = 'VLESS';
                            else if(link.startsWith('vmess://')) type = 'VMESS';
                            else if(link.startsWith('trojan://')) type = 'TROJAN';
                            else if(link.startsWith('ss://')) type = 'SHADOWSOCKS';
                            if(link.includes('#')) name = decodeURIComponent(link.split('#').pop());
                        } catch(e) {}
                        return { name, type };
                    }

                    function fetchLiveSubData() {
                        fetch(`${apiUrl}?ajax_call=get_user&username=${encodeURIComponent(username)}&server_id=${serverId}`)
                            .then(res => res.json())
                            .then(res => {
                                if(res && res.code === 200 && res.data) {
                                    let uData = res.data;
                                    let subUrl = uData.subscription_url || uData.sub_url || '';
                                    if (subUrl) {
                                        fetch(`${apiUrl}?ajax_call=get_sub_links&sub_url=${encodeURIComponent(subUrl)}&server_id=${serverId}`)
                                            .then(r => r.json())
                                            .then(links => {
                                                uData.links = links || [];
                                                uData.subUrl = subUrl;
                                                renderSubDashboard(uData);
                                            })
                                            .catch(() => renderSubDashboard(uData));
                                    } else { renderSubDashboard(uData); }
                                } else {
                                    document.getElementById('sub_loading').innerHTML = '<div class="text-rose-500 font-bold">خطا در دریافت اطلاعات زنده از سرور.</div>';
                                }
                            })
                            .catch(() => {
                                document.getElementById('sub_loading').innerHTML = '<div class="text-rose-500 font-bold">ارتباط با سرور برقرار نشد.</div>';
                            });
                    }

                    function renderSubDashboard(data) {
                        document.getElementById('sub_loading').classList.add('opacity-0', 'pointer-events-none');
                        
                        let isOnline = data.status === 'active'; 
                        let statusCard = document.getElementById('sub_status_card');
                        let statusBadge = document.getElementById('sub_status_badge');
                        
                        if(data.status === 'active') {
                            statusCard.className = 'lg:col-span-8 bg-[#eafbf1] dark:bg-[#064e3b]/80 border border-[#d1f4e0] dark:border-[#065f46] rounded-2xl p-6 md:p-8 shadow-sm flex flex-col justify-between transition-colors';
                            statusBadge.innerHTML = `فعال <span class="w-3 h-3 bg-[#10b981] rounded-full mb-2"></span>`;
                            statusBadge.classList.remove('text-rose-500');
                            statusBadge.classList.add('text-[#10b981]');
                        } else {
                            statusCard.className = 'lg:col-span-8 bg-[#fee2e2] dark:bg-[#881337]/80 border border-[#fecaca] dark:border-[#9f1239] rounded-2xl p-6 md:p-8 shadow-sm flex flex-col justify-between transition-colors';
                            statusBadge.innerHTML = `غیرفعال <span class="w-3 h-3 bg-rose-500 rounded-full mb-2"></span>`;
                            statusBadge.classList.remove('text-[#10b981]');
                            statusBadge.classList.add('text-rose-500');
                        }

                        let limitStr = (data.data_limit === 0 || !data.data_limit) ? '∞' : formatBytesExactSub(data.data_limit);
                        let usedStr = formatBytesExactSub(data.used_traffic);
                        let remainBytes = data.data_limit > 0 ? (data.data_limit - data.used_traffic) : 0;
                        let remainStr = (data.data_limit === 0 || !data.data_limit) ? 'نامحدود' : formatBytesExactSub(remainBytes > 0 ? remainBytes : 0);
                        let percent = data.data_limit > 0 ? Math.min(100, Math.round((data.used_traffic / data.data_limit) * 100)) : 0;

                        document.getElementById('sub_limit').innerText = limitStr;
                        document.getElementById('sub_used').innerText = usedStr;
                        document.getElementById('sub_total_main').innerText = usedStr;
                        document.getElementById('sub_remain').innerText = remainStr;
                        document.getElementById('sub_percent_text').innerText = percent + '%';
                        setSubPieProgress(percent);

                        let expireEl = document.getElementById('sub_expire_main');
                        if (data.expire) {
                            try {
                                let d = new Date(data.expire);
                                let formatter = new Intl.DateTimeFormat('fa-IR', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' });
                                expireEl.innerText = formatter.format(d);
                                expireEl.classList.add('text-sm');
                                expireEl.classList.remove('text-lg');
                            } catch(e) { expireEl.innerText = 'نامعتبر'; }
                        }

                        let configsHtml = '';
                        
                        if(data.subUrl) {
                            configsHtml += `
                            <div class="bg-[#f0f4f8] dark:bg-slate-700/50 border border-blue-200/50 dark:border-slate-600 rounded-xl p-3 flex justify-between items-center h-14">
                                <div class="flex items-center gap-1 shrink-0">
                                    <span class="bg-[#336699] text-white px-2 py-0.5 rounded text-[9px] font-black ltr:ml-2 rtl:mr-2">SUB</span>
                                </div>
                                <div class="flex-1 text-start px-3 truncate font-bold text-[10px] text-gray-800 dark:text-gray-200" dir="ltr" title="لینک اشتراک">${remainStr} of ${limitStr} (لینک اشتراک)</div>
                                <div class="flex items-center gap-1 shrink-0">
                                    <button type="button" onclick="showQRModal('${data.subUrl}', 'Subscription')" class="w-7 h-7 bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-600 rounded-md flex items-center justify-center text-gray-500 hover:text-blue-600 transition"><svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v1m6 11h2m-6 0h-2v4m0-11v3m0 0h.01M12 12h4.01M16 20h4M4 12h4m12 0h.01M5 8h2a1 1 0 001-1V5a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1zm14 0h2a1 1 0 001-1V5a1 1 0 00-1-1h-2a1 1 0 00-1 1v2a1 1 0 001 1z"></path></svg></button>
                                    <button type="button" onclick="copyConfigLink('${data.subUrl}', this)" class="w-7 h-7 bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-600 rounded-md flex items-center justify-center text-gray-500 hover:text-blue-600 transition"><svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"></path></svg></button>
                                </div>
                            </div>`;
                        }

                        let linksArr = data.links || [];
                        linksArr.forEach((link) => {
                            let info = parseConfigType(link);
                            configsHtml += `
                            <div class="bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-xl p-3 flex justify-between items-center h-14 shadow-sm hover:border-gray-300 dark:hover:border-slate-500 transition">
                                <div class="flex items-center gap-1 shrink-0">
                                    <span class="bg-[#336699] text-white px-2 py-0.5 rounded text-[9px] font-black uppercase ltr:ml-2 rtl:mr-2">${info.type}</span>
                                </div>
                                <div class="flex-1 text-start px-3 truncate font-bold text-[10px] text-gray-800 dark:text-gray-300" dir="ltr" title="${info.name}">${info.name}</div>
                                <div class="flex items-center gap-1 shrink-0">
                                    <button type="button" onclick="showQRModal('${link}', '${info.name}')" class="w-7 h-7 bg-gray-50 dark:bg-slate-700 border border-gray-200 dark:border-slate-600 rounded-md flex items-center justify-center text-gray-500 hover:text-blue-600 transition"><svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v1m6 11h2m-6 0h-2v4m0-11v3m0 0h.01M12 12h4.01M16 20h4M4 12h4m12 0h.01M5 8h2a1 1 0 001-1V5a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1zm14 0h2a1 1 0 001-1V5a1 1 0 00-1-1h-2a1 1 0 00-1 1v2a1 1 0 001 1z"></path></svg></button>
                                    <button type="button" onclick="copyConfigLink('${link}', this)" class="w-7 h-7 bg-gray-50 dark:bg-slate-700 border border-gray-200 dark:border-slate-600 rounded-md flex items-center justify-center text-gray-500 hover:text-blue-600 transition"><svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"></path></svg></button>
                                </div>
                            </div>`;
                        });
                        
                        if(linksArr.length === 0 && !data.subUrl) configsHtml = `<div class="text-center text-xs font-bold text-rose-500 py-6">کانفیگی یافت نشد!</div>`;

                        document.getElementById('sub_configs_list').innerHTML = configsHtml;
                        renderSubChart();
                    }

                    fetchLiveSubData();
                });

                function copyTableLink(text, el) {
                    navigator.clipboard.writeText(text).then(() => {
                        const badge = el.querySelector('.copy-badge');
                        if(badge) {
                            const originalText = badge.innerText;
                            badge.innerText = 'کپی شد!';
                            badge.classList.remove('text-emerald-600', 'dark:text-emerald-400', 'bg-emerald-100', 'dark:bg-emerald-900', 'opacity-0');
                            badge.classList.add('text-white', 'bg-emerald-500', 'opacity-100');
                            setTimeout(() => {
                                badge.innerText = originalText;
                                badge.classList.remove('text-white', 'bg-emerald-500', 'opacity-100');
                                badge.classList.add('text-emerald-600', 'dark:text-emerald-400', 'bg-emerald-100', 'dark:bg-emerald-900', 'opacity-0');
                            }, 2000);
                        }
                    });
                }

                function copyConfigLink(text, btnElement) {
                    navigator.clipboard.writeText(text).then(() => {
                        let original = btnElement.innerHTML;
                        btnElement.innerHTML = `<svg class="w-4 h-4 text-emerald-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg>`;
                        setTimeout(() => { btnElement.innerHTML = original; }, 1500);
                    });
                }
            </script>
        </div>
    <?php endif; ?>
</div>

<style>
    @keyframes pulse-once { 0% { transform: scale(0.98); opacity: 0.8; } 50% { transform: scale(1.02); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
    .animate-pulse-once { animation: pulse-once 0.5s ease-out; }
</style>