<?php
/**
 * Customizer Upgrade to Pro Section
 *
 * @package Paws_And_Care
 * @since 0.0.1
 */

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

/**
 * Custom control for Upgrade to Pro button
 */
if (class_exists('WP_Customize_Control')) {
    class Paws_And_Care_Upgrade_Control extends WP_Customize_Control {
        public $type = 'upgrade-pro';
        
        public function render_content() {
            ?>
            <div class="paws-upgrade-pro-wrapper">
                <h3>🚀 <?php esc_html_e('Upgrade to Premium', 'paws-and-care'); ?></h3>
                <p class="tagline"><?php esc_html_e('Unlock the full potential of your pet care website!', 'paws-and-care'); ?></p>
                
                <div class="features-grid">
                    <div class="feature-item">
                        <span class="dashicons dashicons-layout"></span>
                        <?php esc_html_e('10 Homepage Sections', 'paws-and-care'); ?>
                    </div>
                    <div class="feature-item">
                        <span class="dashicons dashicons-welcome-widgets-menus"></span>
                        <?php esc_html_e('10 Page Templates', 'paws-and-care'); ?>
                    </div>
                    <div class="feature-item">
                        <span class="dashicons dashicons-admin-plugins"></span>
                        <?php esc_html_e('Elementor Integration', 'paws-and-care'); ?>
                    </div>
                    <div class="feature-item">
                        <span class="dashicons dashicons-portfolio"></span>
                        <?php esc_html_e('Portfolio Gallery', 'paws-and-care'); ?>
                    </div>
                    <div class="feature-item">
                        <span class="dashicons dashicons-format-quote"></span>
                        <?php esc_html_e('Testimonials Slider', 'paws-and-care'); ?>
                    </div>
                    <div class="feature-item">
                        <span class="dashicons dashicons-groups"></span>
                        <?php esc_html_e('Team Section', 'paws-and-care'); ?>
                    </div>
                    <div class="feature-item">
                        <span class="dashicons dashicons-cart"></span>
                        <?php esc_html_e('Pricing Tables', 'paws-and-care'); ?>
                    </div>
                    <div class="feature-item">
                        <span class="dashicons dashicons-sos"></span>
                        <?php esc_html_e('Priority Support', 'paws-and-care'); ?>
                    </div>
                </div>
                
                <a href="<?php echo esc_url('https://wpfrank.com/demo/paws-and-care-premium/'); ?>" 
                   target="_blank" 
                   class="demo-btn">
                    👁️ <?php esc_html_e('View Live Demo', 'paws-and-care'); ?>
                </a>
                
                <a href="<?php echo esc_url('https://wpfrank.com/wordpress-themes/paws-and-care-premium/'); ?>" 
                   target="_blank" 
                   class="upgrade-btn">
                    <?php esc_html_e('🎁 Get Premium Now', 'paws-and-care'); ?>
                </a>
                
                <p class="bonus-text">
                    ✓ <?php esc_html_e('Lifetime Updates', 'paws-and-care'); ?> &nbsp;•&nbsp; 
                    ✓ <?php esc_html_e('30-Day Guarantee', 'paws-and-care'); ?>
                </p>
            </div>
            <?php
        }
    }
}

/**
 * Register Upgrade to Pro section in Customizer
 */
function paws_and_care_customize_register_upgrade($wp_customize) {
    
    // Add Upgrade Section
    $wp_customize->add_section('paws_and_care_upgrade_section', array(
        'title'       => __('★ Upgrade to Pro', 'paws-and-care'),
        'priority'    => 1,
        'description' => '',
    ));
    
    // Add dummy setting (required for control)
    $wp_customize->add_setting('paws_and_care_upgrade_pro', array(
        'sanitize_callback' => 'sanitize_text_field',
    ));
    
    // Add Upgrade Control
    $wp_customize->add_control(new Paws_And_Care_Upgrade_Control(
        $wp_customize,
        'paws_and_care_upgrade_pro',
        array(
            'section' => 'paws_and_care_upgrade_section',
        )
    ));
}
add_action('customize_register', 'paws_and_care_customize_register_upgrade', 999);
