<?php

/**

 * Enqueue the Force Inject FMC JavaScript

 * This ensures our Fraud Management Center loads

 */



add_action('admin_enqueue_scripts', 'sensfrx_enqueue_fmc_scripts', 999);



function sensfrx_enqueue_fmc_scripts($hook) {

    // Check if we're on the fraud page

    if (isset($_GET['page']) && $_GET['page'] === 'sensfrx_fpwoo' && isset($_GET['tab']) && $_GET['tab'] === 'fraud') {



        // Enqueue our force inject script

        wp_enqueue_script(

            'sensfrx-force-fmc',

            plugin_dir_url(__FILE__) . '../js/sensfrx-force-inject-fmc.js',

            array('jquery'),

            '1.0.0',

            true

        );



        // Add inline CSS for better styling

        wp_add_inline_style('wp-admin', '

            .fmc-wrapper { animation: fadeIn 0.5s ease-in; }

            @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

            .fmc-pill:hover { transform: translateY(-1px); transition: all 0.2s; }

            .fmc-risk-card { transition: all 0.2s; }

            .fmc-risk-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

            .fmc-export-btn:hover { background: #059669 !important; transform: translateY(-1px); transition: all 0.2s; }

            .fmc-search:focus { outline: none; border-color: #667eea !important; box-shadow: 0 0 0 3px rgba(102,126,234,0.1) !important; }

        ');

    }

}