<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

/**
 * Displays the dropdown to enable or disable the cart management icon display option.
 */
function doosearchas_search_cart_display_callback_content($options) {
    $value = isset($options['doosearchas_search_cart_display_db']) ? $options['doosearchas_search_cart_display_db'] : '1';
    ?>
    <select 
        name="doosearchas_search_additional_options[doosearchas_search_cart_display_db]" 
        id="doosearchas_search_cart_display_db"
    >
        <option value="1" <?php selected($value, '1'); ?>>
            <?php esc_html_e('On', 'doosearch-ajax-search-for-woo'); ?>
        </option>
        <option value="0" <?php selected($value, '0'); ?>>
            <?php esc_html_e('Off', 'doosearch-ajax-search-for-woo'); ?>
        </option>
    </select>
    <p class="description" style="margin-top: 8px;">
        <?php esc_html_e('Cart management icon whether to display or not', 'doosearch-ajax-search-for-woo'); ?>
    </p>
    <?php
}

/**
 * Shows a disabled dropdown for selecting popup UI features,
 * currently locked (Pro or future feature).
 */
function doosearchas_search_popup_ui_callback_content() {
    ?>
    <div style="display: flex; align-items: center;">
        <span class="dashicons dashicons-lock" style="color: #9b5c8f;"></span>
        <div style="position: relative; max-width: 300px;">
            <select disabled style="width: 100%; opacity: 0.6; pointer-events: none;">
                <option><?php esc_html_e('Recommended products', 'doosearch-ajax-search-for-woo'); ?></option>
            </select>
        </div>
    </div>
    <p class="description" style="margin-top: 8px;">
         <?php esc_html_e('Choose which  should appear in the popup UI: Recommended Products or Wish List.', 'doosearch-ajax-search-for-woo'); ?>
    </p>
    <?php
}

/**
 * Renders a textarea for entering a prioritized comma-separated list of product IDs
 * to display as recommended products.
 */
function doosearchas_search_recommended_products_priority_callback_content($options) {
    ?>
    <textarea 
        name="doosearchas_search_additional_options[doosearchas_search_recommended_products_priority_db]" 
        id="doosearchas_search_recommended_products_priority_db" 
        rows="5" 
        cols="50"><?php echo isset($options['doosearchas_search_recommended_products_priority_db']) ? esc_textarea($options['doosearchas_search_recommended_products_priority_db']) : ''; ?></textarea>
    <p class="description">
        <?php esc_html_e('Enter a comma-separated list of product IDs (e.g., 2597,6808) to prioritize as recommended products.', 'doosearch-ajax-search-for-woo'); ?>
    </p>
    <?php
}

/**
 * Displays a number input to set the max number of suggestions shown.
 */
function doosearchas_search_suggestion_list_limit_callback_content($options) {
    ?>
    <input 
        type="number" 
        name="doosearchas_search_additional_options[doosearchas_search_suggestion_list_limit_db]" 
        id="doosearchas_search_suggestion_list_limit_db" 
        value="<?php echo isset($options['doosearchas_search_suggestion_list_limit_db']) ? esc_attr($options['doosearchas_search_suggestion_list_limit_db']) : 3; ?>" 
        min="1" 
        max="5">
    <p class="description">
        <?php esc_html_e('Set the maximum number of suggestion to display. Choose a value between 1 and 5.', 'doosearch-ajax-search-for-woo'); ?>
    </p>
    <?php
}

/**
 * Disabled textarea for entering priority keywords to boost suggestions,
 * currently locked (Pro or future feature).
 */
function doosearchas_search_suggestions_priority_callback_content() {
    ?>
    <div style="display: flex; position: relative;">
        <span class="dashicons dashicons-lock" style="color: #9b5c8f; position: absolute;top: 3px;left: 3px;"></span>
        <div style="position: relative; max-width: 300px;">
                <textarea disabled style="width: 100%; opacity: 0.6; pointer-events: none;" 
                    rows="5" 
                    cols="50">
                </textarea>
        </div>
    </div>
        <p class="description">
            <?php esc_html_e('Enter a comma-separated list of priority keywords to boost in the suggestions list.', 'doosearch-ajax-search-for-woo'); ?>
        </p>
    <?php
}

/**
 * Disabled textarea for entering stopwords to exclude from suggestions,
 * currently locked (Pro or future feature).
 */
function doosearchas_search_suggestion_stopwords_callback_content() {
    ?>
    <div style="display: flex; position: relative;">
        <span class="dashicons dashicons-lock" style="color: #9b5c8f; position: absolute;top: 3px;left: 3px;"></span>
        <div style="position: relative; max-width: 300px;">
                <textarea disabled style="width: 100%; opacity: 0.6; pointer-events: none;" 
                    rows="5" 
                    cols="50">
                </textarea>
        </div>
    </div>
        <p class="description">
            <?php esc_html_e('Enter a comma-separated list of stopwords you want to exclude from the seggestions list.', 'doosearch-ajax-search-for-woo'); ?>
        </p>
    <?php
}



