<?php
$options = get_option('bpbooster_settings');
?>
<div class="wrap">
    <h1>Blog Popup Booster Settings</h1>
    <form method="post" action="options.php">
        <?php settings_fields('bpbooster_options_group'); ?>
        <table class="form-table">
            <tr><th>Headline</th><td><input type="text" name="bpbooster_settings[headline]" value="<?php echo esc_attr($options['headline'] ?? ''); ?>" class="regular-text" /></td></tr>
            <tr><th>Subheadline</th><td><input type="text" name="bpbooster_settings[subheadline]" value="<?php echo esc_attr($options['subheadline'] ?? ''); ?>" class="regular-text" /></td></tr>
            <tr><th>Custom CTA Text</th><td><input type="text" name="bpbooster_settings[cta_text]" value="<?php echo esc_attr($options['cta_text'] ?? ''); ?>" class="regular-text" /></td></tr>
            <tr><th>Custom CTA Link</th><td><input type="url" name="bpbooster_settings[cta_link]" value="<?php echo esc_attr($options['cta_link'] ?? ''); ?>" class="regular-text" /></td></tr>
            <tr><th>Phone Number</th><td><input type="text" name="bpbooster_settings[phone]" value="<?php echo esc_attr($options['phone'] ?? ''); ?>" class="regular-text" /></td></tr>
            <tr><th>Email Address</th><td><input type="email" name="bpbooster_settings[email]" value="<?php echo esc_attr($options['email'] ?? ''); ?>" class="regular-text" /></td></tr>
            <tr><th>Report Emails (comma-separated)</th><td><input type="text" name="bpbooster_settings[emails]" value="<?php echo esc_attr($options['emails'] ?? ''); ?>" class="regular-text" /></td></tr>
            <tr><th>Report Frequency</th>
                <td>
                    <select name="bpbooster_settings[frequency]">
                        <option value="daily" <?php selected($options['frequency'] ?? '', 'daily'); ?>>Daily</option>
                        <option value="weekly" <?php selected($options['frequency'] ?? '', 'weekly'); ?>>Weekly</option>
                        <option value="monthly" <?php selected($options['frequency'] ?? '', 'monthly'); ?>>Monthly</option>
                    </select>
                </td>
            </tr>
        </table>
        <?php submit_button(); ?>
    </form>
</div>
