<?php
use function App\Core\{e, logo_asset, url};

$section = 'test-araclari';
$zpanelLogo = logo_asset('zpanel');
$actions = [
    ['test_mod', 'Test mod olustur'],
    ['test_music', 'Test muzik olustur'],
    ['test_music_without_audio', 'Test audio dosyasi olmadan demo kayit olustur'],
    ['payment_success', 'Test odeme basarili olustur'],
    ['payment_failed', 'Test odeme basarisiz olustur'],
    ['subscription', 'Test abonelik olustur'],
    ['premium_access', 'Test premium erisim ver'],
    ['earning', 'Test creator kazanci olustur'],
    ['withdrawal', 'Test para cekme talebi olustur'],
    ['comment', 'Test yorum olustur'],
    ['message', 'Test mesaj olustur'],
    ['notification', 'Test bildirim olustur'],
    ['reset_cookie_popup', 'Test cerez popup resetle'],
    ['reset_recommendations', 'Test kullanici davranisi/oneri gecmisi resetle'],
    ['reset_test_data', 'Test verilerini sifirla'],
    ['reseed', 'Seed verilerini tekrar yukle'],
];
?>
<div class="panel zpanel">
    <?php require BASE_PATH . '/app/Views/zpanel/_sidebar.php'; ?>
    <section class="panel-body test-tools-page" data-test-tools data-endpoint="<?= e(url('/api/zpanel/test-tools/run')) ?>" data-csrf="<?= e($csrfToken ?? '') ?>">
        <div class="security-head">
            <div>
                <p class="eyebrow">ZPanel</p>
                <h1>Test Araclari</h1>
                <p class="muted">Local ve test ortaminda odeme, abonelik, creator kazanci, upload kaydi ve guvenlik botu akislarini hizli dogrula.</p>
            </div>
        </div>

        <div class="dev-alert zpanel-dev-alert">
            <strong>Test Modu Aktif</strong>
            <span>Bu sayfa production'da FEATURE_TEST_MODE=false iken gorunmez.</span>
        </div>

        <section class="test-tool-card">
            <h2>Guvenlik Botu Test Linki Tara</h2>
            <div class="security-scan-inline">
                <input type="url" data-test-scan-url value="https://malware-test.local/file.zip">
                <button class="pill primary" type="button" data-test-action="security_scan">Linki Tara</button>
            </div>
        </section>

        <section class="test-tool-grid">
            <?php foreach ($actions as [$action, $label]): ?>
                <button class="test-tool-button" type="button" data-test-action="<?= e($action) ?>">
                    <strong><?= e($label) ?></strong>
                    <span>Calistir</span>
                </button>
            <?php endforeach; ?>
        </section>

        <section class="test-tool-card">
            <h2>Sonuc</h2>
            <pre data-test-output>Hazir.</pre>
        </section>
    </section>
</div>
