<?php
/**
 * Theme Info Page
 *
 * @package Paws_And_Care
 */

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

/**
 * Add Theme Info Page
 */
function paws_and_care_add_theme_info_page() {
    $theme_name = wp_get_theme()->get('Name');
    add_theme_page(
        /* translators: %s: theme name */
        sprintf( esc_html__('%s Info', 'paws-and-care'), $theme_name ),
        /* translators: %s: theme name */
        sprintf( esc_html__('%s Info', 'paws-and-care'), $theme_name ),
        'edit_theme_options',
        'paws-and-care-info',
        'paws_and_care_theme_info_page'
    );
}
add_action('admin_menu', 'paws_and_care_add_theme_info_page');

/**
 * Theme Info page content
 */
function paws_and_care_theme_info_page() {
    $theme = wp_get_theme();
    $theme_name = $theme->get('Name');
    ?>
    <div class="wrap paws-theme-info">
        <h1><?php /* translators: %s: theme name */ printf( esc_html__('%s Theme', 'paws-and-care'), esc_html( $theme_name ) ); ?></h1>
        
        <!-- Welcome Banner (Full Width) -->
        <div class="paws-welcome-banner">
            <div>
                <h2><?php /* translators: %s: theme name */ printf( esc_html__('Welcome to %s!', 'paws-and-care'), esc_html( $theme_name ) ); ?></h2>
                <p><?php esc_html_e('Thank you for choosing our premium-grade multipurpose theme. Unlock even more power with Premium!', 'paws-and-care'); ?></p>
            </div>
            <div style="display: flex; gap: 12px; flex-wrap: wrap;">
                <a href="<?php echo esc_url(admin_url('customize.php')); ?>" class="paws-banner-btn">
                    🎨 <?php esc_html_e('Customize', 'paws-and-care'); ?>
                </a>
                <a href="<?php echo esc_url('https://wpfrank.com/wordpress-themes/paws-and-care-premium/'); ?>" target="_blank" class="paws-banner-btn-primary">
                    ⭐ <?php esc_html_e('Upgrade to Premium', 'paws-and-care'); ?>
                </a>
            </div>
        </div>
        
        <style>
            .paws-demo-card:hover {
                box-shadow: 0 5px 15px rgba(0,0,0,0.1);
                transform: translateY(-2px);
            }
        </style>
        
        <!-- Premium Demos (New Section) -->
        <div class="paws-premium-demos" style="margin-bottom: 30px; background: #fff; padding: 25px; border: 1px solid #ccd0d4; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.04);">
            <div style="text-align: center; margin-bottom: 25px;">
                <h2 style="margin-top: 0; font-size: 22px; font-weight: 600; color: #1d2327;"><span class="dashicons dashicons-images-alt2" style="font-size: 24px; width: 24px; height: 24px; margin-right: 8px; vertical-align: bottom; color: var(--paws-admin-color, #2271b1);"></span><?php esc_html_e('Explore Premium Multipurpose Demos', 'paws-and-care'); ?></h2>
                <p style="font-size: 14px; color: #50575e; margin: 5px 0 0 0;"><?php esc_html_e('Upgrade to Premium to instantly import beautifully designed, niche-specific starter sites.', 'paws-and-care'); ?></p>
            </div>
            
            <div class="paws-demos-grid" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; max-width: 800px; margin: 0 auto;">
                
                <!-- Demo 1: Pet Care -->
                <div class="paws-demo-card" style="border: 1px solid #dcdcde; border-radius: 6px; overflow: hidden; background: #fff; transition: all 0.3s ease;">
                    <div style="background: #f0f2f4; height: 250px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #eee; position: relative;">
                        <img src="<?php echo esc_url( get_template_directory_uri() . '/assets/img/demo-images/Paws-and-Care-Premium.webp' ); ?>" alt="<?php esc_attr_e('Pet Care Demo', 'paws-and-care'); ?>" style="width: 100%; height: 100%; object-fit: cover; object-position: top center;">
                        <div style="position: absolute; top: 15px; right: 15px; background: #fff; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; color: #50575e; box-shadow: 0 1px 3px rgba(0,0,0,0.1);"><?php esc_html_e('Main Theme', 'paws-and-care'); ?></div>
                    </div>
                    <div style="padding: 20px; text-align: center;">
                        <h3 style="margin: 0 0 15px 0; font-size: 18px; font-weight: 700; color: #2c3338;"><?php esc_html_e('Pet Care', 'paws-and-care'); ?></h3>
                        <a href="<?php echo esc_url('https://wpfrank.com/demo/paws-and-care-premium/'); ?>" target="_blank" class="button button-primary" style="width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: 8px; background: var(--paws-admin-color, #2271b1); border-color: var(--paws-admin-color, #2271b1); padding: 5px 15px;">
                            <span class="dashicons dashicons-external" style="font-size: 18px; width: 18px; height: 18px; display: flex; align-items: center;"></span><?php esc_html_e('Live Preview', 'paws-and-care'); ?>
                        </a>
                    </div>
                </div>

                <!-- Demo 2: Veterinary Clinic -->
                <div class="paws-demo-card" style="border: 1px solid #dcdcde; border-radius: 6px; overflow: hidden; background: #fff; transition: all 0.3s ease;">
                    <div style="background: #e8f5e9; height: 250px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #eee; position: relative;">
                         <img src="<?php echo esc_url( get_template_directory_uri() . '/assets/img/demo-images/Paws-Clinic-Premium.webp' ); ?>" alt="<?php esc_attr_e('Veterinary Clinic Demo', 'paws-and-care'); ?>" style="width: 100%; height: 100%; object-fit: cover; object-position: top center;">
                        <div style="position: absolute; top: 15px; right: 15px; background: #fff; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; color: #2e7d32; box-shadow: 0 1px 3px rgba(0,0,0,0.1);"><?php esc_html_e('Clinic Theme', 'paws-and-care'); ?></div>
                    </div>
                    <div style="padding: 20px; text-align: center;">
                        <h3 style="margin: 0 0 15px 0; font-size: 18px; font-weight: 700; color: #2c3338;"><?php esc_html_e('Veterinary Clinic', 'paws-and-care'); ?></h3>
                        <a href="<?php echo esc_url('https://wpfrank.com/demo/paws-clinic-premium/'); ?>" target="_blank" class="button button-primary" style="width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: 8px; background: var(--paws-admin-color, #2271b1); border-color: var(--paws-admin-color, #2271b1); padding: 5px 15px;">
                            <span class="dashicons dashicons-external" style="font-size: 18px; width: 18px; height: 18px; display: flex; align-items: center;"></span><?php esc_html_e('Live Preview', 'paws-and-care'); ?>
                        </a>
                    </div>
                </div>

            </div>
        </div>
        
        <div class="paws-main-content">
        
        <!-- Left: Comparison Table -->
        <div class="paws-features">
            <h2><span class="dashicons dashicons-star-filled" style="color: var(--paws-admin-color);"></span> <?php esc_html_e('Free vs Premium Features', 'paws-and-care'); ?></h2>
            
            <table>
                <thead>
                    <tr>
                        <th><?php esc_html_e('Feature', 'paws-and-care'); ?></th>
                        <th style="text-align: center;"><?php esc_html_e('Free', 'paws-and-care'); ?></th>
                        <th style="text-align: center; color: var(--paws-admin-color);"><?php esc_html_e('Premium', 'paws-and-care'); ?></th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td><span class="dashicons dashicons-layout feature-icon"></span><?php esc_html_e('Homepage Sections', 'paws-and-care'); ?></td>
                        <td style="text-align: center;">4</td>
                        <td style="text-align: center;" class="highlight">10</td>
                    </tr>
                    <tr>
                        <td><span class="dashicons dashicons-slides feature-icon"></span><?php esc_html_e('Hero Slider', 'paws-and-care'); ?></td>
                        <td style="text-align: center;" class="check">✓</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr>
                        <td><span class="dashicons dashicons-hammer feature-icon"></span><?php esc_html_e('Services Section', 'paws-and-care'); ?></td>
                        <td style="text-align: center;" class="check">✓</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr>
                        <td><span class="dashicons dashicons-info feature-icon"></span><?php esc_html_e('About Section', 'paws-and-care'); ?></td>
                        <td style="text-align: center;" class="check">✓</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr>
                        <td><span class="dashicons dashicons-edit feature-icon"></span><?php esc_html_e('Blog Section', 'paws-and-care'); ?></td>
                        <td style="text-align: center;" class="check">✓</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr>
                        <td><span class="dashicons dashicons-email feature-icon"></span><?php esc_html_e('Contact Section', 'paws-and-care'); ?></td>
                        <td style="text-align: center;" class="check">✓</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr class="premium-only">
                        <td><span class="dashicons dashicons-portfolio feature-icon"></span><strong><?php esc_html_e('Portfolio Section', 'paws-and-care'); ?></strong></td>
                        <td style="text-align: center;" class="cross">—</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr class="premium-only">
                        <td><span class="dashicons dashicons-format-quote feature-icon"></span><strong><?php esc_html_e('Testimonials Slider', 'paws-and-care'); ?></strong></td>
                        <td style="text-align: center;" class="cross">—</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr class="premium-only">
                        <td><span class="dashicons dashicons-tag feature-icon"></span><strong><?php esc_html_e('Pricing Tables', 'paws-and-care'); ?></strong></td>
                        <td style="text-align: center;" class="cross">—</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr class="premium-only">
                        <td><span class="dashicons dashicons-groups feature-icon"></span><strong><?php esc_html_e('Team Section', 'paws-and-care'); ?></strong></td>
                        <td style="text-align: center;" class="cross">—</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr class="premium-only">
                        <td><span class="dashicons dashicons-megaphone feature-icon"></span><strong><?php esc_html_e('CTA Section', 'paws-and-care'); ?></strong></td>
                        <td style="text-align: center;" class="cross">—</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr class="premium-only">
                        <td><span class="dashicons dashicons-building feature-icon"></span><strong><?php esc_html_e('Clients/Partners', 'paws-and-care'); ?></strong></td>
                        <td style="text-align: center;" class="cross">—</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr class="premium-only">
                        <td><span class="dashicons dashicons-chart-bar feature-icon"></span><strong><?php esc_html_e('Stats/Counter Section', 'paws-and-care'); ?></strong></td>
                        <td style="text-align: center;" class="cross">—</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr class="section-header">
                        <td colspan="3"><span class="dashicons dashicons-admin-page"></span> <?php esc_html_e('Page Templates', 'paws-and-care'); ?></td>
                    </tr>
                    <tr>
                        <td><span class="dashicons dashicons-media-document feature-icon"></span><?php esc_html_e('Total Page Templates', 'paws-and-care'); ?></td>
                        <td style="text-align: center;">5</td>
                        <td style="text-align: center;" class="highlight">12</td>
                    </tr>
                    <tr>
                        <td><span class="dashicons dashicons-editor-expand feature-icon"></span><?php esc_html_e('Full Width & Canvas Templates', 'paws-and-care'); ?></td>
                        <td style="text-align: center;" class="check">✓</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr class="premium-only">
                        <td><span class="dashicons dashicons-id-alt feature-icon"></span><strong><?php esc_html_e('About Page Template', 'paws-and-care'); ?></strong></td>
                        <td style="text-align: center;" class="cross">—</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr class="premium-only">
                        <td><span class="dashicons dashicons-images-alt2 feature-icon"></span><strong><?php esc_html_e('Portfolio Page Template', 'paws-and-care'); ?></strong></td>
                        <td style="text-align: center;" class="cross">—</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr class="premium-only">
                        <td><span class="dashicons dashicons-grid-view feature-icon"></span><strong><?php esc_html_e('Multiple Blog Layouts', 'paws-and-care'); ?></strong></td>
                        <td style="text-align: center;" class="cross">—</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr class="section-header">
                        <td colspan="3"><span class="dashicons dashicons-admin-plugins"></span> <?php esc_html_e('Integrations & Support', 'paws-and-care'); ?></td>
                    </tr>
                    <tr>
                        <td><span class="dashicons dashicons-admin-customizer feature-icon"></span><?php esc_html_e('Elementor Support', 'paws-and-care'); ?></td>
                        <td style="text-align: center;"><?php esc_html_e('Basic', 'paws-and-care'); ?></td>
                        <td style="text-align: center;" class="highlight"><?php esc_html_e('Full', 'paws-and-care'); ?></td>
                    </tr>
                    <tr class="premium-only">
                        <td><span class="dashicons dashicons-editor-expand feature-icon"></span><strong><?php esc_html_e('Elementor Canvas Template', 'paws-and-care'); ?></strong></td>
                        <td style="text-align: center;" class="cross">—</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr>
                        <td><span class="dashicons dashicons-admin-settings feature-icon"></span><?php esc_html_e('Theme Customizer Options', 'paws-and-care'); ?></td>
                        <td style="text-align: center;"><?php esc_html_e('Basic', 'paws-and-care'); ?></td>
                        <td style="text-align: center;" class="highlight"><?php esc_html_e('Advanced', 'paws-and-care'); ?></td>
                    </tr>
                    <tr>
                        <td><span class="dashicons dashicons-editor-textcolor feature-icon"></span><?php esc_html_e('Typography Controls', 'paws-and-care'); ?></td>
                        <td style="text-align: center;"><?php esc_html_e('Basic', 'paws-and-care'); ?></td>
                        <td style="text-align: center;" class="highlight"><?php esc_html_e('Advanced', 'paws-and-care'); ?></td>
                    </tr>
                    <tr>
                        <td><span class="dashicons dashicons-art feature-icon"></span><?php esc_html_e('Color Options', 'paws-and-care'); ?></td>
                        <td style="text-align: center;" class="check">✓</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr>
                        <td><span class="dashicons dashicons-smartphone feature-icon"></span><?php esc_html_e('Responsive Design', 'paws-and-care'); ?></td>
                        <td style="text-align: center;" class="check">✓</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr>
                        <td><span class="dashicons dashicons-translation feature-icon"></span><?php esc_html_e('Translation Ready', 'paws-and-care'); ?></td>
                        <td style="text-align: center;" class="check">✓</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr class="premium-only">
                        <td><span class="dashicons dashicons-sos feature-icon"></span><strong><?php esc_html_e('Priority Support', 'paws-and-care'); ?></strong></td>
                        <td style="text-align: center;" class="cross">—</td>
                        <td style="text-align: center;" class="check">✓</td>
                    </tr>
                    <tr class="premium-only">
                        <td><span class="dashicons dashicons-update feature-icon"></span><strong><?php esc_html_e('Lifetime Updates', 'paws-and-care'); ?></strong></td>
                        <td style="text-align: center;" class="cross">—</td>
                        <td style="text-align: center;">✓</td>
                    </tr>
                </tbody>
            </table>
            
            <p style="margin-top: 20px; text-align: center;">
                <a href="<?php echo esc_url('https://wpfrank.com/wordpress-themes/paws-and-care-premium/'); ?>" target="_blank" class="button button-primary button-hero" style="background: var(--paws-admin-color); border-color: var(--paws-admin-color);">
                    <?php esc_html_e('Upgrade to Premium Now', 'paws-and-care'); ?>
                </a>
            </p>
        </div>
        
        <!-- Right: Sidebar -->
        <div class="paws-sidebar">
            
            <!-- Quick Actions -->
            <div class="paws-sidebar-box">
                <h3><span class="dashicons dashicons-admin-tools"></span><?php esc_html_e('Quick Actions', 'paws-and-care'); ?></h3>
                <ul>
                    <li><a href="<?php echo esc_url(admin_url('customize.php')); ?>"><span class="dashicons dashicons-admin-customizer"></span><?php esc_html_e('Customize Theme', 'paws-and-care'); ?></a></li>
                    <li><a href="<?php echo esc_url(admin_url('nav-menus.php')); ?>"><span class="dashicons dashicons-menu"></span><?php esc_html_e('Setup Menus', 'paws-and-care'); ?></a></li>
                    <li><a href="<?php echo esc_url(admin_url('widgets.php')); ?>"><span class="dashicons dashicons-screenoptions"></span><?php esc_html_e('Setup Widgets', 'paws-and-care'); ?></a></li>
                    <li><a href="<?php echo esc_url('https://wpfrank.com/docs/paws-care/'); ?>" target="_blank"><span class="dashicons dashicons-book"></span><?php esc_html_e('Documentation', 'paws-and-care'); ?></a></li>
                </ul>
            </div>
            
            <!-- Theme Info -->
            <div class="paws-sidebar-box">
                <h3><span class="dashicons dashicons-info"></span><?php esc_html_e('Theme Info', 'paws-and-care'); ?></h3>
                <div class="info-row"><span><?php esc_html_e('Version', 'paws-and-care'); ?></span><strong><?php echo esc_html( $theme->get('Version') ); ?></strong></div>
                <div class="info-row"><span><?php esc_html_e('Author', 'paws-and-care'); ?></span><strong><?php echo esc_html( $theme->get('Author') ); ?></strong></div>
                <div class="info-row"><span><?php esc_html_e('Requires WP', 'paws-and-care'); ?></span><strong>6.0+</strong></div>
                <div class="info-row"><span><?php esc_html_e('Requires PHP', 'paws-and-care'); ?></span><strong>7.4+</strong></div>
            </div>
            
            <!-- Rate Theme -->
            <div class="paws-sidebar-box">
                <h3><span class="dashicons dashicons-star-filled"></span><?php esc_html_e('Rate This Theme', 'paws-and-care'); ?></h3>
                <div class="stars">★★★★★</div>
                <p style="margin: 0 0 12px 0; color: #666; font-size: 13px;"><?php /* translators: %s: theme name */ printf( esc_html__('Enjoying %s? Please rate it on WordPress.org!', 'paws-and-care'), esc_html( $theme_name ) ); ?></p>
                <a href="<?php echo esc_url('https://wordpress.org/support/theme/paws-and-care/reviews/#new-post'); ?>" target="_blank" class="button button-secondary"><?php esc_html_e('Leave a Review', 'paws-and-care'); ?></a>
            </div>
            
            <!-- Need Help -->
            <div class="paws-sidebar-box">
                <h3><span class="dashicons dashicons-sos"></span><?php esc_html_e('Need Help?', 'paws-and-care'); ?></h3>
                <ul>
                    <li><a href="<?php echo esc_url('https://wordpress.org/support/theme/paws-and-care/'); ?>" target="_blank"><span class="dashicons dashicons-format-chat"></span><?php esc_html_e('Support Forum', 'paws-and-care'); ?></a></li>
                    <li><a href="<?php echo esc_url('https://wpfrank.com/contact/'); ?>" target="_blank"><span class="dashicons dashicons-email"></span><?php esc_html_e('Contact Us', 'paws-and-care'); ?></a></li>
                </ul>
            </div>
            
        </div>
        </div><!-- .paws-main-content -->
        
    </div>
    <?php
}
