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

function termin_kalender_add_block_pro_info_admin_menu()
{
    //global $ter_kal_admin_pages_hook_suffixes;
    $page_title = esc_html__('Support & PRO Info', 'termin-kalender');
    $menu_title = $page_title;
    $capability = 'termin_kalender_edit';
    $menu_slug = 'terminkalender_pro_info';
    $callback = 'termin_kalender_render_block_pro_info_admin_menu_page';

    Termin_Kalender_Plugin::$ter_kal_admin_pages_hook_suffixes[] = add_submenu_page(
        'termin-kalender',
        $page_title,
        $menu_title,
        $capability,
        $menu_slug,
        $callback,
    );
}
// add_action('admin_menu', 'termin_kalender_add_block_pro_info_admin_menu', 90);


//-------------------------------------------------------------------------------------

function termin_kalender_render_block_pro_info_admin_menu_page()
{
    // Check user capabilities
    if (!current_user_can('termin_kalender_edit')) {
        return;
    }
    ?>
    <div class="wrap">
        <h2 style="font-size: 2em; font-weight: 600; color: #1d2327; margin-bottom: 20px;">
            <?php echo esc_html__('Support & PRO Info', 'termin-kalender'); ?> <span class="label label-pro" style="vertical-align: middle; font-size: 14px; position: relative; top: -4px;">PRO</span>
        </h2>
        <?php
        if (class_exists('Termin_Kalender_Rating_Notice')) {
            Termin_Kalender_Rating_Notice::render_rating_notice();
        }
        ?>
        <div class="tk-modern-wrapper">
            <div class="tk-modern-card">
                <div class="card-header">
                    <div class="termin-kalender-update-info">
                        <h1><?php echo esc_html__('Get Termin-Kalender PRO!', 'termin-kalender'); ?></h1>
                        <p style="font-size: 1.1em; color: #444; margin-bottom: 20px;">
                            <?php echo esc_html__('Manage team tasks, schedule meetings, display events, and accept bookings instantly—without the excessive bloat of heavy platforms.', 'termin-kalender'); ?>
                        </p>

                        <div
                            style="background: #f8f9fa; border: 1px solid #e2e8f0; border-radius: 6px; padding: 20px; margin-bottom: 25px; text-align: center;">
                            <h3 style="margin-top: 0;">
                                <?php echo esc_html__('Go PRO with Termin-Kalender', 'termin-kalender'); ?></h3>
                            <p style="margin-bottom: 15px;">
                                <?php echo esc_html__('More features. More control. Organize your month with ease.', 'termin-kalender'); ?>
                            </p>

                            <p>
                                <a href="https://checkout.freemius.com/plugin/13582/plan/22720/" target="_blank"
                                    class="button button-primary button-large">
                                    Start with PRO (EN $)
                                </a>
                            </p>
                            <p>
                                <a href="https://checkout.freemius.com/plugin/13582/plan/22720/?currency=eur&language=de"
                                    target="_blank" class="button">
                                    Jetzt auf PRO upgraden (DE €)
                                </a>
                            </p>
                            <p style="margin-bottom: 0;">
                                <a href="https://checkout.freemius.com/plugin/13582/plan/22720/?currency=eur&language=fr"
                                    target="_blank" class="button">
                                    Télécharger PRO (FR €)
                                </a>
                            </p>
                        </div>
                    </div>
                    <div class="card-body">
                        <hr>
                        <?php
                        require_once Termin_Kalender_Plugin::$plugin_dir_path . 'includes/admin_page_PRO_features.php';
                        termin_kalender_pro_features();
                        ?>
                        <hr>
                        <b><?php echo esc_html__('Important Update Info:', 'termin-kalender'); ?></b>
                        <p><?php echo esc_html__('Keep your existing free Termin-Kalender (Light version) installed alongside the PRO version. If you encounter any issues during the update process, please contact us.', 'termin-kalender'); ?>
                        </p>
                        <br>
                    </div>
                </div>
            </div>

        </div>
        <?php
} // end terminkalender_template_compatibility