<?php
/**
 * Reusable upgrade-hint card. Include from any tab to nudge free users
 * toward Pro. Caller may set $sf_hint_title / $sf_hint_body / $sf_hint_features
 * BEFORE include; falls back to neutral defaults.
 *
 * Renders nothing if Pro is already active.
 *
 * @package Brainwerk Security Suite
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

if ( shieldforge_is_pro() ) {
    return;
}

$sf_hint_title    = isset( $sf_hint_title ) ? (string) $sf_hint_title : __( 'Unlock more in Brainwerk Security Suite Pro', 'brainwerk-security-suite' );
$sf_hint_body     = isset( $sf_hint_body ) ? (string) $sf_hint_body : __( 'The free build covers logging, brute-force protection, hardening, and basic anomaly detection. Pro adds adaptive thresholds, geo blocking, 2FA / WebAuthn, chat-app alerts and a multisite aggregate dashboard.', 'brainwerk-security-suite' );
$sf_hint_features = isset( $sf_hint_features ) && is_array( $sf_hint_features ) ? $sf_hint_features : array();
$sf_hint_cta      = isset( $sf_hint_cta ) ? (string) $sf_hint_cta : Shieldforge_Admin::tab_url( 'license' );
?>
<div class="shieldforge-card sf-upgrade-hint">
    <h3>
        <?php echo esc_html( $sf_hint_title ); ?>
        <span class="sf-badge sf-badge-pro"><?php esc_html_e( 'Pro', 'brainwerk-security-suite' ); ?></span>
    </h3>
    <p><?php echo esc_html( $sf_hint_body ); ?></p>
    <?php if ( ! empty( $sf_hint_features ) ) : ?>
        <ul class="sf-feature-list">
            <?php foreach ( $sf_hint_features as $feat ) : ?>
                <li><?php echo esc_html( $feat ); ?></li>
            <?php endforeach; ?>
        </ul>
    <?php endif; ?>
    <p>
        <a class="button button-primary" href="<?php echo esc_url( $sf_hint_cta ); ?>">
            <?php esc_html_e( 'See license options', 'brainwerk-security-suite' ); ?>
        </a>
    </p>
</div>
