<?php
/**
 * Description 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 description generator wizard.
 */
class DescriptionSchema {

	/**
	 * Get the schema configuration for the description generator.
	 *
	 * @return array<string, mixed> Schema configuration.
	 */
	public static function get_schema(): array {
		return array(
			'generator_type' => 'description',
			'label'          => __( 'Description Generator', 'ai-product-tools' ),
			'description'    => __( 'Create rich, detailed product descriptions tailored to your brand and audience.', 'ai-product-tools' ),
			'prompt_mode'    => 'full',
			'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 audiences this description should speak to.', 'ai-product-tools' ),
					'required'    => false,
					'options_key' => 'target_audiences',
					'max_items'   => 3,
				),
				array(
					'key'         => 'age_focus',
					'type'        => 'single_select',
					'label'       => __( 'Age Focus', 'ai-product-tools' ),
					'description' => __( 'Choose an age group when the description should target a specific life stage.', 'ai-product-tools' ),
					'required'    => false,
					'options_key' => 'age_groups',
				),
				array(
					'key'         => 'content_goals',
					'type'        => 'multi_select',
					'label'       => __( 'Content Goals', 'ai-product-tools' ),
					'description' => __( 'Pick up to 3 outcomes you want this description to prioritize.', 'ai-product-tools' ),
					'required'    => false,
					'options_key' => 'content_goals',
					'max_items'   => 3,
				),
				array(
					'key'         => 'interesting_facts',
					'type'        => 'dynamic_array',
					'label'       => __( 'Interesting Facts', 'ai-product-tools' ),
					'description' => __( 'Add unique product facts worth highlighting in the copy.', 'ai-product-tools' ),
					'required'    => false,
					'min_items'   => 0,
					'max_items'   => 6,
					'placeholder' => __( 'e.g. handcrafted in Italy', 'ai-product-tools' ),
				),
				array(
					'key'         => 'content_length',
					'type'        => 'single_select',
					'label'       => __( 'Content Length', 'ai-product-tools' ),
					'description' => __( 'Choose how detailed the final description should be.', 'ai-product-tools' ),
					'required'    => true,
					'options'     => array(
						array(
							'value' => 'short',
							'label' => __( 'Short (50-100 words)', 'ai-product-tools' ),
						),
						array(
							'value' => 'medium',
							'label' => __( 'Medium (100-250 words)', 'ai-product-tools' ),
						),
						array(
							'value' => 'long',
							'label' => __( 'Long (250-500 words)', 'ai-product-tools' ),
						),
					),
				),
				array(
					'key'         => 'format_style',
					'type'        => 'single_select',
					'label'       => __( 'Format Style', 'ai-product-tools' ),
					'description' => __( 'Select the structure or format for the generated description.', 'ai-product-tools' ),
					'required'    => true,
					'options_key' => 'format_styles',
				),
				array(
					'key'         => 'writing_style',
					'type'        => 'single_select',
					'label'       => __( 'Writing Style', 'ai-product-tools' ),
					'description' => __( 'Pick a writing style if you want the wording to follow a specific approach.', 'ai-product-tools' ),
					'required'    => false,
					'options_key' => 'writing_styles',
				),
				array(
					'key'           => 'language',
					'type'          => 'text_input',
					'label'         => __( 'Language', 'ai-product-tools' ),
					'description'   => __( 'Specify the language the generated content 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 requirements, constraints, or preferences.', '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' ),
				),
			),
		);
	}
}
