<?php
/**
 * Premium Required Page
 *
 * Displayed when a free-plan user navigates to a pro-only page.
 * Expects the calling context to set which feature is locked.
 *
 * @package Freelance_Studio
 */

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

// Determine which page we're on from the query string
$current_page = isset($_GET['page']) ? sanitize_text_field($_GET['page']) : '';
$feature_key = '';
$feature_title = '';
$feature_desc = '';

switch ($current_page) {
    case 'fs-forms':
        $feature_key = 'forms';
        $feature_title = __('Forms', 'freelance-studio');
        $feature_desc = __('Create custom intake forms, client questionnaires, and project briefs that clients can fill out directly on your site.', 'freelance-studio');
        break;
    case 'fs-bookings':
        $feature_key = 'booking';
        $feature_title = __('Bookings', 'freelance-studio');
        $feature_desc = __('Let clients book meetings with you directly from your website, with Google Calendar and Google Meet integration.', 'freelance-studio');
        break;
    case 'fs-project-templates':
        $feature_key = 'templates';
        $feature_title = __('Project Templates', 'freelance-studio');
        $feature_desc = __('Save and reuse project templates to streamline your workflow for recurring project types.', 'freelance-studio');
        break;
    default:
        $feature_key = 'generic';
        $feature_title = __('Pro Feature', 'freelance-studio');
        $feature_desc = __('This feature requires Freelance Studio Pro.', 'freelance-studio');
        break;
}

$upgrade_url = function_exists('freelance_studio_fs') ? freelance_studio_fs()->get_upgrade_url() : '#';
?>
<div class="wrap fs-wrap">
    <div class="fs-premium-required">
        <div class="fs-premium-required-icon">🌟</div>
        <h1><?php echo esc_html($feature_title); ?></h1>
        <p><?php echo esc_html($feature_desc); ?></p>
        <div style="margin-top: 24px;">
            <a href="<?php echo esc_url($upgrade_url); ?>" class="fs-btn fs-btn-primary">
                <?php esc_html_e('Upgrade to Pro', 'freelance-studio'); ?>
            </a>
        </div>
        <p class="fs-premium-help">
            <?php esc_html_e('Already have a license?', 'freelance-studio'); ?>
            <a href="<?php echo  esc_url( admin_url('admin.php?page=freelance-studio-account') ); ?>"><?php esc_html_e('Activate it here', 'freelance-studio'); ?></a>
        </p>
    </div>
</div>
