<?php
/**
 * Ready-made Basic Forms templates.
 *
 * @package BasicForms
 */

namespace BasicForms;

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

class FormTemplates {

	/**
	 * @return array<string, array{label: string, icon: string, description: string}>
	 */
	public static function getCategories(): array {
		$categories = [
			'contact' => [
				'label'       => __( 'Contact', 'wp-powersuite' ),
				'icon'        => 'dashicons-email',
				'description' => __( 'General contact and inquiry forms.', 'wp-powersuite' ),
			],
			'lead'    => [
				'label'       => __( 'Lead Generation', 'wp-powersuite' ),
				'icon'        => 'dashicons-megaphone',
				'description' => __( 'Capture leads, quotes, and sign-ups.', 'wp-powersuite' ),
			],
			'support' => [
				'label'       => __( 'Support', 'wp-powersuite' ),
				'icon'        => 'dashicons-sos',
				'description' => __( 'Help desk, feedback, and bug reports.', 'wp-powersuite' ),
			],
			'events'  => [
				'label'       => __( 'Events', 'wp-powersuite' ),
				'icon'        => 'dashicons-calendar-alt',
				'description' => __( 'RSVPs, registrations, and volunteers.', 'wp-powersuite' ),
			],
			'hr'      => [
				'label'       => __( 'HR & Careers', 'wp-powersuite' ),
				'icon'        => 'dashicons-id',
				'description' => __( 'Applications and internal feedback.', 'wp-powersuite' ),
			],
			'business' => [
				'label'       => __( 'Business', 'wp-powersuite' ),
				'icon'        => 'dashicons-store',
				'description' => __( 'Product and wholesale inquiries.', 'wp-powersuite' ),
			],
		];

		/**
		 * @param array<string, array{label: string, icon: string, description: string}> $categories
		 */
		return apply_filters( 'wpps_basic_forms_template_categories', $categories );
	}

	/**
	 * @return list<array<string, mixed>>
	 */
	public static function getAll(): array {
		/**
		 * @param list<array<string, mixed>> $templates
		 */
		return apply_filters( 'wpps_basic_forms_templates', self::builtInTemplates() );
	}

	/**
	 * @return array<string, mixed>|null
	 */
	public static function getById( string $id ): ?array {
		$id = sanitize_key( $id );
		foreach ( self::getAll() as $template ) {
			if ( isset( $template['id'] ) && sanitize_key( (string) $template['id'] ) === $id ) {
				return $template;
			}
		}
		return null;
	}

	/**
	 * @return array<string, list<array<string, mixed>>>
	 */
	public static function getGroupedByCategory(): array {
		$grouped  = [];
		$fallback = 'contact';
		foreach ( self::getCategories() as $slug => $_meta ) {
			$grouped[ $slug ] = [];
		}
		foreach ( self::getAll() as $template ) {
			$cat = isset( $template['category'] ) ? sanitize_key( (string) $template['category'] ) : $fallback;
			if ( ! isset( $grouped[ $cat ] ) ) {
				$grouped[ $cat ] = [];
			}
			$grouped[ $cat ][] = $template;
		}
		return $grouped;
	}

	/**
	 * @param array<string, mixed> $overrides
	 * @return array<string, mixed>
	 */
	private static function field( int $id, string $type, string $label, array $overrides = [] ): array {
		$slug = sanitize_title( $label );
		if ( $slug === '' ) {
			$slug = 'field';
		}

		return array_merge(
			[
				'id'          => $id,
				'type'        => $type,
				'label'       => $label,
				'placeholder' => '',
				'description' => '',
				'options'     => '',
				'required'    => false,
				'field_id'    => $slug . '_' . $id,
				'help'        => '',
				'width'       => '',
			],
			$overrides
		);
	}

	/**
	 * @param list<array<string, mixed>> $fields
	 * @return list<array<string, mixed>>
	 */
	private static function settings( string $subject, string $success, string $submit = '' ): array {
		$out = [
			'subject'          => $subject,
			'success_message'  => $success,
			'captcha_provider' => 'simple',
		];
		if ( $submit !== '' ) {
			$out['submit_button_text'] = $submit;
		}
		return $out;
	}

	/**
	 * @return list<array<string, mixed>>
	 */
	private static function builtInTemplates(): array {
		$site = get_bloginfo( 'name' );

		return [
			[
				'id'          => 'contact-simple',
				'name'        => __( 'Simple Contact', 'wp-powersuite' ),
				'description' => __( 'Name, email, and message — ideal for a basic contact page.', 'wp-powersuite' ),
				'category'    => 'contact',
				'icon'        => 'dashicons-email-alt',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wp-powersuite' ), [ 'required' => true, 'placeholder' => __( 'Your name', 'wp-powersuite' ), 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wp-powersuite' ), [ 'required' => true, 'placeholder' => __( 'you@example.com', 'wp-powersuite' ), 'width' => 'half' ] ),
					self::field( 2, 'textarea', __( 'Message', 'wp-powersuite' ), [ 'required' => true, 'rows' => '5', 'placeholder' => __( 'How can we help?', 'wp-powersuite' ) ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'New contact message from %s', 'wp-powersuite' ), $site ),
					__( 'Thank you! We received your message and will reply soon.', 'wp-powersuite' ),
					__( 'Send Message', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'contact-detailed',
				'name'        => __( 'Detailed Contact', 'wp-powersuite' ),
				'description' => __( 'Contact form with phone and a subject dropdown.', 'wp-powersuite' ),
				'category'    => 'contact',
				'icon'        => 'dashicons-forms',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'phone', __( 'Phone', 'wp-powersuite' ), [ 'width' => 'half' ] ),
					self::field( 3, 'select', __( 'Subject', 'wp-powersuite' ), [
						'required'    => true,
						'width'       => 'half',
						'options'     => __( "General inquiry\nSales\nSupport\nPartnership", 'wp-powersuite' ),
						'empty_label' => __( 'Choose a subject', 'wp-powersuite' ),
					] ),
					self::field( 4, 'textarea', __( 'Message', 'wp-powersuite' ), [ 'required' => true, 'rows' => '5' ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Contact form submission from %s', 'wp-powersuite' ), $site ),
					__( 'Thanks for reaching out. We will get back to you shortly.', 'wp-powersuite' ),
					__( 'Submit', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'contact-company',
				'name'        => __( 'Business Contact', 'wp-powersuite' ),
				'description' => __( 'Collect company details alongside contact info.', 'wp-powersuite' ),
				'category'    => 'contact',
				'icon'        => 'dashicons-building',
				'fields'      => [
					self::field( 0, 'text', __( 'Full Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'text', __( 'Company', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'email', __( 'Work Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 3, 'phone', __( 'Phone', 'wp-powersuite' ), [ 'width' => 'half' ] ),
					self::field( 4, 'textarea', __( 'How can we help?', 'wp-powersuite' ), [ 'required' => true, 'rows' => '4' ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Business inquiry from %s', 'wp-powersuite' ), $site ),
					__( 'Thank you! A team member will contact you soon.', 'wp-powersuite' ),
					__( 'Send Inquiry', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'contact-appointment',
				'name'        => __( 'Appointment Request', 'wp-powersuite' ),
				'description' => __( 'Let visitors request a call or meeting time.', 'wp-powersuite' ),
				'category'    => 'contact',
				'icon'        => 'dashicons-clock',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'phone', __( 'Phone', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 3, 'date', __( 'Preferred Date', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 4, 'time', __( 'Preferred Time', 'wp-powersuite' ), [ 'width' => 'half' ] ),
					self::field( 5, 'textarea', __( 'Notes', 'wp-powersuite' ), [ 'rows' => '3', 'placeholder' => __( 'Anything we should know?', 'wp-powersuite' ) ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Appointment request from %s', 'wp-powersuite' ), $site ),
					__( 'Thanks! We will confirm your appointment by email.', 'wp-powersuite' ),
					__( 'Request Appointment', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'newsletter-signup',
				'name'        => __( 'Newsletter Signup', 'wp-powersuite' ),
				'description' => __( 'Minimal email list signup form.', 'wp-powersuite' ),
				'category'    => 'lead',
				'icon'        => 'dashicons-email',
				'fields'      => [
					self::field( 0, 'html', '', [
						'content' => '<p>' . esc_html__( 'Subscribe for updates, tips, and news.', 'wp-powersuite' ) . '</p>',
					] ),
					self::field( 1, 'text', __( 'First Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'email', __( 'Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Newsletter signup on %s', 'wp-powersuite' ), $site ),
					__( 'You are subscribed. Welcome aboard!', 'wp-powersuite' ),
					__( 'Subscribe', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'quote-request',
				'name'        => __( 'Quote Request', 'wp-powersuite' ),
				'description' => __( 'Capture project details for a custom quote.', 'wp-powersuite' ),
				'category'    => 'lead',
				'icon'        => 'dashicons-calculator',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'text', __( 'Company', 'wp-powersuite' ), [ 'width' => 'half' ] ),
					self::field( 3, 'select', __( 'Service Needed', 'wp-powersuite' ), [
						'required'    => true,
						'width'       => 'half',
						'options'     => __( "Web design\nDevelopment\nMarketing\nConsulting\nOther", 'wp-powersuite' ),
						'empty_label' => __( 'Select a service', 'wp-powersuite' ),
					] ),
					self::field( 4, 'select', __( 'Budget Range', 'wp-powersuite' ), [
						'options'     => __( "Under $1,000\n$1,000 – $5,000\n$5,000 – $10,000\n$10,000+", 'wp-powersuite' ),
						'empty_label' => __( 'Select budget', 'wp-powersuite' ),
					] ),
					self::field( 5, 'textarea', __( 'Project Details', 'wp-powersuite' ), [ 'required' => true, 'rows' => '5' ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Quote request from %s', 'wp-powersuite' ), $site ),
					__( 'Thank you! We will send your quote within 1–2 business days.', 'wp-powersuite' ),
					__( 'Request Quote', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'demo-request',
				'name'        => __( 'Demo Request', 'wp-powersuite' ),
				'description' => __( 'Schedule a product demo with your sales team.', 'wp-powersuite' ),
				'category'    => 'lead',
				'icon'        => 'dashicons-desktop',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Work Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'text', __( 'Company', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 3, 'phone', __( 'Phone', 'wp-powersuite' ), [ 'width' => 'half' ] ),
					self::field( 4, 'date', __( 'Preferred Demo Date', 'wp-powersuite' ), [ 'width' => 'half' ] ),
					self::field( 5, 'textarea', __( 'What would you like to see?', 'wp-powersuite' ), [ 'rows' => '4' ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Demo request from %s', 'wp-powersuite' ), $site ),
					__( 'Thanks! Our team will confirm your demo shortly.', 'wp-powersuite' ),
					__( 'Book Demo', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'callback-request',
				'name'        => __( 'Callback Request', 'wp-powersuite' ),
				'description' => __( 'Quick form for phone callback requests.', 'wp-powersuite' ),
				'category'    => 'lead',
				'icon'        => 'dashicons-phone',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'phone', __( 'Phone Number', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'select', __( 'Best Time to Call', 'wp-powersuite' ), [
						'required'    => true,
						'options'     => __( "Morning\nAfternoon\nEvening", 'wp-powersuite' ),
						'empty_label' => __( 'Select a time', 'wp-powersuite' ),
					] ),
					self::field( 3, 'text', __( 'Topic', 'wp-powersuite' ), [ 'placeholder' => __( 'Brief reason for your call', 'wp-powersuite' ) ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Callback request from %s', 'wp-powersuite' ), $site ),
					__( 'Got it! We will call you at the time you selected.', 'wp-powersuite' ),
					__( 'Request Callback', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'support-ticket',
				'name'        => __( 'Support Ticket', 'wp-powersuite' ),
				'description' => __( 'Structured help desk submission form.', 'wp-powersuite' ),
				'category'    => 'support',
				'icon'        => 'dashicons-tickets-alt',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'select', __( 'Priority', 'wp-powersuite' ), [
						'required'    => true,
						'width'       => 'half',
						'options'     => __( "Low\nNormal\nHigh\nUrgent", 'wp-powersuite' ),
						'empty_label' => __( 'Select priority', 'wp-powersuite' ),
					] ),
					self::field( 3, 'text', __( 'Subject', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 4, 'textarea', __( 'Describe the issue', 'wp-powersuite' ), [ 'required' => true, 'rows' => '6' ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Support ticket from %s', 'wp-powersuite' ), $site ),
					__( 'Your support ticket was submitted. We will respond by email.', 'wp-powersuite' ),
					__( 'Submit Ticket', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'bug-report',
				'name'        => __( 'Bug Report', 'wp-powersuite' ),
				'description' => __( 'Collect reproduction steps and optional screenshots.', 'wp-powersuite' ),
				'category'    => 'support',
				'icon'        => 'dashicons-warning',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'url', __( 'Page URL', 'wp-powersuite' ), [ 'required' => true, 'placeholder' => 'https://' ] ),
					self::field( 3, 'text', __( 'Browser / Device', 'wp-powersuite' ), [ 'placeholder' => __( 'e.g. Chrome on Windows', 'wp-powersuite' ) ] ),
					self::field( 4, 'textarea', __( 'Steps to Reproduce', 'wp-powersuite' ), [ 'required' => true, 'rows' => '5' ] ),
					self::field( 5, 'file', __( 'Screenshot', 'wp-powersuite' ), [ 'file_types' => 'image/*', 'max_size' => '5' ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Bug report from %s', 'wp-powersuite' ), $site ),
					__( 'Thank you for the report. Our team will investigate.', 'wp-powersuite' ),
					__( 'Report Bug', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'feature-request',
				'name'        => __( 'Feature Request', 'wp-powersuite' ),
				'description' => __( 'Let users suggest new product features.', 'wp-powersuite' ),
				'category'    => 'support',
				'icon'        => 'dashicons-lightbulb',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'text', __( 'Feature Title', 'wp-powersuite' ), [ 'required' => true ] ),
					self::field( 3, 'select', __( 'Importance', 'wp-powersuite' ), [
						'options'     => __( "Nice to have\nImportant\nCritical", 'wp-powersuite' ),
						'empty_label' => __( 'How important is this?', 'wp-powersuite' ),
					] ),
					self::field( 4, 'textarea', __( 'Feature Description', 'wp-powersuite' ), [ 'required' => true, 'rows' => '5' ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Feature request from %s', 'wp-powersuite' ), $site ),
					__( 'Thanks for your suggestion! We review every request.', 'wp-powersuite' ),
					__( 'Submit Idea', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'customer-feedback',
				'name'        => __( 'Customer Feedback', 'wp-powersuite' ),
				'description' => __( 'Short satisfaction survey with rating.', 'wp-powersuite' ),
				'category'    => 'support',
				'icon'        => 'dashicons-star-filled',
				'fields'      => [
					self::field( 0, 'radio', __( 'Overall Rating', 'wp-powersuite' ), [
						'required' => true,
						'options'  => __( "Excellent\nGood\nAverage\nPoor", 'wp-powersuite' ),
					] ),
					self::field( 1, 'text', __( 'Name', 'wp-powersuite' ), [ 'width' => 'half' ] ),
					self::field( 2, 'email', __( 'Email', 'wp-powersuite' ), [ 'width' => 'half' ] ),
					self::field( 3, 'textarea', __( 'Your Feedback', 'wp-powersuite' ), [ 'required' => true, 'rows' => '4' ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Customer feedback from %s', 'wp-powersuite' ), $site ),
					__( 'Thank you for your feedback!', 'wp-powersuite' ),
					__( 'Send Feedback', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'event-rsvp',
				'name'        => __( 'Event RSVP', 'wp-powersuite' ),
				'description' => __( 'Confirm attendance and guest count.', 'wp-powersuite' ),
				'category'    => 'events',
				'icon'        => 'dashicons-calendar',
				'fields'      => [
					self::field( 0, 'text', __( 'Full Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'number', __( 'Number of Guests', 'wp-powersuite' ), [ 'required' => true, 'min' => '1', 'max' => '10', 'default_value' => '1', 'width' => 'half' ] ),
					self::field( 3, 'select', __( 'Dietary Requirements', 'wp-powersuite' ), [
						'width'       => 'half',
						'options'     => __( "None\nVegetarian\nVegan\nGluten-free\nOther", 'wp-powersuite' ),
						'empty_label' => __( 'Select if applicable', 'wp-powersuite' ),
					] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Event RSVP from %s', 'wp-powersuite' ), $site ),
					__( 'Your RSVP is confirmed. See you at the event!', 'wp-powersuite' ),
					__( 'RSVP', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'event-registration',
				'name'        => __( 'Event Registration', 'wp-powersuite' ),
				'description' => __( 'Register attendees with ticket type selection.', 'wp-powersuite' ),
				'category'    => 'events',
				'icon'        => 'dashicons-tickets',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'phone', __( 'Phone', 'wp-powersuite' ), [ 'width' => 'half' ] ),
					self::field( 3, 'select', __( 'Ticket Type', 'wp-powersuite' ), [
						'required'    => true,
						'width'       => 'half',
						'options'     => __( "General Admission\nVIP\nStudent", 'wp-powersuite' ),
						'empty_label' => __( 'Choose ticket', 'wp-powersuite' ),
					] ),
					self::field( 4, 'text', __( 'Company / Organization', 'wp-powersuite' ) ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Event registration from %s', 'wp-powersuite' ), $site ),
					__( 'Registration complete! Check your email for details.', 'wp-powersuite' ),
					__( 'Register', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'workshop-signup',
				'name'        => __( 'Workshop Signup', 'wp-powersuite' ),
				'description' => __( 'Sign up for a workshop with experience level.', 'wp-powersuite' ),
				'category'    => 'events',
				'icon'        => 'dashicons-welcome-learn-more',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'select', __( 'Workshop', 'wp-powersuite' ), [
						'required'    => true,
						'options'     => __( "Intro Session\nIntermediate Session\nAdvanced Session", 'wp-powersuite' ),
						'empty_label' => __( 'Choose workshop', 'wp-powersuite' ),
					] ),
					self::field( 3, 'select', __( 'Experience Level', 'wp-powersuite' ), [
						'required'    => true,
						'options'     => __( "Beginner\nIntermediate\nAdvanced", 'wp-powersuite' ),
						'empty_label' => __( 'Your level', 'wp-powersuite' ),
					] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Workshop signup from %s', 'wp-powersuite' ), $site ),
					__( 'You are signed up! We will send workshop details by email.', 'wp-powersuite' ),
					__( 'Sign Up', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'volunteer-signup',
				'name'        => __( 'Volunteer Signup', 'wp-powersuite' ),
				'description' => __( 'Recruit volunteers with availability and skills.', 'wp-powersuite' ),
				'category'    => 'events',
				'icon'        => 'dashicons-groups',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'phone', __( 'Phone', 'wp-powersuite' ), [ 'width' => 'half' ] ),
					self::field( 3, 'select', __( 'Availability', 'wp-powersuite' ), [
						'required'    => true,
						'width'       => 'half',
						'options'     => __( "Weekdays\nWeekends\nBoth\nFlexible", 'wp-powersuite' ),
						'empty_label' => __( 'When can you help?', 'wp-powersuite' ),
					] ),
					self::field( 4, 'textarea', __( 'Skills & Interests', 'wp-powersuite' ), [ 'rows' => '4', 'placeholder' => __( 'Tell us how you would like to contribute', 'wp-powersuite' ) ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Volunteer signup from %s', 'wp-powersuite' ), $site ),
					__( 'Thank you for volunteering! We will be in touch.', 'wp-powersuite' ),
					__( 'Volunteer', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'job-application',
				'name'        => __( 'Job Application', 'wp-powersuite' ),
				'description' => __( 'Accept applications with resume upload.', 'wp-powersuite' ),
				'category'    => 'hr',
				'icon'        => 'dashicons-portfolio',
				'fields'      => [
					self::field( 0, 'text', __( 'Full Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'phone', __( 'Phone', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 3, 'text', __( 'Position Applying For', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 4, 'file', __( 'Resume', 'wp-powersuite' ), [ 'required' => true, 'file_types' => '.pdf,.doc,.docx', 'max_size' => '5' ] ),
					self::field( 5, 'textarea', __( 'Cover Letter', 'wp-powersuite' ), [ 'rows' => '5' ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Job application from %s', 'wp-powersuite' ), $site ),
					__( 'Your application was received. We will review it and contact you if there is a fit.', 'wp-powersuite' ),
					__( 'Apply', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'employee-feedback',
				'name'        => __( 'Employee Feedback', 'wp-powersuite' ),
				'description' => __( 'Internal feedback form with department selection.', 'wp-powersuite' ),
				'category'    => 'hr',
				'icon'        => 'dashicons-businessman',
				'fields'      => [
					self::field( 0, 'select', __( 'Department', 'wp-powersuite' ), [
						'required'    => true,
						'options'     => __( "Sales\nMarketing\nSupport\nOperations\nOther", 'wp-powersuite' ),
						'empty_label' => __( 'Select department', 'wp-powersuite' ),
					] ),
					self::field( 1, 'text', __( 'Name (optional)', 'wp-powersuite' ), [ 'width' => 'half' ] ),
					self::field( 2, 'email', __( 'Email (optional)', 'wp-powersuite' ), [ 'width' => 'half' ] ),
					self::field( 3, 'textarea', __( 'Your Feedback', 'wp-powersuite' ), [ 'required' => true, 'rows' => '5' ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Employee feedback on %s', 'wp-powersuite' ), $site ),
					__( 'Thank you for your honest feedback.', 'wp-powersuite' ),
					__( 'Submit Feedback', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'product-inquiry',
				'name'        => __( 'Product Inquiry', 'wp-powersuite' ),
				'description' => __( 'Let customers ask about products and quantities.', 'wp-powersuite' ),
				'category'    => 'business',
				'icon'        => 'dashicons-cart',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'select', __( 'Product', 'wp-powersuite' ), [
						'required'    => true,
						'options'     => __( "Product A\nProduct B\nProduct C\nCustom order", 'wp-powersuite' ),
						'empty_label' => __( 'Select product', 'wp-powersuite' ),
					] ),
					self::field( 3, 'number', __( 'Quantity', 'wp-powersuite' ), [ 'min' => '1', 'default_value' => '1', 'width' => 'half' ] ),
					self::field( 4, 'textarea', __( 'Message', 'wp-powersuite' ), [ 'rows' => '4' ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Product inquiry from %s', 'wp-powersuite' ), $site ),
					__( 'Thanks! We will reply with product details and pricing.', 'wp-powersuite' ),
					__( 'Send Inquiry', 'wp-powersuite' )
				),
			],
			[
				'id'          => 'wholesale-inquiry',
				'name'        => __( 'Wholesale Inquiry', 'wp-powersuite' ),
				'description' => __( 'B2B wholesale and partnership inquiries.', 'wp-powersuite' ),
				'category'    => 'business',
				'icon'        => 'dashicons-networking',
				'fields'      => [
					self::field( 0, 'text', __( 'Business Name', 'wp-powersuite' ), [ 'required' => true ] ),
					self::field( 1, 'text', __( 'Contact Name', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'email', __( 'Business Email', 'wp-powersuite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 3, 'phone', __( 'Phone', 'wp-powersuite' ), [ 'width' => 'half' ] ),
					self::field( 4, 'url', __( 'Website', 'wp-powersuite' ), [ 'width' => 'half', 'placeholder' => 'https://' ] ),
					self::field( 5, 'textarea', __( 'Tell us about your business', 'wp-powersuite' ), [ 'required' => true, 'rows' => '5' ] ),
				],
				'settings'    => self::settings(
					sprintf( __( 'Wholesale inquiry from %s', 'wp-powersuite' ), $site ),
					__( 'Thank you! Our wholesale team will contact you soon.', 'wp-powersuite' ),
					__( 'Submit Inquiry', 'wp-powersuite' )
				),
			],
		];
	}
}
