<?php
/**
 * VMPFence Global Options View
 *
 * @package VMPFence
 * @since 1.0.0
 * @since 2.1.0 Updated to reflect VMP WordPress Security branding.
 */

// Prevent direct access
if (!defined('ABSPATH')) {
    exit;
}
?>

<!-- Global Options Section (Hidden by default) -->
<div id="vmpfence-global-options" class="vmpfence-options-panel" style="display: none;">
    <div class="vmpfence-options-header">
        <h2>⚙️ Global Options</h2>
        <button onclick="hideGlobalOptions()" class="vmpfence-close-options">← Back to Dashboard</button>
    </div>
    
    <div class="vmpfence-options-content">
        <div class="vmpfence-options-grid">
            <div class="vmpfence-option-section">
                <h3>General Settings</h3>
                <div class="vmpfence-option-item">
                    <label>
                        <input type="checkbox" checked> Enable Protection
                    </label>
                    <p class="vmpfence-option-desc">Enable VMP WordPress Security protection</p>
                </div>
                <div class="vmpfence-option-item">
                    <label>
                        <input type="checkbox" checked> Enable Logging
                    </label>
                    <p class="vmpfence-option-desc">Log security events and activities</p>
                </div>
                <div class="vmpfence-option-item">
                    <label>
                        <input type="checkbox"> Debug Mode
                    </label>
                    <p class="vmpfence-option-desc">Enable debug logging (for troubleshooting)</p>
                </div>
                <div class="vmpfence-option-item">
                    <label>
                        <input type="checkbox" checked> Auto Updates
                    </label>
                    <p class="vmpfence-option-desc">Automatically update security definitions</p>
                </div>
            </div>
            
            <div class="vmpfence-option-section">
                <h3>Alert Settings</h3>
                <div class="vmpfence-option-item">
                    <label>
                        <input type="checkbox" checked> Email Alerts
                    </label>
                    <p class="vmpfence-option-desc">Send email notifications for security events</p>
                </div>
                <div class="vmpfence-option-item">
                    <label>
                        Email Address: <input type="email" value="admin@example.com" style="margin-left: 10px; width: 200px;">
                    </label>
                </div>
                <div class="vmpfence-option-item">
                    <label>
                        <input type="checkbox" checked> Browser Notifications
                    </label>
                    <p class="vmpfence-option-desc">Show browser notifications for alerts</p>
                </div>
                <div class="vmpfence-option-item">
                    <label>
                        <input type="checkbox"> SMS Alerts (Premium)
                    </label>
                    <p class="vmpfence-option-desc">Receive SMS notifications for critical events</p>
                </div>
            </div>
            
            <div class="vmpfence-option-section">
                <h3>Premium Status & Advanced</h3>
                <div class="vmpfence-option-item">
                    <?php
                    $current_license_type = VMPFence_License::get_license_type();
                    $is_premium = ($current_license_type === 'premium');
                    ?>
                    <p>
                        <strong>Status:</strong> 
                        <span style="color: <?php echo $is_premium ? '#28a745' : '#666'; ?>;">
                            <?php echo esc_html(ucfirst($current_license_type)); ?> Version
                        </span>
                    </p>
                    <?php if (!$is_premium) : ?>
                        <p class="vmpfence-option-desc">Upgrade to Premium for advanced features</p>
                        <button class="vmpfence-upgrade-btn" onclick="window.location.href='https://newton-wordpress-security.vpnmasterpro.com/upgrade/'">Upgrade to Premium</button>
                    <?php else : ?>
                        <p class="vmpfence-option-desc" style="color: #28a745;">✓ All premium features are unlocked</p>
                    <?php endif; ?>
                </div>
                <div class="vmpfence-option-item">
                    <label>
                        <input type="checkbox"> Two-Factor Authentication
                    </label>
                    <p class="vmpfence-option-desc">Enable 2FA for admin login (Premium)</p>
                </div>
                <div class="vmpfence-option-item">
                    <label>
                        <input type="checkbox"> Country Blocking
                    </label>
                    <p class="vmpfence-option-desc">Block traffic from specific countries (Premium)</p>
                </div>
                <div class="vmpfence-option-item">
                    <label>
                        <input type="checkbox"> Real-time IP Blocking
                    </label>
                    <p class="vmpfence-option-desc">Automatically block malicious IPs (Premium)</p>
                </div>
            </div>
        </div>
        
        <div class="vmpfence-options-actions">
            <button class="vmpfence-save-btn" onclick="saveGlobalOptions()">Save Changes</button>
            <button class="vmpfence-reset-btn" onclick="resetGlobalOptions()">Reset to Defaults</button>
        </div>
    </div>
</div>
