<?php
/**
 * FAQ schema definition.
 *
 * @package AIPT\Api\PromptBuilder\Schemas
 * @since   2.6.0
 */

namespace AIPT\Api\PromptBuilder\Schemas;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Provides the step schema for the FAQ generator wizard.
 */
class FAQSchema {

	/**
	 * Get the schema configuration for the FAQ generator.
	 *
	 * @return array<string, mixed> Schema configuration.
	 */
	public static function get_schema(): array {
		return array(
			'generator_type' => 'faq',
			'label'          => __( 'FAQ Generator', 'ai-product-tools' ),
			'description'    => __( 'Create FAQ-focused prompt instructions for product questions and answers.', 'ai-product-tools' ),
			'prompt_mode'    => 'additional',
			'steps'          => array(
				array(
					'key'         => 'writing_tone',
					'type'        => 'multi_select',
					'label'       => __( 'Writing Tone', 'ai-product-tools' ),
					'description' => __( 'Choose up to 3 tones that match your brand voice.', 'ai-product-tools' ),
					'required'    => true,
					'options_key' => 'tones',
					'min_items'   => 1,
					'max_items'   => 3,
				),
			array(
				'key'         => 'target_audience',
				'type'        => 'multi_select',
					'label'       => __( 'Target Audience', 'ai-product-tools' ),
					'description' => __( 'Select up to 3 audience segments for FAQ tone and topics.', 'ai-product-tools' ),
					'required'    => false,
					'options_key' => 'target_audiences',
					'max_items'   => 3,
				),
				array(
					'key'           => 'faq_count',
					'type'          => 'single_select',
					'label'         => __( 'FAQ Count', 'ai-product-tools' ),
					'description'   => __( 'Choose how many FAQs to generate.', 'ai-product-tools' ),
					'required'      => true,
					'default_value' => '5',
					'options'       => array(
						array(
							'value' => '3',
							'label' => __( '3 FAQs', 'ai-product-tools' ),
						),
						array(
							'value' => '5',
							'label' => __( '5 FAQs', 'ai-product-tools' ),
						),
						array(
							'value' => '7',
							'label' => __( '7 FAQs', 'ai-product-tools' ),
						),
						array(
							'value' => '10',
							'label' => __( '10 FAQs', 'ai-product-tools' ),
						),
					),
				),
				array(
					'key'           => 'faq_format',
					'type'          => 'single_select',
					'label'         => __( 'FAQ Format', 'ai-product-tools' ),
					'description'   => __( 'Choose the format the FAQs should follow.', 'ai-product-tools' ),
					'required'      => true,
					'default_value' => 'html',
					'options'       => array(
						array(
							'value' => 'text',
							'label' => __( 'Plain Text', 'ai-product-tools' ),
						),
						array(
							'value' => 'html',
							'label' => __( 'HTML', 'ai-product-tools' ),
						),
						array(
							'value' => 'definition_list',
							'label' => __( 'Definition List', 'ai-product-tools' ),
						),
					),
				),
				array(
					'key'           => 'language',
					'type'          => 'text_input',
					'label'         => __( 'Language', 'ai-product-tools' ),
					'description'   => __( 'Specify the language the generated FAQs should use.', 'ai-product-tools' ),
					'required'      => true,
					'default_value' => 'English',
					'placeholder'   => __( 'e.g. English, Turkish', 'ai-product-tools' ),
				),
				array(
					'key'         => 'custom_prompt_variables',
					'type'        => 'variables_textarea',
					'label'       => __( 'Custom Prompt with Variables', 'ai-product-tools' ),
					'description' => __( 'Write custom instructions using product variables. Variables like {title}, {PRICE}, {CATEGORIES} will be replaced with actual product data during generation.', 'ai-product-tools' ),
					'required'    => false,
					'placeholder' => __( 'e.g. Focus on the {CATEGORIES} category. Highlight that the price is {PRICE} and mention the {ATTRIBUTES}.', 'ai-product-tools' ),
				),
				array(
					'key'         => 'special_instructions',
					'type'        => 'textarea',
					'label'       => __( 'Special Instructions', 'ai-product-tools' ),
					'description' => __( 'Add any extra instructions for FAQ coverage or format.', 'ai-product-tools' ),
					'required'    => false,
					'placeholder' => __( 'Any specific requirements...', 'ai-product-tools' ),
				),
				array(
					'key'         => 'review',
					'type'        => 'review',
					'label'       => __( 'Review', 'ai-product-tools' ),
					'description' => __( 'Review your selections before generating the prompt.', 'ai-product-tools' ),
				),
			),
		);
	}
}
