<?php
if (!defined('ABSPATH')) exit;
?>
        <!-- TAB 2: Public Widget -->
        <div id="tab-visibility" class="mtcam-tab-content">
            <h2>👁️ <?php esc_html_e('Public Widget Visibility', 'my-trail-camera'); ?></h2>
            <p><?php esc_html_e('Control what information is visible in the public widget. Admin panel always shows everything.', 'my-trail-camera'); ?></p>

            <div class="mtcam-tip-box mtcam-tip-box-blue mtcam-mt-15">
                <strong>ℹ️ <?php esc_html_e('IMPORTANT:', 'my-trail-camera'); ?></strong><br>
                <?php echo wp_kses(
                    __('Public widgets show <strong>ONLY YOUR cameras</strong>.', 'my-trail-camera'),
                    array('strong' => array())
                ); ?><br>
                <?php echo wp_kses(
                    __('Other people\'s cameras (added in "Other Cameras" section) are <strong>NOT shown</strong> in widgets.', 'my-trail-camera'),
                    array('strong' => array())
                ); ?>
            </div>

            <h3 class="mtcam-section-border-blue">📝 <?php esc_html_e('Log Settings (Detections)', 'my-trail-camera'); ?></h3>
            <table class="form-table">
                <tr>
                    <th><?php esc_html_e('Show IP Addresses', 'my-trail-camera'); ?></th>
                    <td>
                        <label>
                            <input type="checkbox" name="show_ip" value="yes" <?php checked($settings['show_ip'], 'yes'); ?>>
                            <?php esc_html_e('Show IP addresses in public widget', 'my-trail-camera'); ?>
                        </label>
                        <p class="description">🌐 <?php esc_html_e('Shows visitor IP addresses', 'my-trail-camera'); ?></p>
                    </td>
                </tr>
                <tr>
                    <th><?php esc_html_e('Show Photos', 'my-trail-camera'); ?></th>
                    <td>
                        <label>
                            <input type="checkbox" name="show_photo" value="yes" <?php checked($settings['show_photo'], 'yes'); ?>>
                            <?php esc_html_e('Show photos in public widget', 'my-trail-camera'); ?>
                        </label>
                        <p class="description">📷 <?php esc_html_e('Shows trail camera photos', 'my-trail-camera'); ?></p>
                    </td>
                </tr>
            </table>

            <h3 class="mtcam-section-border-gray">📷 <?php esc_html_e('Camera Widget Settings', 'my-trail-camera'); ?></h3>
            <p><?php esc_html_e('Control what is displayed on the public page for stolen and active cameras.', 'my-trail-camera'); ?></p>

            <div class="mtcam-grid-2col mtcam-mt-20">

                <!-- LEFT: STOLEN CAMERAS -->
                <div class="mtcam-widget-box mtcam-widget-box-stolen">
                    <h4 >
                        ⚠️ <?php esc_html_e('Stolen Cameras', 'my-trail-camera'); ?>
                    </h4>
                    <p class="mtcam-text-sm mtcam-text-gray">
                        <?php esc_html_e('Shortcode:', 'my-trail-camera'); ?> <code class="mtcam-code-inline">[mtcam_stolen_cameras]</code>
                    </p>

                    <div class="mtcam-widget-checkbox-list">
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_stolen_show_name" value="yes" <?php checked($settings['public_stolen_show_name'] ?? 'yes', 'yes'); ?>>
                            <strong><?php esc_html_e('Name', 'my-trail-camera'); ?></strong>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_stolen_show_manufacturer" value="yes" <?php checked($settings['public_stolen_show_manufacturer'] ?? 'yes', 'yes'); ?>>
                            <strong><?php esc_html_e('Manufacturer', 'my-trail-camera'); ?></strong>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_stolen_show_imei" value="yes" <?php checked($settings['public_stolen_show_imei'] ?? 'yes', 'yes'); ?>>
                            <strong>IMEI</strong> <small class="mtcam-text-danger">(<?php esc_html_e('helps identify', 'my-trail-camera'); ?>)</small>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_stolen_show_location" value="yes" <?php checked($settings['public_stolen_show_location'] ?? 'yes', 'yes'); ?>>
                            <strong><?php esc_html_e('Location', 'my-trail-camera'); ?></strong>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_stolen_show_gps" value="yes" <?php checked($settings['public_stolen_show_gps'] ?? 'yes', 'yes'); ?>>
                            <strong><?php esc_html_e('GPS & Map', 'my-trail-camera'); ?></strong>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_stolen_show_dates" value="yes" <?php checked($settings['public_stolen_show_dates'] ?? 'yes', 'yes'); ?>>
                            <strong><?php esc_html_e('Dates', 'my-trail-camera'); ?></strong>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_stolen_show_baits" value="yes" <?php checked($settings['public_stolen_show_baits'] ?? 'yes', 'yes'); ?>>
                            <strong>MTC</strong>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_stolen_show_security" value="yes" <?php checked($settings['public_stolen_show_security'] ?? 'yes', 'yes'); ?>>
                            <strong><?php esc_html_e('Security', 'my-trail-camera'); ?></strong>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_stolen_show_gps_trackers" value="yes" <?php checked($settings['public_stolen_show_gps_trackers'] ?? 'yes', 'yes'); ?>>
                            <strong><?php esc_html_e('GPS Trackers', 'my-trail-camera'); ?></strong>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_stolen_show_photo" value="yes" <?php checked($settings['public_stolen_show_photo'] ?? 'yes', 'yes'); ?>>
                            <strong><?php esc_html_e('Photo', 'my-trail-camera'); ?></strong>
                        </label>
                    </div>
                </div>

                <!-- RIGHT: ACTIVE CAMERAS -->
                <div class="mtcam-widget-box mtcam-widget-box-active">
                    <h4 >
                        ✅ <?php esc_html_e('Active Cameras', 'my-trail-camera'); ?>
                    </h4>
                    <p class="mtcam-text-sm mtcam-text-gray">
                        <?php esc_html_e('Shortcode:', 'my-trail-camera'); ?> <code class="mtcam-code-inline">[mtcam_active_cameras]</code>
                    </p>

                    <div class="mtcam-widget-checkbox-list">
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_active_show_name" value="yes" <?php checked($settings['public_active_show_name'] ?? 'yes', 'yes'); ?>>
                            <strong><?php esc_html_e('Name', 'my-trail-camera'); ?></strong>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_active_show_manufacturer" value="yes" <?php checked($settings['public_active_show_manufacturer'] ?? 'no', 'yes'); ?>>
                            <strong><?php esc_html_e('Manufacturer', 'my-trail-camera'); ?></strong>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_active_show_imei" value="yes" <?php checked($settings['public_active_show_imei'] ?? 'no', 'yes'); ?>>
                            <strong>IMEI</strong> <small class="mtcam-text-warning">⚠️ <?php esc_html_e('dangerous', 'my-trail-camera'); ?></small>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_active_show_location" value="yes" <?php checked($settings['public_active_show_location'] ?? 'no', 'yes'); ?>>
                            <strong><?php esc_html_e('Location', 'my-trail-camera'); ?></strong> <small class="mtcam-text-warning">⚠️ <?php esc_html_e('reveals position', 'my-trail-camera'); ?></small>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_active_show_gps" value="yes" <?php checked($settings['public_active_show_gps'] ?? 'no', 'yes'); ?>>
                            <strong><?php esc_html_e('GPS & Map', 'my-trail-camera'); ?></strong> <small class="mtcam-text-danger">⚠️ <?php esc_html_e('DANGEROUS!', 'my-trail-camera'); ?></small>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_active_show_dates" value="yes" <?php checked($settings['public_active_show_dates'] ?? 'yes', 'yes'); ?>>
                            <strong><?php esc_html_e('Dates', 'my-trail-camera'); ?></strong>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_active_show_baits" value="yes" <?php checked($settings['public_active_show_baits'] ?? 'no', 'yes'); ?>>
                            <strong>MTC</strong> <small class="mtcam-text-warning">⚠️</small>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_active_show_security" value="yes" <?php checked($settings['public_active_show_security'] ?? 'no', 'yes'); ?>>
                            <strong><?php esc_html_e('Security', 'my-trail-camera'); ?></strong> <small class="mtcam-text-warning">⚠️</small>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_active_show_gps_trackers" value="yes" <?php checked($settings['public_active_show_gps_trackers'] ?? 'no', 'yes'); ?>>
                            <strong><?php esc_html_e('GPS Trackers', 'my-trail-camera'); ?></strong> <small class="mtcam-text-warning">⚠️</small>
                        </label>
                        <label class="mtcam-checkbox-label">
                            <input type="checkbox" name="public_active_show_photo" value="yes" <?php checked($settings['public_active_show_photo'] ?? 'yes', 'yes'); ?>>
                            <strong><?php esc_html_e('Photo', 'my-trail-camera'); ?></strong>
                        </label>
                    </div>
                </div>

            </div>

            <div class="mtcam-tip-box mtcam-tip-box-blue">
                <h4 class="mtcam-mt-0">📖 <?php esc_html_e('How to Use:', 'my-trail-camera'); ?></h4>

                <p><strong><?php esc_html_e('For active cameras in the field:', 'my-trail-camera'); ?></strong></p>
                <code>[mtcam_active_cameras]</code>
                <p class="mtcam-text-sm mtcam-text-gray"><?php esc_html_e('Shows only cameras currently in the field (active, not stolen)', 'my-trail-camera'); ?></p>

                <p class="mtcam-mt-15"><strong><?php esc_html_e('For stolen cameras:', 'my-trail-camera'); ?></strong></p>
                <code>[mtcam_stolen_cameras]</code>
                <p class="mtcam-text-sm mtcam-text-gray"><?php esc_html_e('Shows only cameras with a stolen date filled in', 'my-trail-camera'); ?></p>

                <p class="mtcam-mt-15"><strong><?php esc_html_e('For all cameras:', 'my-trail-camera'); ?></strong></p>
                <code>[mtcam_stolen_cameras show_all="yes"]</code>
                <p class="mtcam-text-sm mtcam-text-gray"><?php esc_html_e('Shows all cameras regardless of status', 'my-trail-camera'); ?></p>

                <p class="mtcam-mt-15"><strong><?php esc_html_e('For detections/logs:', 'my-trail-camera'); ?></strong></p>
                <code>[mtcam_public_logs limit="10"]</code>
            </div>

            <div class="mtcam-tip-box mtcam-tip-box-yellow">
                <strong>⚠️ <?php esc_html_e('Security Warning:', 'my-trail-camera'); ?></strong> <?php esc_html_e('Public widget may reveal sensitive information. Use with caution!', 'my-trail-camera'); ?>
            </div>

        </div>
