<?php
namespace ComptaFlowUK\Admin\Screens;

defined('ABSPATH') || exit;

class PlanScreen
{
    public static function render(): void
    {
        if (!current_user_can('manage_options')) {
            wp_die(esc_html__('Insufficient permissions.', 'comptaflow-uk-by-meetempo'));
        }

        echo '<div class="wrap">';
        echo '<h1>' . esc_html__('ComptaFlow UK Pro Features', 'comptaflow-uk-by-meetempo') . '</h1>';

        self::showFeatures();

        echo '</div>';
    }

    private static function showFeatures(): void
    {
        echo '<div style="background: white; padding: 25px; margin: 20px 0; border: 1px solid #ddd; border-radius: 8px;">';
        echo '<h2 style="margin-top: 0;">' . esc_html__('About ComptaFlow UK Pro', 'comptaflow-uk-by-meetempo') . '</h2>';
        echo '<p>' . esc_html__('ComptaFlow UK Pro is a separate plugin that adds advanced features for growing businesses. Your existing data is fully compatible.', 'comptaflow-uk-by-meetempo') . '</p>';
        echo '</div>';

        echo '<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 40px; margin: 30px 0; border-radius: 12px; box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);">';
        echo '<h2 style="margin-top: 0; color: white; font-size: 28px;">' . esc_html__('ComptaFlow UK Pro', 'comptaflow-uk-by-meetempo') . '</h2>';
        echo '<p style="color: rgba(255,255,255,0.95); font-size: 17px; line-height: 1.6; margin: 20px 0;">' .
            esc_html__('For advanced features (automatic VAT returns, Year End Reports, Priority Support), discover our separate ComptaFlow UK Pro plugin.', 'comptaflow-uk-by-meetempo') .
        '</p>';

        echo '<p style="margin: 35px 0 25px 0;">';
        echo '<a href="https://comptaflow-uk.meetempo.com/pricing.html"
               class="button button-hero"
               target="_blank"
               style="background: white;
                      color: #667eea;
                      border: none;
                      text-shadow: none;
                      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
                      padding: 16px 48px;
                      font-size: 18px;
                      font-weight: 600;
                      height: auto;
                      line-height: 1.5;
                      text-decoration: none;
                      display: inline-block;
                      border-radius: 8px;
                      transition: all 0.3s;">';
        echo esc_html__('Learn more about Pro features', 'comptaflow-uk-by-meetempo');
        echo '</a>';
        echo '</p>';

        echo '<div style="margin-top: 35px; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.2);">';
        echo '<h3 style="color: white; margin-bottom: 20px; font-size: 20px;">' . esc_html__('Pro Features Overview', 'comptaflow-uk-by-meetempo') . '</h3>';

        echo '<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px;">';

        // STANDARD
        echo '<div style="background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); padding: 20px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2);">';
        echo '<div style="color: white; font-size: 18px; font-weight: 600; margin-bottom: 8px;">STANDARD</div>';
        echo '<div style="color: white; font-size: 28px; font-weight: bold; margin-bottom: 15px;">£9.99<span style="font-size: 14px; font-weight: normal;">/' . esc_html__('month', 'comptaflow-uk-by-meetempo') . '</span></div>';
        echo '<ul style="list-style: none; padding: 0; margin: 0; color: rgba(255,255,255,0.9); font-size: 14px; line-height: 1.8;">';
        echo '<li>' . esc_html__('200 transactions/month', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '<li>' . esc_html__('Income & Expenses', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '<li>' . esc_html__('Accounting Journal', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '<li>' . esc_html__('Audit Trail/Trial Balance Exports', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '<li>' . esc_html__('Bank Reconciliation', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '</ul>';
        echo '</div>';

        // PLUS
        echo '<div style="background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); padding: 20px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2);">';
        echo '<div style="color: white; font-size: 18px; font-weight: 600; margin-bottom: 8px;">PLUS</div>';
        echo '<div style="color: white; font-size: 28px; font-weight: bold; margin-bottom: 15px;">£13.99<span style="font-size: 14px; font-weight: normal;">/' . esc_html__('month', 'comptaflow-uk-by-meetempo') . '</span></div>';
        echo '<ul style="list-style: none; padding: 0; margin: 0; color: rgba(255,255,255,0.9); font-size: 14px; line-height: 1.8;">';
        echo '<li>' . esc_html__('Unlimited transactions', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '<li>' . esc_html__('Everything in STANDARD +', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '<li>' . esc_html__('VAT Management (Quarterly/Annual Returns)', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '<li>' . esc_html__('Fixed Assets', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '<li>' . esc_html__('Simplified Payroll', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '<li>' . esc_html__('Smart Alerts', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '</ul>';
        echo '</div>';

        // VIP
        echo '<div style="background: rgba(255,255,255,0.15); backdrop-filter: blur(10px); padding: 20px; border-radius: 8px; border: 2px solid white; position: relative;">';
        echo '<div style="color: white; font-size: 18px; font-weight: 600; margin-bottom: 8px; margin-top: 8px;">VIP</div>';
        echo '<div style="color: white; font-size: 28px; font-weight: bold; margin-bottom: 4px;">£19.90<span style="font-size: 14px; font-weight: normal;">/' . esc_html__('month', 'comptaflow-uk-by-meetempo') . '</span></div>';
        echo '<div style="color: #ffd700; font-size: 13px; margin-bottom: 15px;">' . esc_html__('or £160/year (4 months free)', 'comptaflow-uk-by-meetempo') . '</div>';
        echo '<ul style="list-style: none; padding: 0; margin: 0; color: rgba(255,255,255,0.9); font-size: 14px; line-height: 1.8;">';
        echo '<li>' . esc_html__('Everything in PLUS +', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '<li>' . esc_html__('Year End Reports', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '<li>' . esc_html__('Priority support', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '<li>' . esc_html__('Accountant collaboration', 'comptaflow-uk-by-meetempo') . '</li>';
        echo '</ul>';
        echo '</div>';

        echo '</div>';
        echo '</div>';
        echo '</div>';

        // Help section
        echo '<div style="background: #fff3cd; padding: 20px; border-left: 4px solid #ffc107; border-radius: 4px; margin-top: 20px;">';
        echo '<p style="margin: 0; color: #856404;">';
        echo '<strong>' . esc_html__('Need help?', 'comptaflow-uk-by-meetempo') . '</strong> ' . esc_html__('Contact us:', 'comptaflow-uk-by-meetempo') . ' ';
        echo '<a href="mailto:support@meetempo.com" style="color: #667eea; font-weight: 600;">support@meetempo.com</a>';
        echo '</p>';
        echo '</div>';
    }
}
