<?php
use Banana_Addons\Elementor\Helper;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Group_Control_Background;
use Elementor\Repeater;
use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
use Elementor\Utils;

if ( ! defined( 'ABSPATH' ) )
	exit; // Exit if accessed directly

class Banae_Timeline_Controls {

	/**
	 * The main widget controls registration method
	 * 
	 * @param mixed $widget
	 * 
	 * @return void
	 */
	public static function add_register_controls( $widget ) {
		$widget->start_controls_section(
			'timeline_content_section',
			[
				'label' => esc_html__( 'Timeline', 'banana-addons-for-elementor' ),
				'tab' => Controls_Manager::TAB_CONTENT,
			]
		);

		$widget->add_control(
			'timeline_style',
			[
				'label' => esc_html__( 'Timeline Preset', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::SELECT,
				'default' => 'style-1',
				'options' => [
					'style-1' => esc_html__( 'Style 1', 'banana-addons-for-elementor' ),
					'style-2' => esc_html__( 'Style 2', 'banana-addons-for-elementor' ),
					'style-3' => esc_html__( 'Style 3', 'banana-addons-for-elementor' ),
				],
				'selectors' => [],
			]
		);

		$repeater = new Repeater();

		// Start Tabs Wrapper
		$repeater->start_controls_tabs( 'item_tabs' );

		// Tab 1: Content
		$repeater->start_controls_tab( 'tab_content', [ 'label' => esc_html__( 'Content', 'banana-addons-for-elementor' ) ] );


		$repeater->add_control(
			'item_icon',
			[
				'label' => esc_html__( 'Icon', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::ICONS,
				'default' => [
					'value' => 'fas fa-circle',
					'library' => 'fa-solid',
				],
				'recommended' => [
					'fa-solid' => [
						'circle',
						'dot-circle',
						'square-full',
					],
					'fa-regular' => [
						'circle',
						'dot-circle',
						'square-full',
					],
				],
			],
		);

		$repeater->add_control(
			'list_title',
			[
				'label' => esc_html__( 'Title', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::TEXT,
				//'default' => esc_html__( 'List Title', 'banana-addons-for-elementor' ),
				'label_block' => true,
			]
		);

		/*
		$repeater->add_control(
			'list_time',
			[
				'label' => esc_html__( 'Time', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::TEXT,
				'default' => esc_html__( 'April, 12 2026', 'banana-addons-for-elementor' ),
				//'placeholder' => esc_html__( 'April, 12 2026', 'banana-addons-for-elementor' ),
				'label_block' => true,
			]
		);*/

		$repeater->add_control(
			'list_time',
			[
				'label' => esc_html__( 'Date & Time', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::DATE_TIME,
				'picker_options' => [
					'dateFormat' => 'M j, Y',
					'enableTime' => false,
				],
				'label_block' => true,
			]
		);

		$repeater->add_control(
			'list_description',
			[
				'label' => esc_html__( 'Description', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::WYSIWYG,
				//'default' => esc_html__( 'Default description', 'banana-addons-for-elementor' ),
				'placeholder' => esc_html__( 'Type your description', 'banana-addons-for-elementor' ),
			]
		);

		$repeater->add_control(
			'list_button_text',
			[
				'label' => esc_html__( 'Button Text', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::TEXT,
				'label_block' => true,
			]
		);

		$repeater->add_control(
			'list_button_link',
			[
				'label' => esc_html__( 'Button Link', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::URL,
				'options' => [ 'url', 'is_external', 'nofollow' ],
				'default' => [
					'url' => '',
					'is_external' => true,
					'nofollow' => true,
					// 'custom_attributes' => '',
				],
				'label_block' => true,
			]
		);

		/*
		$widget->add_control(
			'list',
			[
				'label' => esc_html__( 'Item List', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::REPEATER,
				'fields' => [
					[
						'name' => 'list_title',
						'label' => esc_html__( 'Title', 'banana-addons-for-elementor' ),
						'type' => Controls_Manager::TEXT,
						'default' => esc_html__( 'List Title', 'banana-addons-for-elementor' ),
						'label_block' => true,
					],
					[
						'name' => 'list_content',
						'label' => esc_html__( 'Content', 'banana-addons-for-elementor' ),
						'type' => Controls_Manager::WYSIWYG,
						'default' => esc_html__( 'List Content', 'banana-addons-for-elementor' ),
						'show_label' => false,
					],
					[
						'name' => 'list_color',
						'label' => esc_html__( 'Color', 'banana-addons-for-elementor' ),
						'type' => Controls_Manager::COLOR,
						'selectors' => [
							'{{WRAPPER}} {{CURRENT_ITEM}}' => 'color: {{VALUE}}'
						],
					]
				],
				'default' => [
					[
						'list_title' => esc_html__( 'Title #1', 'banana-addons-for-elementor' ),
						'list_content' => esc_html__( 'Item content. Click the edit button to change this text.', 'banana-addons-for-elementor' ),
					],
					[
						'list_title' => esc_html__( 'Title #2', 'banana-addons-for-elementor' ),
						'list_content' => esc_html__( 'Item content. Click the edit button to change this text.', 'banana-addons-for-elementor' ),
					],
				],
				'title_field' => '{{{ list_title }}}',
			]
		);*/

		$repeater->end_controls_tab();

		// Tab 2: Style
		$repeater->start_controls_tab( 'tab_style', [ 'label' => esc_html__( 'Style', 'banana-addons-for-elementor' ) ] );

		$repeater->add_control(
			'circle_bg_color',
			[
				'label' => __( 'Timeline Box BG', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .timeline-style-2 {{CURRENT_ITEM}}.banae-timeline-block::after' => 'background-color: {{VALUE}}',
				],
			]
		);

		$repeater->add_group_control(
			Group_Control_Border::get_type(),
			[
				'name' => 'circle_border',
				'selector' => '{{WRAPPER}} .timeline-style-2 {{CURRENT_ITEM}}.banae-timeline-block::after',
			]
		);

		$repeater->add_control(
			'icon_separator',
			[
				'label' => esc_html__( 'Icon Options', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::HEADING,
				'separator' => 'after',
			]
		);

		$repeater->add_control(
			'icon_bg_color',
			[
				'label' => __( 'Icon Box Background', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .timeline-style-3 {{CURRENT_ITEM}} .banae-tl-icon' => 'background-color: {{VALUE}}',
				],
			]
		);

		$repeater->add_group_control(
			Group_Control_Border::get_type(),
			[
				'name' => 'icon_border',
				'label' => __( 'Border', 'banana-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} .banae-tl-date',
			]
		);

		$repeater->add_control(
			'content_separator',
			[
				'label' => esc_html__( 'Content Options', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::HEADING,
				'separator' => 'after',
			]
		);

		$repeater->add_group_control(
			Group_Control_Background::get_type(),
			[
				'name' => 'content_bg_color',
				'types' => [ 'classic', 'gradient' ],
				'exclude' => [ 'image', 'video' ],
				'selector' => '{{WRAPPER}} .timeline-style-1 {{CURRENT_ITEM}} .banae-tl-content, {{WRAPPER}} .timeline-style-2 {{CURRENT_ITEM}} .banae-tl-content, {{WRAPPER}} .timeline-style-3 {{CURRENT_ITEM}} .banae-tl-content',
			]
		);

		$repeater->add_group_control(
			Group_Control_Border::get_type(),
			[
				'name' => 'item_content_border',
				'label' => __( 'Border', 'banana-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .timeline-style-1 {{CURRENT_ITEM}} .banae-tl-content, {{WRAPPER}} .timeline-style-2 {{CURRENT_ITEM}} .banae-tl-content, {{WRAPPER}} .timeline-style-3 {{CURRENT_ITEM}} .banae-tl-content',
			]
		);

		$repeater->add_responsive_control(
			'content_arrow_color',
			[
				'label' => __( 'Arrow Color', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'(desktop){{WRAPPER}} .timeline-style-2 {{CURRENT_ITEM}}::before' => 'border-color: transparent transparent transparent {{VALUE}};',
					'(desktop){{WRAPPER}} .timeline-style-2 {{CURRENT_ITEM}}:nth-child(2n)::before' => 'border-color: transparent {{VALUE}} transparent transparent;',
					'(desktop){{WRAPPER}} .timeline-style-3 {{CURRENT_ITEM}}::before' => 'border-color: transparent transparent transparent {{VALUE}};',
					'(desktop){{WRAPPER}} .timeline-style-3 {{CURRENT_ITEM}}:nth-child(2n)::before' => 'border-color: transparent {{VALUE}} transparent transparent;',

					'(tablet){{WRAPPER}} .timeline-style-2 {{CURRENT_ITEM}}::before' => 'border-color: transparent transparent transparent {{VALUE}};',
					'(tablet){{WRAPPER}} .timeline-style-2 {{CURRENT_ITEM}}:nth-child(2n)::before' => 'border-color: transparent {{VALUE}} transparent transparent;',

					'(mobile){{WRAPPER}} .timeline-style-2 {{CURRENT_ITEM}}::before' => 'border-color: transparent {{VALUE}} transparent transparent;',
					'(mobile){{WRAPPER}} .timeline-style-2 {{CURRENT_ITEM}}:nth-child(2n)::before' => 'border-color: transparent {{VALUE}} transparent transparent;',

					'(tablet){{WRAPPER}} .timeline-style-3 {{CURRENT_ITEM}}::before' => 'border-color: transparent transparent transparent {{VALUE}};',
					'(tablet){{WRAPPER}} .timeline-style-3 {{CURRENT_ITEM}}:nth-child(2n)::before' => 'border-color: transparent {{VALUE}} transparent transparent;',

					'(mobile){{WRAPPER}} .timeline-style-3 {{CURRENT_ITEM}}::before' => 'border-color: transparent {{VALUE}} transparent transparent;',
					'(mobile){{WRAPPER}} .timeline-style-3 {{CURRENT_ITEM}}:nth-child(2n)::before' => 'border-color: transparent {{VALUE}} transparent transparent;',
				],
			]
		);

		$repeater->add_responsive_control(
			'content_align',
			[
				'label' => esc_html__( 'Content Alignment', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::CHOOSE,
				'options' => [
					'left' => [
						'title' => esc_html__( 'Left', 'banana-addons-for-elementor' ),
						'icon' => 'eicon-text-align-left',
					],
					'center' => [
						'title' => esc_html__( 'Center', 'banana-addons-for-elementor' ),
						'icon' => 'eicon-text-align-center',
					],
					'right' => [
						'title' => esc_html__( 'Right', 'banana-addons-for-elementor' ),
						'icon' => 'eicon-text-align-right',
					],
				],
				'default' => 'center',
				'toggle' => true,
				'selectors' => [
					'{{WRAPPER}} {{CURRENT_ITEM}} .banae-tl-content' => 'text-align: {{VALUE}};',
				],
			]
		);

		$repeater->end_controls_tab();

		$repeater->end_controls_tabs();

		$widget->add_control(
			'list',
			[
				'label' => esc_html__( 'Item List', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::REPEATER,
				'fields' => $repeater->get_controls(),
				'default' => [
					[
						'list_title' => esc_html__( 'Title #1', 'banana-addons-for-elementor' ),
						'list_description' => esc_html__( 'Item content. Click the edit button to change this text.', 'banana-addons-for-elementor' ),
						'list_time' => esc_html__( 'April, 12 2026.', 'banana-addons-for-elementor' ),
					],
					[
						'list_title' => esc_html__( 'Title #2', 'banana-addons-for-elementor' ),
						'list_description' => esc_html__( 'Item content. Click the edit button to change this text.', 'banana-addons-for-elementor' ),
						'list_time' => esc_html__( 'May, 08 2026.', 'banana-addons-for-elementor' ),
					],
					[
						'list_title' => esc_html__( 'Title #3', 'banana-addons-for-elementor' ),
						'list_description' => esc_html__( 'Item content. Click the edit button to change this text.', 'banana-addons-for-elementor' ),
						'list_time' => esc_html__( 'Sep, 22 2026.', 'banana-addons-for-elementor' ),
					],
				],
				'title_field' => '{{{ list_title }}}',
			]
		);

		$widget->end_controls_section();

		// Settings section
		$widget->start_controls_section(
			'settings_section',
			[
				'label' => esc_html__( 'Settings', 'banana-addons-for-elementor' ),
				'tab' => Controls_Manager::TAB_CONTENT,
			]
		);

		$widget->add_control(
			'show_content_arrow',
			[
				'label' => esc_html__( 'Show Content Arrow?', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::SWITCHER,
				'label_on' => esc_html__( 'Show', 'banana-addons-for-elementor' ),
				'label_off' => esc_html__( 'Hide', 'banana-addons-for-elementor' ),
				'return_value' => 'yes',
				'default' => 'no',
			]
		);

		$widget->add_control(
			'title_tag',
			[
				'label' => esc_html__( 'Title HTML Tag', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::SELECT,
				'options' => Helper::banae_title_tags(),
				'default' => 'h3',
				'toggle' => false,
			]
		);

		$widget->end_controls_section();

		// Content Style Tab Section
		$widget->start_controls_section(
			'timeline_style_section',
			[
				'label' => esc_html__( 'Content', 'banana-addons-for-elementor' ),
				'tab' => Controls_Manager::TAB_STYLE,
			]
		);

		$widget->add_group_control(
			Group_Control_Typography::get_type(),
			[
				'name' => 'content_typography',
				'selector' => '{{WRAPPER}} .banae-tl-content',
			]
		);

		$widget->add_control(
			'content_color',
			[
				'label' => esc_html__( 'Text Color', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .banae-tl-content' => 'color: {{VALUE}}',
				],
			]
		);

		$widget->add_group_control(
			Group_Control_Background::get_type(),
			[
				'name' => 'content_background',
				'types' => [ 'classic', 'gradient' ],
				'exclude' => [ 'video' ],
				'selector' => '{{WRAPPER}} .banae-tl-content',
			]
		);

		$widget->add_group_control(
			Group_Control_Border::get_type(),
			[
				'name' => 'content_border',
				'selector' => '{{WRAPPER}} .banae-tl-content',
				'separator' => 'before',
			]
		);

		$widget->add_control(
			'hr',
			[
				'type' => Controls_Manager::DIVIDER,
			]
		);

		$widget->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			[
				'name' => 'content_shadow',
				'selector' => '{{WRAPPER}} .banae-tl-content',
			]
		);

		$widget->add_control(
			'content_radius',
			[
				'label' => __( 'Border radius', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', '%' ],
				'selectors' => [
					'{{WRAPPER}} .banae-tl-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
				],
			]
		);

		$widget->add_responsive_control(
			'content_padding',
			[
				'label' => __( 'Padding', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', 'em', 'rem', '%' ],
				'default' => [
					'top' => 30,
					'right' => 30,
					'bottom' => 30,
					'left' => 30,
					'unit' => 'px',
					'isLinked' => false,
				],
				'selectors' => [
					'{{WRAPPER}} .banae-tl-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
				],
			]
		);

		$widget->add_responsive_control(
			'content_margin',
			[
				'label' => __( 'Margin', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', 'em', 'rem', '%' ],
				'default' => [
					'unit' => 'px',
					'isLinked' => false,
				],
				'selectors' => [
					'{{WRAPPER}} .banae-tl-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
				],
			]
		);

		$widget->end_controls_section();

		// Timeline tree Style Section
		$widget->start_controls_section(
			'timeline_tree_style_section',
			[
				'label' => esc_html__( 'Timeline Tree', 'banana-addons-for-elementor' ),
				'tab' => Controls_Manager::TAB_STYLE,
			]
		);

		$widget->add_control(
			'tree_color',
			[
				'label' => __( 'Tree Color', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .banae-timeline-wrap::after' => 'background-color: {{VALUE}}'
				],
			]
		);

		$widget->end_controls_section();

		// Title Style Tab Section
		$widget->start_controls_section(
			'title_style_section',
			[
				'label' => esc_html__( 'Title', 'banana-addons-for-elementor' ),
				'tab' => Controls_Manager::TAB_STYLE,
			]
		);

		$widget->add_group_control(
			Group_Control_Typography::get_type(),
			[
				'name' => 'title_typography',
				'selector' => '{{WRAPPER}} .banae-tl-content .banae-tl-heading',
			]
		);

		$widget->add_control(
			'title_color',
			[
				'label' => esc_html__( 'Color', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .banae-tl-content .banae-tl-heading' => 'color: {{VALUE}}',
				],
			]
		);

		$widget->add_responsive_control(
			'title_margin',
			[
				'label' => __( 'Margin', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', 'em', 'rem', '%' ],
				'default' => [
					'unit' => 'px',
					'isLinked' => false,
				],
				'selectors' => [
					'{{WRAPPER}} .banae-tl-content .banae-tl-heading' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
				],
			]
		);

		$widget->end_controls_section();

		// Date and Time Style Tab Section
		$widget->start_controls_section(
			'datetime_style_section',
			[
				'label' => esc_html__( 'Date & Time', 'banana-addons-for-elementor' ),
				'tab' => Controls_Manager::TAB_STYLE,
			]
		);

		$widget->add_group_control(
			Group_Control_Typography::get_type(),
			[
				'name' => 'datetime_typography',
				'selector' => '{{WRAPPER}} .banae-timeline-block .banae-tl-date, {{WRAPPER}} .banae-timeline-block .banae-tl-sm-date',
			]
		);

		$widget->add_control(
			'datetime_color',
			[
				'label' => esc_html__( 'Color', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .banae-timeline-block .banae-tl-date' => 'color: {{VALUE}};',
					'{{WRAPPER}} .banae-timeline-block .banae-tl-sm-date' => 'color: {{VALUE}};',
				],
			]
		);

		$widget->add_responsive_control(
			'datetime_padding',
			[
				'label' => __( 'Padding', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', 'em', 'rem', '%' ],
				'default' => [
					'top' => 4,
					'right' => 4,
					'bottom' => 4,
					'left' => 4,
					'unit' => 'px',
					'isLinked' => false,
				],
				'selectors' => [
					'{{WRAPPER}} .timeline-style-1 .banae-timeline-block .banae-tl-date' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
				],
				'condition' => [
					'timeline_style' => [ 'style-1' ],
				],
			]
		);

		$widget->end_controls_section();

		// Button Style Tab Section
		$widget->start_controls_section(
			'button_style_section',
			[
				'label' => esc_html__( 'Button', 'banana-addons-for-elementor' ),
				'tab' => Controls_Manager::TAB_STYLE,
			]
		);

		$widget->add_group_control(
			Group_Control_Typography::get_type(),
			[
				'name' => 'button_typography',
				'selector' => '{{WRAPPER}} .banae-timeline-block .banae-tl-content .banae-timeline-button',
			]
		);

		// Start Button Normal and Hover Tabs
		$widget->start_controls_tabs(
			'button_style_tabs'
		);

		// Button Normal Tab
		$widget->start_controls_tab(
			'style_normal_tab',
			[
				'label' => esc_html__( 'Normal', 'banana-addons-for-elementor' ),
			]
		);

		$widget->add_group_control(
			Group_Control_Background::get_type(),
			[
				'name' => 'button_normal_background',
				'types' => [ 'classic' ],
				'exclude' => [ 'gradient', 'image', 'video' ],
				'selector' => ' .banae-timeline-block .banae-tl-content .banae-timeline-button',
			]
		);

		$widget->add_control(
			'button_normal_color',
			[
				'label' => esc_html__( 'Text Color', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}}  .banae-timeline-block .banae-tl-content .banae-timeline-button' => 'color: {{VALUE}}',
				],
			]
		);

		$widget->end_controls_tab();

		// Button Hover Tab
		$widget->start_controls_tab(
			'style_hover_tab',
			[
				'label' => esc_html__( 'Normal', 'banana-addons-for-elementor' ),
			]
		);

		$widget->add_group_control(
			Group_Control_Background::get_type(),
			[
				'name' => 'button_hover_background',
				'types' => [ 'classic' ],
				'exclude' => [ 'gradient', 'image', 'video' ],
				'selector' => '{{WRAPPER}} .banae-timeline-block .banae-tl-content .banae-timeline-button:hover',
			]
		);

		$widget->add_control(
			'button_hover_color',
			[
				'label' => esc_html__( 'Text Color', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .banae-timeline-block .banae-tl-content .banae-timeline-button:hover' => 'color: {{VALUE}}',
				],
			]
		);

		$widget->end_controls_tab();

		$widget->end_controls_tabs();


		$widget->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			[
				'name' => 'button_box_shadow',
				'selector' => '{{WRAPPER}} .banae-timeline-block .banae-tl-content .banae-timeline-button',
			]
		);

		$widget->add_control(
			'button_padding',
			[
				'label' => __( 'Padding', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', 'em', 'rem', '%' ],
				'default' => [
					'unit' => 'px',
					'isLinked' => false,
				],
				'selectors' => [
					'{{WRAPPER}} .banae-timeline-block .banae-tl-content .banae-timeline-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
				],
			]
		);

		$widget->add_control(
			'button_margin',
			[
				'label' => __( 'Margin', 'banana-addons-for-elementor' ),
				'type' => Controls_Manager::DIMENSIONS,
				'size_units' => [ 'px', 'em', 'rem', '%' ],
				'default' => [
					'unit' => 'px',
					'isLinked' => false,
				],
				'selectors' => [
					'{{WRAPPER}} .banae-timeline-block .banae-tl-content .banae-timeline-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
				],
			]
		);

		$widget->end_controls_section();
	}
}