<?php
/**
 * Metabox definition for the 'portfolio' post type.
 *
 * @package Sifency
 */

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

// This file returns an array of metabox definitions.
return [
	'projects_options' => [
		'title'     => esc_html__( 'Project Details', 'sifency-addons' ),
		'post_type' => 'portfolio',
		'context'   => 'normal',
		'priority'  => 'high',
		'class'     => 'sifency-metabox',
		'fields'    => [
			[
				'id'      => 'meta_portfolio_single_type',
				'type'    => 'button_set',
				'title'   => esc_html__( 'Single Page Layout', 'sifency-addons' ),
				'desc'    => esc_html__( 'Choose between the default theme layout or a custom Elementor template.', 'sifency-addons' ),
				'options' => [
					'default' => esc_html__( 'Theme Default', 'sifency-addons' ),
					'custom'  => esc_html__( 'Custom Template', 'sifency-addons' ),
				],
				'default' => 'default',
			],
			[
				'id'         => 'meta_portfolio_single_style',
				'type'       => 'select',
				'title'      => esc_html__( 'Select Custom Template', 'sifency-addons' ),
				'options'    => 'Sifency_Plugin_Helper::get_portfolio_single_types',
				'dependency' => [ 'meta_portfolio_single_type', '==', 'custom' ],
			],
			[
				'id'      => 'portfolio_client_name',
				'type'    => 'text',
				'title'   => esc_html__( 'Client Name', 'sifency-addons' ),
				'default' => esc_html__( 'John Smith', 'sifency-addons' ),
			],
			[
				'id'    => 'portfolio_type_of_work',
				'type'  => 'text',
				'title' => esc_html__( 'Project Type', 'sifency-addons' ),
				'desc'  => esc_html__( 'e.g. Web Design, Branding', 'sifency-addons' ),
			],
			[
				'id'       => 'portfolio_short_description',
				'type'     => 'wp_editor',
				'title'    => esc_html__( 'Description', 'sifency-addons' ),
				'desc'     => esc_html__( 'Brief project overview.', 'sifency-addons' ),
				'settings' => [
					'textarea_rows' => 5,
					'media_buttons' => false,
				],
			],
			[
				'id'    => 'portfolio_industry_type',
				'type'  => 'text',
				'title' => esc_html__( 'Industry', 'sifency-addons' ),
				'desc'  => esc_html__( 'Client industry sector.', 'sifency-addons' ),
			],
			[
				'id'    => 'portfolio_duration',
				'type'  => 'text',
				'title' => esc_html__( 'Timeline', 'sifency-addons' ),
				'desc'  => esc_html__( 'Project duration (e.g. 3 months).', 'sifency-addons' ),
			],
			[
				'id'    => 'project_size',
				'type'  => 'text',
				'title' => esc_html__( 'Project Size', 'sifency-addons' ),
				'desc'  => esc_html__( 'e.g. Small, Medium, Large Enterprise', 'sifency-addons' ),
			],
			[
				'id'    => 'project_location',
				'type'  => 'text',
				'title' => esc_html__( 'Project Location', 'sifency-addons' ),
				'desc'  => esc_html__( 'Enter your project location.', 'sifency-addons' ),
			],
			[
				'id'    => 'portfolio_website',
				'type'  => 'url',
				'title' => esc_html__( 'Live URL', 'sifency-addons' ),
				'desc'  => esc_html__( 'Link to the live project.', 'sifency-addons' ),
			],
			[
				'id'      => 'project_category_show',
				'type'    => 'button_set',
				'title'   => esc_html__( 'Display Project Category', 'sifency-addons' ),
				'desc'    => esc_html__( 'Show or hide the category info for this project.', 'sifency-addons' ),
				'options' => [
					'enabled'  => esc_html__( 'Show', 'sifency-addons' ),
					'disabled' => esc_html__( 'Hide', 'sifency-addons' ),
				],
				'default' => 'enabled',
			],
			[
				'id'    => 'portfolio_testimonial',
				'type'  => 'textarea', // Using our new 'textarea' field type.
				'title' => esc_html__( 'Client Testimonial', 'sifency-addons' ),
				'desc'  => esc_html__( 'Optional quote or feedback from the client.', 'sifency-addons' ),
			],
			[
				'id'      => 'portfolio_technologies_list',
				'type'    => 'repeater',
				'title'   => esc_html__( 'Technologies Used', 'sifency-addons' ),
				'desc'    => esc_html__( 'List the technologies or tools used in this project.', 'sifency-addons' ),
				'fields'  => [
					[
						'id'    => 'tech_name',
						'type'  => 'text',
						'title' => esc_html__( 'Technology Name', 'sifency-addons' ),
					],
				],
			],
			[
				'id'    => 'portfolio_completion_date',
				'type'  => 'date',
				'title' => esc_html__( 'Completion Date', 'sifency-addons' ),
				'desc'  => esc_html__( 'When was this project delivered?', 'sifency-addons' ),
			],
			[
				'id'      => 'portfolio_rating',
				'type'    => 'slider', // Using our new 'slider' field type.
				'title'   => esc_html__( 'Client Satisfaction Rating', 'sifency-addons' ),
				'desc'    => esc_html__( 'Rate out of 5 stars.', 'sifency-addons' ),
				'min'     => 0,
				'max'     => 5,
				'step'    => 0.5,
				'default' => 4.5,
			],
		],
	],
];