<?php
defined( 'ABSPATH' ) || exit;

use ThemePaste\SecureAdmin\Helpers\Utility;

$page_label = $args['page_label'];
$screen_slug = $args['current_screen'];
$settings_option = $args['settings_option'];
$current_tab = $args['current_tab'];
$current_url = $args['current_url'];
$current_tab_label = $args['current_tab_label'];
$is_pro = $settings_option[$current_tab]['sub'][$screen_slug]['is_pro'] ?? false;
$is_valid_license_available = is_valid_license_available();
?>

<div class="tpsa-setting-wrapper">
    <div class="tpsa-general-settings-wrapper">
        <h2><span><a href="<?php echo esc_url( $current_url ); ?>"><?php echo esc_html( $current_tab_label ); ?></a>
                <?php echo esc_html( ' / Malware Scanner' ); ?>
            </span>
            <div class="tp-feature">
                <button class="tp-help-icon">?</button>
                <div class="tp-tooltip">
                    <p><?php esc_html_e( 'Malware scanner for your website', 'admin-safety-guard' ); ?>
                    </p>
                </div>
            </div>
        </h2>

        <div id="tpasg-malware-scanner" class="tpasg-card">
            <p><?php esc_html_e( 'Run a heuristic scan in batches with progress and a final summary.', 'admin-safety-guard' ); ?>
            </p>

            <div class="tpasg-controls">
                <button id="tpasg-start"
                    class="button button-primary"><?php esc_html_e( 'Start Full Scan', 'admin-safety-guard' ); ?></button>
                <button id="tpasg-cancel" class="button"
                    disabled><?php esc_html_e( 'Cancel', 'admin-safety-guard' ); ?></button>
                <button id="tpasg-view-report"
                    class="button"><?php esc_html_e( 'View Last Report', 'admin-safety-guard' ); ?></button>
            </div>

            <div id="tpasg-progress" class="tpasg-progress" style="display:none;">
                <div class="tpasg-bar"><span class="tpasg-fill" style="width:0%;"></span></div>
                <div class="tpasg-progress-text">
                    <span id="tpasg-count">0</span> / <span id="tpasg-total">0</span>
                    <?php esc_html_e( 'files scanned…', 'admin-safety-guard' ); ?>
                </div>
            </div>

            <div id="tpasg-summary" class="tpasg-summary" style="display:none;"></div>
            <div id="tpasg-output" style="margin-top:14px;"></div>

        </div>


    </div>
</div>


<!-- <div id="tpasg-malware-scanner" class="tpasg-card">
    <h2><?php esc_html_e( 'Advanced Malware Scanner', 'admin-safety-guard' ); ?></h2>
    <p><?php esc_html_e( 'Run a heuristic scan in batches with progress and a final summary.', 'admin-safety-guard' ); ?>
    </p> -->


<!-- </div> -->

<!-- PRO POPUP OVERLAY -->
<?php echo $is_pro && !$is_valid_license_available ? Utility::get_template( 'popup/pro-features-popup.php' ) : ''; ?>