<?php
namespace Elementor;

/**
 * Elementor Widget
 * @package Feron
 * @since 1.0.0
 */ 
 
class Banner extends Widget_Base {

	/**
	 * Get widget name.
	 * Retrieve button widget name.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return string Widget name.
	 */
	public function get_name() {
		return 'feron-banner-widget';
	}

	/**
	 * Get widget title.
	 * Retrieve button widget title.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return string Widget title.
	 */
	public function get_title() {
		return esc_html__( 'Banner', 'feron-core' );
	}

	/**
	 * Get widget icon.
	 * Retrieve button widget icon.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return string Widget icon.
	 */
	public function get_icon() {
		return 'eicon-flash';
	}

	/**
	 * Get widget categories.
	 * Retrieve the list of categories the button widget belongs to.
	 * Used to determine where to display the widget in the editor.
	 *
	 * @since  2.0.0
	 * @access public
	 * @return array Widget categories.
	 */
	public function get_categories()
    {
        return ['feron_widgets'];
    }
	
	/**
	 * Register button widget controls.
	 * Adds different input fields to allow the user to change and customize the widget settings.
	 *
	 * @since  1.0.0
	 * @access protected
	 */
	protected function register_controls() {


		// Tab Start - 1

		$this->start_controls_section(
			'banner_images',
			[
				'label' => esc_html__( 'Banner Images', 'feron-core' ),
			]
		);	

		$this->add_control(
			'image',
				[
					'label' => __( 'Image', 'feron-core' ),
					'type' => Controls_Manager::MEDIA,
					'default' => ['url' => Utils::get_placeholder_image_src(),],
				]
		);	

		$this->add_control(
			'image2',
				[
					'label' => __( 'Image 2', 'feron-core' ),
					'type' => Controls_Manager::MEDIA,
					'default' => ['url' => Utils::get_placeholder_image_src(),],
				]
		);	

		$this->add_control(
			'image3',
				[
					'label' => __( 'Image 3', 'feron-core' ),
					'type' => Controls_Manager::MEDIA,
					'default' => ['url' => Utils::get_placeholder_image_src(),],
				]
		);		

		$this->add_control(
			'image4',
				[
					'label' => __( 'Image 4', 'feron-core' ),
					'type' => Controls_Manager::MEDIA,
					'default' => ['url' => Utils::get_placeholder_image_src(),],
				]
		);			


		$this->end_controls_section();

		// Tab Start - 2

		$this->start_controls_section(
			'banner_content',
			[
				'label' => esc_html__( 'Banner Content', 'feron-core' ),
			]
		);	
		
		$this->add_control(
			'title',
			[
				'label'       => __( 'Title', 'feron-core' ),
				'type'        => Controls_Manager::TEXTAREA,
				'dynamic'     => [
					'active' => true,
				],
				'placeholder' => __( 'Enter your title', 'feron-core' ),
			]
		);

		$this->add_control(
			'hidden_text',
			[
				'label'       => __( 'Hidden Text', 'feron-core' ),
				'type'        => Controls_Manager::TEXTAREA,
				'dynamic'     => [
					'active' => true,
				],
				'placeholder' => __( 'Enter your title', 'feron-core' ),
			]
		);

		$this->add_control(
			'subtitle',
			[
				'label'       => __( 'Sub Title', 'feron-core' ),
				'type'        => Controls_Manager::TEXTAREA,
				'dynamic'     => [
					'active' => true,
				],
				'placeholder' => __( 'Enter your sub-title', 'feron-core' ),
			]
		);	

		$this->add_control(
			'video_link',
			[
			  'label' => __( 'Video Url', 'feron-core' ),
			  'type' => Controls_Manager::URL,
			  'placeholder' => __( 'https://your-link.com', 'feron-core' ),
			  'show_external' => true,
			  'default' => [
				'url' => 'https://www.youtube.com/watch?v=Cn4G2lZ_g2I',
				'is_external' => true,
				'nofollow' => true,
			  ],
			
		   ]
		);

		$this->add_control(
			'button',
			[
				'label'       => __( 'Button', 'feron-core' ),
				'type'        => Controls_Manager::TEXT,
				'dynamic'     => [
					'active' => true,
				],
				'placeholder' => esc_html__( 'Enter your button text', 'feron-core' ),
				'default' => esc_html__('Read More', 'feron-core'),
			]
		);

		$this->add_control(
			'button_link',
			[
			  'label' => __( 'Button Url', 'feron-core' ),
			  'type' => Controls_Manager::URL,
			  'placeholder' => __( 'https://your-link.com', 'feron-core' ),
			  'show_external' => true,
			  'default' => [
				'url' => '',
				'is_external' => true,
				'nofollow' => true,
			  ],
			
		   ]
		);

		$this->add_control(
			'text',
			[
				'label'       => __( 'Description Text', 'feron-core' ),
				'type'        => Controls_Manager::TEXTAREA,
				'dynamic'     => [
					'active' => true,
				],
				'placeholder' => __( 'Enter Your Text', 'feron-core' ),
			]
		);			

		$this->end_controls_section();

		// Tab Start - 3

		$this->start_controls_section(
			'section_number_content',
			[
				'label' => esc_html__( 'Section Number Content', 'feron-core' ),
			]
		);
		$this->add_control(
			'repeat',
			[
				'label' => esc_html__( 'Create New', 'feron-core' ),
				'type' => Controls_Manager::REPEATER,
				'fields' => [
					[
						'name' => 'section_number',
						'label' => esc_html__( 'Section Number', 'feron-core' ),
						'type' => Controls_Manager::TEXT,
						'default' => esc_html__( '25', 'feron-core' ),
						'label_block' => true,
					],
					[
						'name' => 'section_number_suffix',
						'label' => esc_html__( 'Section Number Suffix', 'feron-core' ),
						'type' => Controls_Manager::TEXT,
						'default' => esc_html__( '+', 'feron-core' ),
						'label_block' => true,
					],
					[
						'name' => 'section_number_title',
						'label' => esc_html__( 'Section Number Title', 'feron-core' ),
						'type' => Controls_Manager::TEXT,
						'default' => esc_html__( 'Years of Experience', 'feron-core' ),
						'label_block' => true,
					],					
				],
				'default' => [
					[
						'section_number' => esc_html__( '25', 'feron-core' ),
						'section_number_suffix' => esc_html__( '+', 'feron-core' ),
						'section_number_title' => esc_html__( 'Years of Experience', 'feron-core' ),
					],
					[
						'section_number' => esc_html__( '100', 'feron-core' ),
						'section_number_suffix' => esc_html__( '%', 'feron-core' ),
						'section_number_title' => esc_html__( 'Satisfaction Rate', 'feron-core' ),
					],
					[
						'section_number' => esc_html__( '150', 'feron-core' ),
						'section_number_suffix' => esc_html__( '+', 'feron-core' ),
						'section_number_title' => esc_html__( 'Expert Members', 'feron-core' ),
					],
				],
				'title_field' => '{{{ section_number }}}',
			]
		);

		$this->end_controls_section();


				// Section Title ==================
		$this->start_controls_section(
			'section_title_settings',
			[
				'label' => __( 'Section Title Setting', 'feron-core' ),
				'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
			]
		);

		$this->add_control(
			'show_section_title',
			[
				'label'   => esc_html__( 'Show Section Title', 'feron-core' ),
				'type'    => \Elementor\Controls_Manager::CHOOSE,
				'options' => [
					'show' => [
						'title' => esc_html__( 'Show', 'feron-core' ),
						'icon'  => 'eicon-check-circle',
					],
					'none' => [
						'title' => esc_html__( 'Hide', 'feron-core' ),
						'icon'  => 'eicon-close-circle',
					],
				],
				'default'   => 'show',
				'selectors' => [
					'{{WRAPPER}} .hero-1 .hero-content h1' => 'display: {{VALUE}} !important',
				],
			]
		);

		$this->add_control(
			'section_title_alignment',
			[
				'label'     => esc_html__( 'Alignment', 'feron-core' ),
				'type'      => \Elementor\Controls_Manager::CHOOSE,
				'options'   => [
					'left' => [
						'title' => esc_html__( 'Left', 'feron-core' ),
						'icon'  => 'eicon-text-align-left',
					],
					'center' => [
						'title' => esc_html__( 'Center', 'feron-core' ),
						'icon'  => 'eicon-text-align-center',
					],
					'right' => [
						'title' => esc_html__( 'Right', 'feron-core' ),
						'icon'  => 'eicon-text-align-right',
					],
				],
				'toggle'    => true,
				'condition' => [ 'show_section_title' => 'show' ],
				'selectors' => [
					'{{WRAPPER}} .hero-1 .hero-content h1' => 'text-align: {{VALUE}} !important',
				],
			]
		);

		$this->add_control(
			'section_title_margin',
			[
				'label'      => __( 'Margin', 'feron-core' ),
				'type'       => \Elementor\Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', '%', 'em' ],
				'condition'  => [ 'show_section_title' => 'show' ],
				'selectors'  => [
					'{{WRAPPER}} .hero-1 .hero-content h1' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important',
				],
			]
		);

		$this->add_control(
			'section_title_padding',
			[
				'label'      => __( 'Padding', 'feron-core' ),
				'type'       => \Elementor\Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', '%', 'em' ],
				'condition'  => [ 'show_section_title' => 'show' ],
				'selectors'  => [
					'{{WRAPPER}} .hero-1 .hero-content h1' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important',
				],
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name'      => 'section_title_typography',
				'label'     => __( 'Typography', 'feron-core' ),
				'selector'  => '{{WRAPPER}} .hero-1 .hero-content h1',
				'condition' => [ 'show_section_title' => 'show' ],
			]
		);

		$this->add_control(
			'section_title_color',
			[
				'label'     => __( 'Color', 'feron-core' ),
				'type'      => \Elementor\Controls_Manager::COLOR,
				'condition' => [ 'show_section_title' => 'show' ],
				'selectors' => [
					'{{WRAPPER}} .hero-1 .hero-content h1' => 'color: {{VALUE}} !important',
				],
			]
		);

		$this->end_controls_section();
		// End of Title ==================


		// ===== Tab Start - 4: Section Sub Title Settings =====

		$this->start_controls_section(
			'section_subtitle_settings',
			[
				'label' => __( 'Section Sub Title Setting', 'feron-core' ),
				'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
			]
		);

		$this->add_control(
			'show_section_subtitle',
			[
				'label'   => esc_html__( 'Show Section Sub Title', 'feron-core' ),
				'type'    => \Elementor\Controls_Manager::CHOOSE,
				'options' => [
					'show' => [
						'title' => esc_html__( 'Show', 'feron-core' ),
						'icon'  => 'eicon-check-circle',
					],
					'none' => [
						'title' => esc_html__( 'Hide', 'feron-core' ),
						'icon'  => 'eicon-close-circle',
					],
				],
				'default'   => 'show',
				'selectors' => [
					'{{WRAPPER}} .hero-1 .hero-content h1 .sub-text' => 'display: {{VALUE}} !important',
				],
			]
		);

		$this->add_control(
			'section_subtitle_alignment',
			[
				'label'     => esc_html__( 'Alignment', 'feron-core' ),
				'type'      => \Elementor\Controls_Manager::CHOOSE,
				'options'   => [
					'left' => [
						'title' => esc_html__( 'Left', 'feron-core' ),
						'icon'  => 'eicon-text-align-left',
					],
					'center' => [
						'title' => esc_html__( 'Center', 'feron-core' ),
						'icon'  => 'eicon-text-align-center',
					],
					'right' => [
						'title' => esc_html__( 'Right', 'feron-core' ),
						'icon'  => 'eicon-text-align-right',
					],
				],
				'toggle'    => true,
				'condition' => [ 'show_section_subtitle' => 'show' ],
				'selectors' => [
					'{{WRAPPER}} .hero-1 .hero-content h1 .sub-text' => 'text-align: {{VALUE}} !important',
				],
			]
		);

		$this->add_control(
			'section_subtitle_margin',
			[
				'label'      => __( 'Margin', 'feron-core' ),
				'type'       => \Elementor\Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', '%', 'em' ],
				'condition'  => [ 'show_section_subtitle' => 'show' ],
				'selectors'  => [
					'{{WRAPPER}} .hero-1 .hero-content h1 .sub-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important',
				],
			]
		);

		$this->add_control(
			'section_subtitle_padding',
			[
				'label'      => __( 'Padding', 'feron-core' ),
				'type'       => \Elementor\Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', '%', 'em' ],
				'condition'  => [ 'show_section_subtitle' => 'show' ],
				'selectors'  => [
					'{{WRAPPER}} .hero-1 .hero-content h1 .sub-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important',
				],
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name'      => 'section_subtitle_typography',
				'label'     => __( 'Typography', 'feron-core' ),
				'selector'  => '{{WRAPPER}} .hero-1 .hero-content h1 .sub-text',
				'condition' => [ 'show_section_subtitle' => 'show' ],
			]
		);

		$this->add_control(
			'section_subtitle_color',
			[
				'label'     => __( 'Color', 'feron-core' ),
				'type'      => \Elementor\Controls_Manager::COLOR,
				'separator' => 'after',
				'condition' => [ 'show_section_subtitle' => 'show' ],
				'selectors' => [
					'{{WRAPPER}} .hero-1 .hero-content h1 .sub-text' => 'color: {{VALUE}} !important',
				],
			]
		);

		$this->end_controls_section();

		// ===== End Tab - 4: Section Sub Title Settings =====


				// ===== Tab Start - 5: Title Settings =====

		$this->start_controls_section(
			'title_settings',
			[
				'label' => __( 'Title Setting', 'feron-core' ),
				'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
			]
		);

		$this->add_control(
			'show_title',
			[
				'label'   => esc_html__( 'Show Title', 'feron-core' ),
				'type'    => \Elementor\Controls_Manager::CHOOSE,
				'options' => [
					'show' => [
						'title' => esc_html__( 'Show', 'feron-core' ),
						'icon'  => 'eicon-check-circle',
					],
					'none' => [
						'title' => esc_html__( 'Hide', 'feron-core' ),
						'icon'  => 'eicon-close-circle',
					],
				],
				'default'   => 'show',
				'selectors' => [
					'{{WRAPPER}} .hero-1 .hero-content .counter-wrap .counter-item h2' => 'display: {{VALUE}} !important',
				],
			]
		);

		$this->add_control(
			'title_alignment',
			[
				'label'     => esc_html__( 'Alignment', 'feron-core' ),
				'type'      => \Elementor\Controls_Manager::CHOOSE,
				'options'   => [
					'left' => [
						'title' => esc_html__( 'Left', 'feron-core' ),
						'icon'  => 'eicon-text-align-left',
					],
					'center' => [
						'title' => esc_html__( 'Center', 'feron-core' ),
						'icon'  => 'eicon-text-align-center',
					],
					'right' => [
						'title' => esc_html__( 'Right', 'feron-core' ),
						'icon'  => 'eicon-text-align-right',
					],
				],
				'toggle'    => true,
				'condition' => [ 'show_title' => 'show' ],
				'selectors' => [
					'{{WRAPPER}} .hero-1 .hero-content .counter-wrap .counter-item h2' => 'text-align: {{VALUE}} !important',
				],
			]
		);

		$this->add_control(
			'title_margin',
			[
				'label'      => __( 'Margin', 'feron-core' ),
				'type'       => \Elementor\Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', '%', 'em' ],
				'condition'  => [ 'show_title' => 'show' ],
				'selectors'  => [
					'{{WRAPPER}} .hero-1 .hero-content .counter-wrap .counter-item h2' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important',
				],
			]
		);

		$this->add_control(
			'title_padding',
			[
				'label'      => __( 'Padding', 'feron-core' ),
				'type'       => \Elementor\Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', '%', 'em' ],
				'condition'  => [ 'show_title' => 'show' ],
				'selectors'  => [
					'{{WRAPPER}} .hero-1 .hero-content .counter-wrap .counter-item h2' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important',
				],
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name'      => 'title_typography',
				'label'     => __( 'Typography', 'feron-core' ),
				'selector'  => '{{WRAPPER}} .hero-1 .hero-content .counter-wrap .counter-item h2',
				'condition' => [ 'show_title' => 'show' ],
			]
		);

		$this->add_control(
			'title_color',
			[
				'label'     => __( 'Color', 'feron-core' ),
				'type'      => \Elementor\Controls_Manager::COLOR,
				'condition' => [ 'show_title' => 'show' ],
				'selectors' => [
					'{{WRAPPER}} .hero-1 .hero-content .counter-wrap .counter-item h2' => 'color: {{VALUE}} !important',
				],
			]
		);

		$this->add_control(
			'title_hover_color',
			[
				'label'     => __( 'Hover Color', 'feron-core' ),
				'type'      => \Elementor\Controls_Manager::COLOR,
				'condition' => [ 'show_title' => 'show' ],
				'selectors' => [
					'{{WRAPPER}} .hero-1 .hero-content .counter-wrap .counter-item h2:hover' => 'color: {{VALUE}} !important',
				],
			]
		);

		$this->end_controls_section();

		// ===== End Tab - 5: Title Settings =====

		//Sub Title	==================	
	

		$this->start_controls_section(
			'subtitle_settings',
			array(
				'label' => __( 'Sub Title Setting', 'feron-core' ),
			
				'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
			)
		);
	
	$this->add_control(
			'show_subtitle',
			array(
				'label' => esc_html__( 'Show Sub Title', 'feron-core' ),
				'type' => \Elementor\Controls_Manager::CHOOSE,
				'options' => [
					'show' => [
						'show' => esc_html__( 'Show', 'feron-core' ),	
						'icon' => 'eicon-check-circle',
					],
					'none' => [
						'none' => esc_html__( 'Hide', 'feron-core' ),
						'icon' => 'eicon-close-circle',
					],
				],
				'default' => 'show',
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-content .counter-wrap .counter-item p' => 'display: {{VALUE}} !important',
				),  
			)
		);	
	$this->add_control(
			'subtitle_alingment',
			array(
				'label' => esc_html__( 'Alignment', 'feron-core' ),
				'type' => \Elementor\Controls_Manager::CHOOSE,
				'options' => [
					'left' => [
						'title' => esc_html__( 'Left', 'feron-core' ),
						'icon' => 'eicon-text-align-left',
					],
					'center' => [
						'title' => esc_html__( 'Center', 'feron-core' ),
						'icon' => 'eicon-text-align-center',
					],
					'right' => [
						'title' => esc_html__( 'Right', 'feron-core' ),
						'icon' => 'eicon-text-align-right',
					],
				],
				'condition'    => array( 'show_subtitle' => 'show' ),
				'toggle' => true,
				'selectors' => array(
				
					'{{WRAPPER}} .hero-1 .hero-content .counter-wrap .counter-item p' => 'text-align: {{VALUE}} !important',
				),
			)
		);	
	$this->add_control(
			'subtitle_padding',
			array(
				'label'     => __( 'Padding', 'feron-core' ),
				'condition'    => array( 'show_subtitle' => 'show' ),
				'type'      => \Elementor\Controls_Manager::DIMENSIONS,
				'size_units' =>  ['px', '%', 'em' ],
			
				'selectors' => array(
			'{{WRAPPER}} .hero-1 .hero-content .counter-wrap .counter-item p' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important',		
				),
			)
		);
		$this->add_control(
			'subtitle_margin',
			array(
				'label'     => __( 'Margin', 'feron-core' ),
				'condition'    => array( 'show_subtitle' => 'show' ),
				'type'      => \Elementor\Controls_Manager::DIMENSIONS,
				'size_units' =>  ['px', '%', 'em' ],
			
				'selectors' => array(
			'{{WRAPPER}} .hero-1 .hero-content .counter-wrap .counter-item p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important',		
				),
			)
		);
		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
		
			array(
				'name'     => 'subtitle_typography',
				'condition'    => array( 'show_subtitle' => 'show' ),
				'label'    => __( 'Typography', 'feron-core' ),
				'selector' => '{{WRAPPER}} .hero-1 .hero-content .counter-wrap .counter-item p',
			)
		);
		
		
		$this->add_control(
			'subtitle_color',
			array(
				'label'     => __( 'Color', 'feron-core' ),
				'condition'    => array( 'show_subtitle' => 'show' ),
				'separator' => 'after',
				'type'      => \Elementor\Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-content .counter-wrap .counter-item p' => 'color: {{VALUE}} !important',
				),
			
			)
		);

		$this->end_controls_section();
		
		//End of  Sub Title 	==================	

		//Text==========================
		$this->start_controls_section(
			'text_settings',
			array(
				'label' => __( 'Text Setting', 'feron-core' ),
				'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
			)
		); 
		
		$this->add_control(
			'show_text',
			array(
				'label' => esc_html__( 'Show Text', 'feron-core' ),
				'type' => \Elementor\Controls_Manager::CHOOSE,
				'options' => [
					'show' => [
						'show' => esc_html__( 'Show', 'feron-core' ),	
						'icon' => 'eicon-check-circle',
					],
					'none' => [
						'none' => esc_html__( 'Hide', 'feron-core' ),
						'icon' => 'eicon-close-circle',
					],
				],
				'default' => 'show',
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-text' => 'display: {{VALUE}} !important',
				),   
			)
		);
		
		$this->add_control(
			'text_alignment',
			array(
				'label' => esc_html__( 'Alignment', 'feron-core' ),
				'type' => \Elementor\Controls_Manager::CHOOSE,
				'options' => [
					'left' => [
						'title' => esc_html__( 'Left', 'feron-core' ),
						'icon' => 'eicon-text-align-left',
					],
					'center' => [
						'title' => esc_html__( 'Center', 'feron-core' ),
						'icon' => 'eicon-text-align-center',
					],
					'right' => [
						'title' => esc_html__( 'Right', 'feron-core' ),
						'icon' => 'eicon-text-align-right',
					],
				],
				'condition'    => array( 'show_text' => 'show' ),
				'toggle' => true,
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-text' => 'text-align: {{VALUE}} !important',
				), 
			)
		);
		
		$this->add_control(
			'text_margin',
			array(
				'label'     => __( 'Margin', 'feron-core' ),
				'type'      => \Elementor\Controls_Manager::DIMENSIONS,
				'size_units' =>  ['px', '%', 'em' ],
				'condition'    => array( 'show_text' => 'show' ),
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important',
				),
			)
		);
		
		$this->add_control(
			'text_padding',
			array(
				'label'     => __( 'Padding', 'feron-core' ),
				'type'      => \Elementor\Controls_Manager::DIMENSIONS,
				'size_units' =>  ['px', '%', 'em' ],
				'condition'    => array( 'show_text' => 'show' ),
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important',
				),
			)
		);
		
		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			array(
				'name'     => 'text_typography',
				'condition'    => array( 'show_text' => 'show' ),
				'label'    => __( 'Typography', 'feron-core' ),
				'selector' => '{{WRAPPER}} .hero-1 .hero-text',
			)
		); 
		
		$this->add_control(
			'text_color',
			array(
				'label'     => __( 'Color', 'feron-core' ),
				'condition'    => array( 'show_text' => 'show' ),
				'separator' => 'after',
				'type'      => \Elementor\Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-text' => 'color: {{VALUE}} !important',
				),
			)
		);

		$this->add_control(
			'text_hover_color',
			array(
				'label'     => __( 'Hover Color', 'feron-core' ),
				'condition'    => array( 'show_text' => 'show' ),
				'separator' => 'after',
				'type'      => \Elementor\Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-text:hover' => 'color: {{VALUE}} !important',
				),
			)
		);

		$this->end_controls_section();
		//End of Text=========	

		//========== Button with Background ===================================

		$this->start_controls_section(
			'button_control',
			array(
				'label' => __( 'Button Settings', 'feron-core' ),
				'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
			)
		);
		
		$this->add_control(
			'show_button',
			array(
				'label' => esc_html__( 'Show Button', 'feron-core' ),
				'type' => \Elementor\Controls_Manager::CHOOSE,
				'options' => [
					'show' => [
						'show' => esc_html__( 'Show', 'feron-core' ),	
						'icon' => 'eicon-check-circle',
					],
					'none' => [
						'none' => esc_html__( 'Hide', 'feron-core' ),
						'icon' => 'eicon-close-circle',
					],
				],
				'default' => 'show',
				'selectors' => array(
					'{{WRAPPER}} .theme-btn' => 'display: {{VALUE}} !important',
				),
			)
		);		
		$this->add_control(
			'button_alingment',
			array(
				'label' => esc_html__( 'Alignment', 'feron-core' ),
				'type' => \Elementor\Controls_Manager::CHOOSE,
				'condition'    => array( 'show_button' => 'show' ),
				'options' => [
					'left' => [
						'title' => esc_html__( 'Left', 'feron-core' ),
						'icon' => 'eicon-text-align-left',
					],
					'center' => [
						'title' => esc_html__( 'Center', 'feron-core' ),
						'icon' => 'eicon-text-align-center',
					],
					'right' => [
						'title' => esc_html__( 'Right', 'feron-core' ),
						'icon' => 'eicon-text-align-right',
					],
				],
				'toggle' => true,
				'selectors' => array(
					'{{WRAPPER}} .theme-btn' => 'text-align: {{VALUE}} !important',
				),
			)
		);	
		$this->add_control(
			'button_color',
			array(
				'label'     => __( 'Button Color', 'feron-core' ),
				'condition'    => array( 'show_button' => 'show' ),
				'type'      => \Elementor\Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .theme-btn' => 'color: {{VALUE}} !important',

				),
			)
		);
		$this->add_control(
			'button_bg_color',
			array(
				'label'     => __( 'Background Color', 'feron-core' ),
				'condition'    => array( 'show_button' => 'show' ),
				'type'      => \Elementor\Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .theme-btn' => 'background: {{VALUE}} !important',
				),
			)
		);	
		$this->add_control(
			'button_hover_color',
			array(
				'label'     => __( 'Hover Color', 'feron-core' ),
				'condition'    => array( 'show_button' => 'show' ),
				'type'      => \Elementor\Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .theme-btn' => 'background: {{VALUE}} !important',
				),
			)
		);				
		$this->add_control(
			'button_padding',
			array(
				'label'     => __( 'Padding', 'feron-core' ),
				'type'      => \Elementor\Controls_Manager::DIMENSIONS,
				'condition'    => array( 'show_button' => 'show' ),
				'size_units' =>  ['px', '%', 'em' ],
			
				'selectors' => array(
					'{{WRAPPER}} .theme-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important',
				),
			)
		);

		$this->add_control(
			'button_margin',
			array(
				'label'     => __( 'Margin', 'feron-core' ),
				'type'      => \Elementor\Controls_Manager::DIMENSIONS,
				'condition'    => array( 'show_button' => 'show' ),
				'size_units' =>  ['px', '%', 'em' ],
				'selectors' => array(
					'{{WRAPPER}} .theme-btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important',
				),
			)
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			array(
				'name'     => 'button_typography',
				'condition'    => array( 'show_button' => 'show' ),
				'label'    => __( 'Typography', 'feron-core' ),
				'selector' => '{{WRAPPER}} .theme-btn',
			)
		);
		$this->add_group_control(
			\Elementor\Group_Control_Border::get_type(),
			array(
				'name' => 'border',
				'condition'    => array( 'show_button' => 'show' ),
				'selector' => '{{WRAPPER}} .theme-btn',
			)
		);
		$this->add_control(
			'border_radius',
			array(
				'label' => esc_html__( 'Border Radius', 'feron-core' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'condition'    => array( 'show_button' => 'show' ),
				'size_units' => [ 'px', '%' ],
				'range' => [
					'px' => [
						'min' => 0,
						'max' => 1000,
						'step' => 5,
					],
					'%' => [
						'min' => 0,
						'max' => 100,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .theme-btn' => 'border-radius: {{SIZE}}{{UNIT}};',
				],
			)
		);

		$this->end_controls_section();
		
		//End of Button	

		//========== Video Play Button ===================================
		$this->start_controls_section(
			'video_play_button_section',
			array(
				'label' => __( 'Video Play Button', 'feron-core' ),
				'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
			)
		);

		$this->add_control(
			'show_video_button',
			array(
				'label' => esc_html__( 'Show Video Button', 'feron-core' ),
				'type' => \Elementor\Controls_Manager::CHOOSE,
				'options' => [
					'show' => [
						'title' => esc_html__( 'Show', 'feron-core' ),	
						'icon' => 'eicon-check-circle',
					],
					'none' => [
						'title' => esc_html__( 'Hide', 'feron-core' ),
						'icon' => 'eicon-close-circle',
					],
				],
				'default' => 'show',
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-content .video-wrap .video-btn' => 'display: {{VALUE}} !important',
				), 
			)
		);

		// Alignment
		$this->add_control(
			'video_button_alignment',
			array(
				'label' => esc_html__( 'Alignment', 'feron-core' ),
				'type' => \Elementor\Controls_Manager::CHOOSE,
				'condition'    => array( 'show_video_button' => 'show' ),
				'options' => [
					'left' => [
						'title' => esc_html__( 'Left', 'feron-core' ),
						'icon' => 'eicon-text-align-left',
					],
					'center' => [
						'title' => esc_html__( 'Center', 'feron-core' ),
						'icon' => 'eicon-text-align-center',
					],
					'right' => [
						'title' => esc_html__( 'Right', 'feron-core' ),
						'icon' => 'eicon-text-align-right',
					],
				],
				'default' => 'center',
				'toggle' => true,
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-content .video-wrap .video-btn-wrapper' => 'text-align: {{VALUE}} !important',
				),
			)
		);

		// Icon color
		$this->add_control(
			'video_button_color',
			array(
				'label'     => __( 'Icon Color', 'feron-core' ),
				'condition'    => array( 'show_video_button' => 'show' ),
				'type'      => \Elementor\Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-content .video-wrap .video-btn i' => 'color: {{VALUE}} !important',
				),
			)
		);

		// Background color
		$this->add_control(
			'video_button_bg_color',
			array(
				'label'     => __( 'Background Color', 'feron-core' ),
				'condition'    => array( 'show_video_button' => 'show' ),
				'type'      => \Elementor\Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-content .video-wrap .video-btn' => 'background: {{VALUE}} !important',
				),
			)
		);

		// Hover color
		$this->add_control(
			'video_button_hover_color',
			array(
				'label'     => __( 'Hover Icon Color', 'feron-core' ),
				'condition'    => array( 'show_video_button' => 'show' ),
				'type'      => \Elementor\Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-content .video-wrap .video-btn:hover i' => 'color: {{VALUE}} !important',
				),
			)
		);

		// Hover background
		$this->add_control(
			'video_button_bg_hover_color',
			array(
				'label'     => __( 'Hover Background Color', 'feron-core' ),
				'condition'    => array( 'show_video_button' => 'show' ),
				'type'      => \Elementor\Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-content .video-wrap .video-btn:hover' => 'background: {{VALUE}} !important',
				),
			)
		);

		// Size
		$this->add_responsive_control(
			'video_button_size',
			array(
				'label' => __( 'Button Size', 'feron-core' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'range' => [
					'px' => [
						'min' => 20,
						'max' => 200,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .hero-1 .hero-content .video-wrap .video-btn' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}}; font-size: calc({{SIZE}}{{UNIT}} / 2);',
				],
			)
		);

		// Border & Radius
		$this->add_group_control(
			\Elementor\Group_Control_Border::get_type(),
			array(
				'name' => 'video_button_border',
				'condition'    => array( 'show_video_button' => 'show' ),
				'selector' => '{{WRAPPER}} .hero-1 .hero-content .video-wrap .video-btn',
			)
		);

		$this->add_control(
			'video_button_border_radius',
			array(
				'label'     => __( 'Border Radius', 'feron-core' ),
				'type'      => \Elementor\Controls_Manager::DIMENSIONS,
				'condition'    => array( 'show_video_button' => 'show' ),
				'size_units' =>  ['px', '%', 'em' ],
				'selectors' => array(
					'{{WRAPPER}} .hero-1 .hero-content .video-wrap .video-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important',
				),
			)
		);

		$this->end_controls_section();
		//========== End Video Play Button ===================================


	
		}

	/**
	 * Render button widget output on the frontend.
	 * Written in PHP and used to generate the final HTML.
	 *
	 * @since  1.0.0
	 * @access protected
	 */
	protected function render() {
		$settings = $this->get_settings_for_display();
		$allowed_tags = wp_kses_allowed_html('post');
		?>


		<section class="hero-section hero-1">
			<?php  if ( !empty(esc_url($settings['image']['id']) )) : ?> 
            <div class="hero-image float-bob-y">                  
				<img src="<?php echo wp_get_attachment_url($settings['image']['id']);?>" alt=""/>				
            </div>
			<?php endif;?>
			<?php  if ( !empty(esc_url($settings['image2']['id']) )) : ?>  
            <div class="right-shape">                 
				<img src="<?php echo wp_get_attachment_url($settings['image2']['id']);?>" alt=""/>					
            </div>
			<?php endif;?>
            <div class="container">
                <div class="row g-4">
                    <div class="col-lg-12">
                        <div class="hero-content">
                            <h1 class="wow fadeInUp" data-wow-delay=".3s">
                               <?php echo $settings['title'];?><span class="d-lg-none d-inline-block"><?php echo $settings['hidden_text'];?></span>
                                <span class="sub-text"><?php echo $settings['subtitle'];?></span>

								<?php  if ( !empty(esc_url($settings['image3']['id']) )) : ?>  
                                <span class="dot-shape">                                     
									<img src="<?php echo wp_get_attachment_url($settings['image3']['id']);?>" alt=""/>								
                                </span>
								<?php endif;?>
                            </h1>
                            <div class="video-wrap">
                                <a href="<?php echo esc_url($settings['video_link']['url']);?>" class="video-btn video-popup">
                                     <i class="fa-solid fa-play"></i>
                                </a>
								<?php  if ( !empty(esc_url($settings['image4']['id']) )) : ?>   
                                <div class="box-shape">                                    	
									<img src="<?php echo wp_get_attachment_url($settings['image4']['id']);?>" alt=""/>							
                                </div>
								<?php endif;?>
                            </div>
                            <div class="counter-wrap">
								<?php foreach($settings['repeat'] as $item):?>	
                                <div class="counter-item wow fadeInUp" data-wow-delay=".3s">
                                    <h2>
                                        <span class="gt-count"><?php echo wp_kses($item['section_number'], $allowed_tags);?></span><?php echo wp_kses($item['section_number_suffix'], $allowed_tags);?>
                                    </h2>
                                    <p><?php echo wp_kses($item['section_number_title'], $allowed_tags);?></p>
                                </div>
								<?php endforeach; ?>
                            </div>
                            <a href="<?php echo esc_url($settings['button_link']['url']);?>" class="theme-btn wow fadeInUp" data-wow-delay=".9s">
                                <?php echo $settings['button'];?>
                            </a>
                        </div>
                    </div>
                </div>
                 <p class="hero-text">
                    <?php echo $settings['text'];?>
                </p>
            </div>

			<div class="swiper line-slider">
                <div class="swiper-wrapper gt-slide-transtion">
                    <div class="swiper-slide gt-brand-slide-element">
                        <span class="line1"></span>
                    </div>
                     <div class="swiper-slide gt-brand-slide-element">
                        <span class="line1"></span>
                    </div>
                     <div class="swiper-slide gt-brand-slide-element">
                        <span class="line1"></span>
                    </div>
                    <div class="swiper-slide gt-brand-slide-element">
                        <span class="line1"></span>
                    </div>
                    <div class="swiper-slide gt-brand-slide-element">
                        <span class="line1"></span>
                    </div>
                    <div class="swiper-slide gt-brand-slide-element">
                        <span class="line1"></span>
                    </div>
                </div>
            </div>
             <div dir="rtl" class="swiper line-slider2">
                <div class="swiper-wrapper gt-slide-transtion">
                    <div class="swiper-slide gt-brand-slide-element">
                        <span class="line1"></span>
                    </div>
                     <div class="swiper-slide gt-brand-slide-element">
                        <span class="line1"></span>
                    </div>
                     <div class="swiper-slide gt-brand-slide-element">
                        <span class="line1"></span>
                    </div>
                    <div class="swiper-slide gt-brand-slide-element">
                        <span class="line1"></span>
                    </div>
                    <div class="swiper-slide gt-brand-slide-element">
                        <span class="line1"></span>
                    </div>
                    <div class="swiper-slide gt-brand-slide-element">
                        <span class="line1"></span>
                    </div>
                </div>
            </div>
        </section>

             
		<?php 
	}


}

Plugin::instance()->widgets_manager->register_widget_type(new Banner());