<?php
namespace EcafeAddons\Widgets;

use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Utils;
use Elementor\Group_Control_Typography;
use Elementor\Core\Schemes\Typography;
use Elementor\Scheme_Color;
use Elementor\Group_Control_Background;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Text_Shadow;

use EcafeAddons\EcafeElementLoad;

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

class Ecafe_Countdown extends Widget_Base {

	public function get_name() {
		return 'ecafe-countdown';
	}

	public function get_title() {
		return esc_html__( 'Countdown', 'essential-classy-addons-for-elementor' );
	}

	public function get_icon() {
		return 'ecafe-ele-back-icon ecafe-countdown-icon';
	}

	public function get_categories() {
		return array( 'essential' );
	}


	public function get_keywords() {
		return array( 'countdown', 'count down', 'timer', 'sale', 'timer trek', 'deadline', 'live timer' );
	}

	public function get_script_depends() {
		return array( 'ecafe-countdown' );
	}
	public function get_custom_help_url() {
		return 'https://store.kapasias.com/helpdesk/';
	}
	public function has_widget_inner_wrapper(): bool {
		return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
	}
	protected function register_controls() {

		$this->start_controls_section(
			'contentSection',
			array(
				'label' => esc_html__( 'Countdown', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_CONTENT,
			)
		);
		$this->add_control(
			'layout',
			array(
				'label'   => esc_html__( 'Layout', 'essential-classy-addons-for-elementor' ),
				'type'    => Controls_Manager::SELECT,
				'default' => 'horizontal',
				'options' => array(
					'vertical'   => esc_html__( 'Vertical', 'essential-classy-addons-for-elementor' ),
					'horizontal' => esc_html__( 'Horizontal', 'essential-classy-addons-for-elementor' ),
				),
			)
		);
		$this->add_control(
			'type',
			array(
				'label'   => esc_html__( 'Type', 'essential-classy-addons-for-elementor' ),
				'type'    => Controls_Manager::SELECT,
				'default' => 'default',
				'options' => array(
					'default' => esc_html__( 'Default', 'essential-classy-addons-for-elementor' ),
					'inline'  => esc_html__( 'Inline', 'essential-classy-addons-for-elementor' ),
				),
			)
		);
		$this->add_control(
			'date',
			array(
				'label'       => esc_html__( 'Date', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::TEXTAREA,
				'default'     => esc_html__( '2025, 11 ,31, 23, 59, 00', 'essential-classy-addons-for-elementor' ),
				'placeholder' => esc_html__( 'year, month, day, hours, minutes, seconds', 'essential-classy-addons-for-elementor' ),
				'dynamic'     => array( 'active' => true ),
			)
		);
		$this->add_control(
			'dateNote',
			array(
				'label'           => esc_html__( 'Note', 'essential-classy-addons-for-elementor' ),
				'type'            => Controls_Manager::RAW_HTML,
				'raw'             => '<br/><br/>year, month, day, hours, minutes, seconds<br/><br/>6 numbers specify year, month, day, hour, minute and second<br/><br/>
				JavaScript counts months from 0 to 11<br/><br/>January = 0<br/><br/>December = 11',
				'content_classes' => 'ec-description-note',
			)
		);

		$this->add_control(
			'labelSwitch',
			array(
				'label'        => esc_html__( 'Label', 'essential-classy-addons-for-elementor' ),
				'type'         => Controls_Manager::SWITCHER,
				'label_on'     => esc_html__( 'Enable', 'essential-classy-addons-for-elementor' ),
				'label_off'    => esc_html__( 'Disable', 'essential-classy-addons-for-elementor' ),
				'return_value' => 'yes',
				'default'      => 'yes',
				'separator'    => 'before',
			)
		);
		$this->add_control(
			'labelDays',
			array(
				'label'       => esc_html__( 'Days', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::TEXT,
				'default'     => esc_html__( 'days', 'essential-classy-addons-for-elementor' ),
				'placeholder' => esc_html__( 'Enter days', 'essential-classy-addons-for-elementor' ),
				'dynamic'     => array( 'active' => true ),
				'condition'   => array(
					'labelSwitch' => 'yes',
				),
			)
		);
		$this->add_control(
			'labelHours',
			array(
				'label'       => esc_html__( 'Hours', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::TEXT,
				'default'     => esc_html__( 'hours', 'essential-classy-addons-for-elementor' ),
				'placeholder' => esc_html__( 'Enter hours', 'essential-classy-addons-for-elementor' ),
				'dynamic'     => array( 'active' => true ),
				'condition'   => array(
					'labelSwitch' => 'yes',
				),
			)
		);
		$this->add_control(
			'labelMinutes',
			array(
				'label'       => esc_html__( 'Minutes', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::TEXT,
				'default'     => esc_html__( 'minutes', 'essential-classy-addons-for-elementor' ),
				'placeholder' => esc_html__( 'Enter minutes', 'essential-classy-addons-for-elementor' ),
				'dynamic'     => array( 'active' => true ),
				'condition'   => array(
					'labelSwitch' => 'yes',
				),
			)
		);
		$this->add_control(
			'labelSeconds',
			array(
				'label'       => esc_html__( 'Seconds', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::TEXT,
				'default'     => esc_html__( 'seconds', 'essential-classy-addons-for-elementor' ),
				'placeholder' => esc_html__( 'Enter seconds', 'essential-classy-addons-for-elementor' ),
				'dynamic'     => array( 'active' => true ),
				'condition'   => array(
					'labelSwitch' => 'yes',
				),
			)
		);
		$this->end_controls_section();

		$this->start_controls_section(
			'headingSection',
			array(
				'label' => esc_html__( 'Heading', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_CONTENT,
			)
		);
		$this->add_control(
			'headingTitle',
			array(
				'label'       => esc_html__( 'Title', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::TEXT,
				'dynamic'     => array( 'active' => true ),
				'default'     => esc_html__( 'Happy New Year', 'essential-classy-addons-for-elementor' ),
				'placeholder' => esc_html__( 'Enter Title', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'headingTitleTag',
			array(
				'label'   => esc_html__( 'Tag', 'essential-classy-addons-for-elementor' ),
				'type'    => Controls_Manager::SELECT,
				'default' => 'h1',
				'options' => \EcafeHelper::getHtmlTag(),
			)
		);
		$this->end_controls_section();

		$this->start_controls_section(
			'descriptionSection',
			array(
				'label' => esc_html__( 'Description', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_CONTENT,
			)
		);
		$this->add_control(
			'description',
			array(
				'label'       => esc_html__( 'Description', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::TEXTAREA,
				'dynamic'     => array( 'active' => true ),
				'default'     => esc_html__( 'Just another sale of the year', 'essential-classy-addons-for-elementor' ),
				'placeholder' => esc_html__( 'Enter description', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->end_controls_section();

		$this->start_controls_section(
			'expireSection',
			array(
				'label' => esc_html__( 'After Expire Message', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_CONTENT,
			)
		);
		$this->add_control(
			'expireMsg',
			array(
				'label'       => esc_html__( 'Message', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::TEXTAREA,
				'dynamic'     => array( 'active' => true ),
				'default'     => '<h1>Countdown Has Expired</h1>',
				'placeholder' => esc_html__( 'Enter Expired Message', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->end_controls_section();

		/*Tilt Effect Options*/
		include ECAFE_PATH . 'element/widgets/ecafe-tilt-options.php';

		/*Tippy Tooltip Options*/
		include ECAFE_PATH . 'element/widgets/ecafe-tippy-options.php';

		/*Notice panel*/
		$ecwidgetdemolink = esc_url( 'https://ecaddons.com/elements/countdown/' );
		$ecwidgetdoclink  = esc_url( 'https://ecaddons.com/docs/countdown-widget-tutorial/' );
		include ECAFE_PATH . 'element/widgets/ecafe-widgetpanel-help.php';

		/* style start*/
		$this->start_controls_section(
			'daysStyling',
			array(
				'label' => esc_html__( 'Days', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_control(
			'hideDays',
			array(
				'label'        => esc_html__( 'Days', 'essential-classy-addons-for-elementor' ),
				'type'         => Controls_Manager::SWITCHER,
				'label_on'     => esc_html__( 'Enable', 'essential-classy-addons-for-elementor' ),
				'label_off'    => esc_html__( 'Disable', 'essential-classy-addons-for-elementor' ),
				'return_value' => 'yes',
				'default'      => 'yes',
				'selectors'    => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner li:nth-child(1)' => 'display: flex;',
				),
			)
		);
		$this->add_control(
			'daystAlign',
			array(
				'label'       => esc_html__( 'Alignment', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::CHOOSE,
				'options'     => array(
					'left'   => array(
						'title' => esc_html__( 'Left', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-left',
					),
					'center' => array(
						'title' => esc_html__( 'Center', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-center',
					),
					'right'  => array(
						'title' => esc_html__( 'Right', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-right',
					),
				),
				'selectors'   => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li > div:nth-child(1)' => 'text-align: {{VALUE}};',
				),
				'default'     => 'left',
				'label_block' => false,
			)
		);
		$this->add_control(
			'daysDigitHeading',
			array(
				'label' => esc_html__( 'Digit', 'essential-classy-addons-for-elementor' ),
				'type'  => Controls_Manager::HEADING,
			)
		);
		$this->add_responsive_control(
			'ddPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li > div:nth-child(1)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'ddMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li > div:nth-child(1)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'ddTypography',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li > div:nth-child(1)',
			)
		);
		$this->add_control(
			'ddColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li > div:nth-child(1)' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'ddTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li > div:nth-child(1)',
			)
		);
		$this->add_control(
			'daysLabelHeading',
			array(
				'label'     => esc_html__( 'Label', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_responsive_control(
			'dlPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li > div:nth-child(2)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'dlMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li > div:nth-child(2)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'dlTypography',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li > div:nth-child(2)',
			)
		);
		$this->add_control(
			'dlColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li > div:nth-child(2)' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'dlTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li > div:nth-child(2)',
			)
		);
		$this->add_control(
			'daysBoxHeading',
			array(
				'label'     => esc_html__( 'Box', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_responsive_control(
			'dbPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'dbMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'dbBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner li',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'dbBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner li',
			)
		);
		$this->add_responsive_control(
			'dbBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'dbShadow',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner li',
			)
		);
		$this->end_controls_section();
		/*day style start*/

		/*hours style start*/
		$this->start_controls_section(
			'hoursStyling',
			array(
				'label' => esc_html__( 'Hours', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_control(
			'hoursDigitHeading',
			array(
				'label' => esc_html__( 'Digit', 'essential-classy-addons-for-elementor' ),
				'type'  => Controls_Manager::HEADING,
			)
		);
		$this->add_responsive_control(
			'hdPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2) > div:nth-child(1)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'hdMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2) > div:nth-child(1)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'hdTypography',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2) > div:nth-child(1)',
			)
		);
		$this->add_control(
			'hdColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2) > div:nth-child(1)' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'hdTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2) > div:nth-child(1)',
			)
		);
		$this->add_control(
			'hoursLabelHeading',
			array(
				'label'     => esc_html__( 'Label', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_responsive_control(
			'hlPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2) > div:nth-child(2)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'hlMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2) > div:nth-child(2)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'hlTypography',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2) > div:nth-child(2)',
			)
		);
		$this->add_control(
			'hlColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2) > div:nth-child(2)' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'hlTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2) > div:nth-child(2)',
			)
		);
		$this->add_control(
			'hoursBoxHeading',
			array(
				'label'     => esc_html__( 'Box', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_responsive_control(
			'hbPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'hbMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'hbBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2)',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'hbBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2)',
			)
		);
		$this->add_responsive_control(
			'hbBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'hbShadow',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(2)',
			)
		);
		$this->end_controls_section();
		/*hours style start*/

		/*minutes style start*/
		$this->start_controls_section(
			'minutesStyling',
			array(
				'label' => esc_html__( 'Minutes', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_control(
			'minutesDigitHeading',
			array(
				'label' => esc_html__( 'Digit', 'essential-classy-addons-for-elementor' ),
				'type'  => Controls_Manager::HEADING,
			)
		);
		$this->add_responsive_control(
			'mdPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3) > div:nth-child(1)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'mdMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3) > div:nth-child(1)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'mdTypography',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3) > div:nth-child(1)',
			)
		);
		$this->add_control(
			'mdColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3) > div:nth-child(1)' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'mdTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3) > div:nth-child(1)',
			)
		);
		$this->add_control(
			'minutesLabelHeading',
			array(
				'label'     => esc_html__( 'Label', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_responsive_control(
			'mlPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3) > div:nth-child(2)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'mlMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3) > div:nth-child(2)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'mlTypography',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3) > div:nth-child(2)',
			)
		);
		$this->add_control(
			'mlColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3) > div:nth-child(2)' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'mlTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3) > div:nth-child(2)',
			)
		);
		$this->add_control(
			'minutesBoxHeading',
			array(
				'label'     => esc_html__( 'Box', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_responsive_control(
			'mbPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'mbMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'mbBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3)',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'mbBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3)',
			)
		);
		$this->add_responsive_control(
			'mbBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'mbShadow',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(3)',
			)
		);
		$this->end_controls_section();
		/*minutes style start*/

		/*seconds style start*/
		$this->start_controls_section(
			'secondsStyling',
			array(
				'label' => esc_html__( 'Seconds', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_control(
			'secondsDigitHeading',
			array(
				'label' => esc_html__( 'Digit', 'essential-classy-addons-for-elementor' ),
				'type'  => Controls_Manager::HEADING,
			)
		);
		$this->add_responsive_control(
			'sdPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4) > div:nth-child(1)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'sdMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4) > div:nth-child(1)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'sdTypography',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4) > div:nth-child(1)',
			)
		);
		$this->add_control(
			'sdColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4) > div:nth-child(1)' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'sdTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4) > div:nth-child(1)',
			)
		);
		$this->add_control(
			'secondsLabelHeading',
			array(
				'label'     => esc_html__( 'Label', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_responsive_control(
			'slPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4) > div:nth-child(2)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'slMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4) > div:nth-child(2)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'slTypography',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4) > div:nth-child(2)',
			)
		);
		$this->add_control(
			'slColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4) > div:nth-child(2)' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'slTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4) > div:nth-child(2)',
			)
		);
		$this->add_control(
			'secondsBoxHeading',
			array(
				'label'     => esc_html__( 'Box', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_responsive_control(
			'sbPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'sbMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'sbBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4)',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'sbBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4)',
			)
		);
		$this->add_responsive_control(
			'sbBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'sbShadow',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner > li:nth-child(4)',
			)
		);
		$this->end_controls_section();
		/*seconds style start*/

		/*counterbox style start*/
		$this->start_controls_section(
			'counterboxStyling',
			array(
				'label' => esc_html__( 'Counter Box', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'cbPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'cbMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'cbBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'cbBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner',
			)
		);
		$this->add_responsive_control(
			'cbBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'cbShadow',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main ul.ec-countdown-inner',
			)
		);
		$this->end_controls_section();
		/*counterbox style start*/

		/*heading style start*/
		$this->start_controls_section(
			'headingStyling',
			array(
				'label' => esc_html__( 'Heading', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'hPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-heading' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'hMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-heading' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'hTypo',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-heading',
			)
		);
		$this->add_control(
			'hAlign',
			array(
				'label'       => esc_html__( 'Alignment', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::CHOOSE,
				'options'     => array(
					'left'   => array(
						'title' => esc_html__( 'Left', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-left',
					),
					'center' => array(
						'title' => esc_html__( 'Center', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-center',
					),
					'right'  => array(
						'title' => esc_html__( 'Right', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-right',
					),
				),
				'selectors'   => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-heading' => 'text-align: {{VALUE}};',
				),
				'default'     => 'center',
				'label_block' => false,
			)
		);
		$this->add_control(
			'hColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-heading' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'hBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-heading',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'hBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-heading',
			)
		);
		$this->add_responsive_control(
			'hBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-heading' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'hTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-heading',
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'hShadow',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-heading',
			)
		);
		$this->end_controls_section();
		/*heading style start*/

		/*description style start*/
		$this->start_controls_section(
			'descriptionStyling',
			array(
				'label' => esc_html__( 'Description', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'dPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'dMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'dTypo',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-description',
			)
		);
		$this->add_control(
			'dAlign',
			array(
				'label'       => esc_html__( 'Alignment', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::CHOOSE,
				'options'     => array(
					'left'    => array(
						'title' => esc_html__( 'Left', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-left',
					),
					'center'  => array(
						'title' => esc_html__( 'Center', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-center',
					),
					'right'   => array(
						'title' => esc_html__( 'Right', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-right',
					),
					'justify' => array(
						'title' => esc_html__( 'Justify', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-h-align-stretch',
					),
				),
				'selectors'   => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-description' => 'text-align: {{VALUE}};',
				),
				'default'     => 'center',
				'label_block' => false,
			)
		);
		$this->add_control(
			'dColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-description' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'dBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-description',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'dBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-description',
			)
		);
		$this->add_responsive_control(
			'dBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-description' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'dTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-description',
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'dShadow',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main .ec-countdown-description',
			)
		);
		$this->end_controls_section();
		/*description style start*/

		/*box style start*/
		$this->start_controls_section(
			'boxStyling',
			array(
				'label' => esc_html__( 'Box', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'bPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'bMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'bBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'bBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main',
			)
		);
		$this->add_responsive_control(
			'bBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-countdown-wrapper-main' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'bShadow',
				'selector' => '{{WRAPPER}} .ec-countdown-wrapper-main',
			)
		);
		$this->end_controls_section();
		/*box style start*/
	}

	protected function render() {
		$settings = $this->get_settings_for_display();
		$daysHtml = $hoursHtml = $minutesHtml = $secondHtml = '';
		if ( isset( $settings['labelSwitch'] ) && $settings['labelSwitch'] == 'yes' ) {
			$labelDays    = ! empty( $settings['labelDays'] ) ? $settings['labelDays'] : '';
			$labelHours   = ! empty( $settings['labelHours'] ) ? $settings['labelHours'] : '';
			$labelMinutes = ! empty( $settings['labelMinutes'] ) ? $settings['labelMinutes'] : '';
			$labelSeconds = ! empty( $settings['labelSeconds'] ) ? $settings['labelSeconds'] : '';

			if ( ! empty( $labelDays ) ) {
				$daysHtml = '<div>' . esc_attr( $labelDays ) . '</div>';
			}

			if ( ! empty( $labelHours ) ) {
				$hoursHtml = '<div>' . esc_attr( $labelHours ) . '</div>';
			}

			if ( ! empty( $labelMinutes ) ) {
				$minutesHtml = '<div>' . esc_attr( $labelMinutes ) . '</div>';
			}

			if ( ! empty( $labelSeconds ) ) {
				$secondHtml = '<div>' . esc_attr( $labelSeconds ) . '</div>';
			}
		}

		$headingHtml  = '';
		$headingTitle = ! empty( $settings['headingTitle'] ) ? $settings['headingTitle'] : '';
		if ( ! empty( $headingTitle ) ) {
			$headingTitleTag = ! empty( $settings['headingTitleTag'] ) ? $settings['headingTitleTag'] : 'h1';
			$headingHtml     = '<' . \EcafeHelper::check_and_validate_html_tag( $headingTitleTag ) . ' class="ec-countdown-heading">' . esc_attr( $headingTitle ) . '</' . \EcafeHelper::check_and_validate_html_tag( $headingTitleTag ) . '>';
		}

		$descriptionHtml = '';
		$description     = ! empty( $settings['description'] ) ? $settings['description'] : '';
		if ( ! empty( $description ) ) {
			$descriptionHtml = '<div class="ec-countdown-description">' . wp_kses_post( $description ) . '</div>';
		}

		$date      = ! empty( $settings['date'] ) ? $settings['date'] : '';
		$expireMsg = ! empty( $settings['expireMsg'] ) ? $settings['expireMsg'] : '';

		$attr = '';
		if ( ! empty( $date ) ) {
			$attr .= ' data-date="' . esc_attr( $date ) . '"';
		}

		if ( ! empty( $expireMsg ) ) {
			$attr .= ' data-expire="' . wp_kses_post( $expireMsg ) . '"';
		}

		$layout = ! empty( $settings['layout'] ) ? $settings['layout'] : 'horizontal';
		$type   = ! empty( $settings['type'] ) ? $settings['type'] : 'default';

		$tiltclass  = '';
		$tiltrender = '';
		if ( isset( $settings['tiltEffect'] ) && $settings['tiltEffect'] === 'yes' ) {
			/*Tilt Effect Render*/
			include ECAFE_PATH . 'element/widgets/ecafe-tilt-render.php';
		}
		$tippyclass  = '';
		$tippyrender = '';
		if ( isset( $settings['tippyTooltip'] ) && $settings['tippyTooltip'] === 'yes' ) {
			/*Tippy Tooltip Render*/
			include ECAFE_PATH . 'element/widgets/ecafe-tippy-render.php';
		}
		?>
		
		<div class="ec-countdown-wrapper-main ec-countdown-<?php echo esc_attr( $layout ); ?> ec-countdown-<?php echo esc_attr( $type ); ?> <?php echo esc_attr( $tiltclass ); ?> <?php echo esc_attr( $tippyclass ); ?>" <?php echo $attr; ?> <?php echo $tiltrender; ?> <?php echo $tippyrender; ?>>			
			<?php echo $headingHtml; ?>
			<ul class="ec-countdown-inner">
				<li><div id="ec-cd-day">00</div><?php echo $daysHtml; ?></li>
				<li><div id="ec-cd-hours">00</div><?php echo $hoursHtml; ?></li>
				<li><div id="ec-cd-minutes">00</div><?php echo $minutesHtml; ?></li>
				<li><div id="ec-cd-seconds">00</div><?php echo $secondHtml; ?></li>
			</ul>
			<?php echo $descriptionHtml; ?>
		</div>
		<?php
	}
}
