<?php
namespace EcafeAddons\Widgets;

use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Typography;
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_Post_Navigation extends Widget_Base {

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

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

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

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

	public function get_keywords() {
		return array( 'post', 'post navigation', 'next', 'previous', 'post next previous' );
	}

	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__( 'Post Navigation', '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' => 'layout1',
				'options' => array(
					'layout1' => esc_html__( 'Layout 1', 'essential-classy-addons-for-elementor' ),
					'layout2' => esc_html__( 'Layout 2', 'essential-classy-addons-for-elementor' ),
					'layout3' => esc_html__( 'Layout 3', 'essential-classy-addons-for-elementor' ),
					'layout4' => esc_html__( 'Layout 4', 'essential-classy-addons-for-elementor' ),
					'layout5' => esc_html__( 'Layout 5', 'essential-classy-addons-for-elementor' ),
					'layout6' => esc_html__( 'Layout 6', 'essential-classy-addons-for-elementor' ),
					'layout7' => esc_html__( 'Layout 7', 'essential-classy-addons-for-elementor' ),
				),
			)
		);
		$this->add_control(
			'postSpecific',
			array(
				'label'     => esc_html__( 'Specific', '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' ),
				'default'   => 'no',
			)
		);
		$this->add_control(
			'postSpecificTaxonomy',
			array(
				'label'     => esc_html__( 'Taxonomy', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::SELECT,
				'default'   => 'category',
				'options'   => \EcafeHelper::getTaxonomiesList(),
				'dynamic'   => array( 'active' => true ),
				'condition' => array(
					'postSpecific' => 'yes',
				),
			)
		);
		$this->add_control(
			'prevIcon',
			array(
				'label'     => esc_html__( 'Previous Icon', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::ICONS,
				'default'   => array(
					'value'   => 'fas fa-chevron-left',
					'library' => 'solid',
				),
				'condition' => array(
					'layout' => array( 'layout1', 'layout3', 'layout4', 'layout5' ),
				),
			)
		);
		$this->add_control(
			'prevText',
			array(
				'label'       => esc_html__( 'Previous', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::TEXT,
				'default'     => esc_html__( 'PREVIOUS', 'essential-classy-addons-for-elementor' ),
				'dynamic'     => array( 'active' => true ),
				'label_block' => true,
				'condition'   => array(
					'layout' => array( 'layout2', 'layout3', 'layout4', 'layout6', 'layout7' ),
				),
			)
		);
		$this->add_control(
			'nextIcon',
			array(
				'label'     => esc_html__( 'Next Icon', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::ICONS,
				'default'   => array(
					'value'   => 'fas fa-chevron-right',
					'library' => 'solid',
				),
				'condition' => array(
					'layout' => array( 'layout1', 'layout3', 'layout4', 'layout5' ),
				),
			)
		);
		$this->add_control(
			'nextText',
			array(
				'label'       => esc_html__( 'Next', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::TEXT,
				'default'     => esc_html__( 'NEXT', 'essential-classy-addons-for-elementor' ),
				'dynamic'     => array( 'active' => true ),
				'label_block' => true,
				'condition'   => array(
					'layout' => array( 'layout2', 'layout3', 'layout4', 'layout6', 'layout7' ),
				),
			)
		);
		$this->add_responsive_control(
			'boxHeight',
			array(
				'label'      => esc_html__( 'Height', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px', '%' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 500,
					),
					'%'  => array(
						'min'  => 1,
						'max'  => 100,
						'step' => 1,
					),
				),
				'condition'  => array(
					'layout' => 'layout7',
				),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper' => 'height:{{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->add_control(
			'justifyContent16',
			array(
				'label'     => esc_html__( 'Justify Content', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::SELECT,
				'default'   => 'space-between',
				'options'   => array(
					'space-between' => esc_html__( 'Space Between', 'essential-classy-addons-for-elementor' ),
					'space-around'  => esc_html__( 'Space Around', 'essential-classy-addons-for-elementor' ),
					'space-evenly'  => esc_html__( 'Space Evenly', 'essential-classy-addons-for-elementor' ),
					'flex-start'    => esc_html__( 'Start', 'essential-classy-addons-for-elementor' ),
					'center'        => esc_html__( 'Center', 'essential-classy-addons-for-elementor' ),
					'flex-end'      => esc_html__( 'End', 'essential-classy-addons-for-elementor' ),
				),
				'condition' => array(
					'layout!' => 'layout7',
				),
				'selectors' => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper' => 'justify-content : {{VALUE}};',
				),
			)
		);
		$this->end_controls_section();

		/*Notice panel*/
		$ecwidgetdoclink = esc_url( 'https://ecaddons.com/docs/post-navigation-blog-builder-tutorial/' );
		include ECAFE_PATH . 'element/widgets/ecafe-widgetpanel-help.php';

		/*icon start*/
		$this->start_controls_section(
			'iconStyling',
			array(
				'label'     => esc_html__( 'Icon', 'essential-classy-addons-for-elementor' ),
				'tab'       => Controls_Manager::TAB_STYLE,
				'condition' => array(
					'layout' => array( 'layout1', 'layout3', 'layout4', 'layout5' ),
				),
			)
		);
		$this->add_responsive_control(
			'iconAfterGap',
			array(
				'label'      => esc_html__( 'Gap', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px', '%' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 100,
					),
					'%'  => array(
						'min'  => 1,
						'max'  => 100,
						'step' => 1,
					),
				),
				'condition'  => array(
					'layout' => 'layout4',
				),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-4-inner' => 'margin: 0 {{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'iconPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'iconSize',
			array(
				'label'      => esc_html__( 'Size', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px', '%' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 200,
					),
					'%'  => array(
						'min'  => 1,
						'max'  => 100,
						'step' => 1,
					),
				),
				'default'    => array(
					'unit' => 'px',
					'size' => 20,
				),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-icon i' => 'font-size:{{SIZE}}{{UNIT}};',
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-icon svg' => 'width:{{SIZE}}{{UNIT}};height:{{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->start_controls_tabs( 'tabsIconStyle' );
		$this->start_controls_tab(
			'tabIconN',
			array(
				'label' => esc_html__( 'Normal', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'iconColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-icon i' => 'color: {{VALUE}};',
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-icon svg' => 'fill: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'iconBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-icon',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'iconBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-icon',
			)
		);
		$this->add_responsive_control(
			'iconBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'iconShadow',
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-icon',
			)
		);
		$this->end_controls_tab();
		$this->start_controls_tab(
			'tabIconHover',
			array(
				'label' => esc_html__( 'Hover', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'iconColorH',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-icon i' => 'color: {{VALUE}};',
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-icon svg' => 'fill: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'iconBgH',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-icon',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'iconBorderH',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-icon',
			)
		);
		$this->add_responsive_control(
			'iconBrH',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'iconShadowH',
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-icon',
			)
		);
		$this->end_controls_tab();
		$this->end_controls_tabs();
		$this->end_controls_section();
		/*icon end*/

		/*text start*/
		$this->start_controls_section(
			'textStyling',
			array(
				'label'     => esc_html__( 'Text', 'essential-classy-addons-for-elementor' ),
				'tab'       => Controls_Manager::TAB_STYLE,
				'condition' => array(
					'layout' => array( 'layout2', 'layout3', 'layout4', 'layout6', 'layout7' ),
				),
			)
		);
		$this->add_control(
			'textPrevAlign',
			array(
				'label'       => esc_html__( 'Prev. 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-post-navigation-wrapper .ec-post-link .ec-post-nav-text.ec-post-nav-prev-text' => 'text-align: {{VALUE}};',
				),
				'condition'   => array(
					'layout!' => 'layout7',
				),
				'label_block' => false,
			)
		);
		$this->add_control(
			'textNextAlign',
			array(
				'label'       => esc_html__( 'Next 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-post-navigation-wrapper .ec-post-link .ec-post-nav-text.ec-post-nav-next-text' => 'text-align: {{VALUE}};',
				),
				'condition'   => array(
					'layout!' => 'layout7',
				),
				'label_block' => false,
			)
		);
		$this->add_responsive_control(
			'textMinWidth',
			array(
				'label'      => esc_html__( 'Min. Width', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px', '%' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 500,
					),
					'%'  => array(
						'min'  => 1,
						'max'  => 100,
						'step' => 1,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-text' => 'min-width:{{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'textPrevMargin',
			array(
				'label'      => esc_html__( 'Prev. Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px', '%' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 50,
					),
					'%'  => array(
						'min'  => 1,
						'max'  => 100,
						'step' => 1,
					),
				),
				'condition'  => array(
					'layout' => 'layout3',
				),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link.ec-post-link-prev .ec-post-nav-text' => 'margin-left:{{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'textNextMargin',
			array(
				'label'      => esc_html__( 'Next Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px', '%' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 50,
					),
					'%'  => array(
						'min'  => 1,
						'max'  => 100,
						'step' => 1,
					),
				),
				'condition'  => array(
					'layout' => 'layout3',
				),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link.ec-post-link-next .ec-post-nav-text' => 'margin-right:{{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'text46Margin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'condition'  => array(
					'layout' => array( 'layout4', 'layout6' ),
				),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'textPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'textTypo',
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-text',
			)
		);
		$this->start_controls_tabs( 'tabsTextStyle' );
		$this->start_controls_tab(
			'tabTextN',
			array(
				'label' => esc_html__( 'Normal', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'textColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-text' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'textBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-text',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'textBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-text',
			)
		);
		$this->add_responsive_control(
			'textBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-text' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'textShadow',
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-text',
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'textTextShadow',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-text',
			)
		);
		$this->end_controls_tab();
		$this->start_controls_tab(
			'tabTextHover',
			array(
				'label' => esc_html__( 'Hover', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'textColorH',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-text' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'textBgH',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-text',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'textBorderH',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-text',
			)
		);
		$this->add_responsive_control(
			'textBrH',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-text' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'textShadowH',
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-text',
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'textTextShadowH',
				'label'    => esc_html__( 'Text Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-text',
			)
		);
		$this->end_controls_tab();
		$this->end_controls_tabs();
		$this->end_controls_section();
		/*text end*/

		/*title start*/
		$this->start_controls_section(
			'titleStyling',
			array(
				'label'     => esc_html__( 'Title', 'essential-classy-addons-for-elementor' ),
				'tab'       => Controls_Manager::TAB_STYLE,
				'condition' => array(
					'layout' => array( 'layout4', 'layout5', 'layout6', 'layout7' ),
				),
			)
		);
		$this->add_control(
			'titlePrevAlign',
			array(
				'label'       => esc_html__( 'Prev. 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-post-navigation-wrapper .ec-post-link.ec-post-link-prev .ec-post-nav-title' => 'text-align: {{VALUE}};',
				),
				'label_block' => false,
			)
		);
		$this->add_control(
			'titleNextAlign',
			array(
				'label'       => esc_html__( 'Next 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-post-navigation-wrapper .ec-post-link.ec-post-link-next .ec-post-nav-title' => 'text-align: {{VALUE}};',
				),
				'label_block' => false,
			)
		);
		$this->add_responsive_control(
			'titleMinWidth',
			array(
				'label'      => esc_html__( 'Min. Width', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px', '%' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 500,
					),
					'%'  => array(
						'min'  => 1,
						'max'  => 100,
						'step' => 1,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-title' => 'min-width:{{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'title46Margin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'condition'  => array(
					'layout' => array( 'layout4', 'layout6' ),
				),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'titlePrevMargin',
			array(
				'label'      => esc_html__( 'Prev. Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px', '%' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 50,
					),
					'%'  => array(
						'min'  => 1,
						'max'  => 100,
						'step' => 1,
					),
				),
				'condition'  => array(
					'layout' => 'layout5',
				),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link.ec-post-link-prev .ec-post-nav-title' => 'margin-left:{{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'titleNextMargin',
			array(
				'label'      => esc_html__( 'Next Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px', '%' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 50,
					),
					'%'  => array(
						'min'  => 1,
						'max'  => 100,
						'step' => 1,
					),
				),
				'condition'  => array(
					'layout' => 'layout5',
				),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link.ec-post-link-next .ec-post-nav-title' => 'margin-right:{{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'titlePadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'titleTypo',
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-title',
			)
		);
		$this->start_controls_tabs( 'tabsTitleStyle' );
		$this->start_controls_tab(
			'tabTitleN',
			array(
				'label' => esc_html__( 'Normal', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'titleColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-title' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'titleBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-title',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'titleBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-title',
			)
		);
		$this->add_responsive_control(
			'titleBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-title' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'titleShadow',
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-title',
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'titleTextShadow',
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link .ec-post-nav-title',
			)
		);
		$this->end_controls_tab();
		$this->start_controls_tab(
			'tabTitleHover',
			array(
				'label' => esc_html__( 'Hover', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'titleColorH',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-title' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'titleBgH',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-title',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'titleBorderH',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-title',
			)
		);
		$this->add_responsive_control(
			'titleBrH',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-title' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'titleShadowH',
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-title',
			)
		);
		$this->add_group_control(
			Group_Control_Text_Shadow::get_type(),
			array(
				'name'     => 'titleTextShadowH',
				'label'    => esc_html__( 'title Shadow', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover .ec-post-nav-title',
			)
		);
		$this->end_controls_tab();
		$this->end_controls_tabs();
		$this->end_controls_section();
		/*title end*/

		/*image start*/
		$this->start_controls_section(
			'imageStyling',
			array(
				'label'     => esc_html__( 'Image', 'essential-classy-addons-for-elementor' ),
				'tab'       => Controls_Manager::TAB_STYLE,
				'condition' => array(
					'layout' => 'layout6',
				),
			)
		);
		$this->add_control(
			'imagePrevAlign',
			array(
				'label'       => esc_html__( 'Prev. Alignment', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::CHOOSE,
				'options'     => array(
					'flex-start' => 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',
					),
					'flex-end'   => array(
						'title' => esc_html__( 'Right', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-right',
					),
				),
				'selectors'   => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link.ec-post-link-prev' => 'align-items: {{VALUE}};',
				),
				'label_block' => false,
			)
		);
		$this->add_control(
			'imageNextAlign',
			array(
				'label'       => esc_html__( 'Next Alignment', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::CHOOSE,
				'options'     => array(
					'flex-start' => 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',
					),
					'flex-end'   => array(
						'title' => esc_html__( 'Right', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-right',
					),
				),
				'selectors'   => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link.ec-post-link-next' => 'align-items: {{VALUE}};',
				),
				'label_block' => false,
			)
		);
		$this->add_responsive_control(
			'imagePadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link img.ec-post-nav-thumb' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'imageMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link img.ec-post-nav-thumb' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'imageSize',
			array(
				'label'      => esc_html__( 'Size', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px', '%' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 500,
					),
					'%'  => array(
						'min'  => 1,
						'max'  => 100,
						'step' => 1,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link img.ec-post-nav-thumb' => 'width:{{SIZE}}{{UNIT}};',
				),
			)
		);

		$this->start_controls_tabs( 'tabsImageStyle' );
		$this->start_controls_tab(
			'tabImageN',
			array(
				'label' => esc_html__( 'Normal', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'imageBg',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link img.ec-post-nav-thumb',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'imageBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link img.ec-post-nav-thumb',
			)
		);
		$this->add_responsive_control(
			'imageBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link img.ec-post-nav-thumb' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'imageShadow',
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link img.ec-post-nav-thumb',
			)
		);
		$this->end_controls_tab();
		$this->start_controls_tab(
			'tabImageHover',
			array(
				'label' => esc_html__( 'Hover', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'imageBgH',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover img.ec-post-nav-thumb',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'imageBorderH',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover img.ec-post-nav-thumb',
			)
		);
		$this->add_responsive_control(
			'imageBrH',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover img.ec-post-nav-thumb' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'imageShadowH',
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper .ec-post-link:hover img.ec-post-nav-thumb',
			)
		);
		$this->end_controls_tab();
		$this->end_controls_tabs();
		$this->end_controls_section();
		/*image end*/

		/*box start*/
		$this->start_controls_section(
			'box7Styling',
			array(
				'label'     => esc_html__( 'Box', 'essential-classy-addons-for-elementor' ),
				'tab'       => Controls_Manager::TAB_STYLE,
				'condition' => array(
					'layout' => 'layout7',
				),
			)
		);
		$this->add_responsive_control(
			'box7Padding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper.layout7 .ec-post-link .ec-post-7-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->start_controls_tabs( 'tabsBox7Style' );
		$this->start_controls_tab(
			'tabBox7N',
			array(
				'label' => esc_html__( 'Normal', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'box7OverlayColor',
			array(
				'label'     => esc_html__( 'Overlay Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper.layout7 .ec-post-link .ec-post-7-inner:after' => 'background: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'box7Shadow',
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper.layout7 .ec-post-link .ec-post-7-inner',
			)
		);
		$this->end_controls_tab();
		$this->start_controls_tab(
			'tabBox7Hover',
			array(
				'label' => esc_html__( 'Hover', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'box7OverlayColorH',
			array(
				'label'     => esc_html__( 'Overlay Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper.layout7 .ec-post-link .ec-post-7-inner:hover:after' => 'background: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'box7ShadowH',
				'selector' => '{{WRAPPER}} .ec-post-navigation-wrapper.layout7 .ec-post-link .ec-post-7-inner:hover',
			)
		);
		$this->end_controls_tab();
		$this->end_controls_tabs();

		$this->add_control(
			'backgroundImageHeading',
			array(
				'label'     => esc_html__( 'Background Image', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);
		$this->add_responsive_control(
			'BgImgSize',
			array(
				'label'     => esc_html__( 'Background Size', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::SELECT,
				'default'   => 'cover',
				'options'   => array(
					'auto'    => esc_html__( 'Auto', 'essential-classy-addons-for-elementor' ),
					'cover'   => esc_html__( 'Cover', 'essential-classy-addons-for-elementor' ),
					'contain' => esc_html__( 'Contain', 'essential-classy-addons-for-elementor' ),
				),
				'selectors' => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper.layout7 .ec-post-link .ec-post-7-inner' => 'background-size: {{VALUE}};',
				),
			)
		);
		$this->add_responsive_control(
			'BgImgRepeat',
			array(
				'label'     => esc_html__( 'Background Repeat', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::SELECT,
				'default'   => 'no-repeat',
				'options'   => array(
					'no-repeat' => esc_html__( 'No-repeat', 'essential-classy-addons-for-elementor' ),
					'repeat'    => esc_html__( 'Repeat', 'essential-classy-addons-for-elementor' ),
					'repeat-x'  => esc_html__( 'Repeat-x', 'essential-classy-addons-for-elementor' ),
					'repeat-y'  => esc_html__( 'Repeat-y', 'essential-classy-addons-for-elementor' ),
				),
				'selectors' => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper.layout7 .ec-post-link .ec-post-7-inner' => 'background-repeat: {{VALUE}};',
				),
			)
		);
		$this->add_responsive_control(
			'BgImgPosition',
			array(
				'label'     => esc_html__( 'Background Position', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::SELECT,
				'default'   => 'center center',
				'options'   => array(
					'center center' => esc_html__( 'Center Center', 'essential-classy-addons-for-elementor' ),
					'center left'   => esc_html__( 'Center Left', 'essential-classy-addons-for-elementor' ),
					'center right'  => esc_html__( 'Center Right', 'essential-classy-addons-for-elementor' ),
					'top center'    => esc_html__( 'Top Center', 'essential-classy-addons-for-elementor' ),
					'top left'      => esc_html__( 'Top Left', 'essential-classy-addons-for-elementor' ),
					'top right'     => esc_html__( 'Top Right', 'essential-classy-addons-for-elementor' ),
					'bottom center' => esc_html__( 'Bottom Center', 'essential-classy-addons-for-elementor' ),
					'bottom left'   => esc_html__( 'Bottom Left', 'essential-classy-addons-for-elementor' ),
					'bottom right'  => esc_html__( 'Bottom Right', 'essential-classy-addons-for-elementor' ),
				),
				'selectors' => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper.layout7 .ec-post-link .ec-post-7-inner' => 'background-position: {{VALUE}};',
				),
			)
		);
		$this->add_responsive_control(
			'BgImgAttachment',
			array(
				'label'     => esc_html__( 'Background Attachment', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::SELECT,
				'default'   => 'scroll',
				'options'   => array(
					''       => esc_html__( 'None', 'essential-classy-addons-for-elementor' ),
					'scroll' => esc_html__( 'Scroll', 'essential-classy-addons-for-elementor' ),
					'fixed'  => esc_html__( 'Fixed', 'essential-classy-addons-for-elementor' ),
				),
				'selectors' => array(
					'{{WRAPPER}} .ec-post-navigation-wrapper.layout7 .ec-post-link .ec-post-7-inner' => 'background-attachment: {{VALUE}};',
				),
			)
		);
		$this->end_controls_section();
		/*box end*/
	}

	protected function render() {

		$settings = $this->get_settings_for_display();
		$output   = '';

		$layout = ! empty( $settings['layout'] ) ? $settings['layout'] : 'layout1';

		$prevPost     = get_previous_post();
		$nxtPost      = get_next_post();
		$postSpecific = ! empty( $settings['postSpecific'] ) ? $settings['postSpecific'] : 'no';
		if ( ! empty( $postSpecific ) && $postSpecific == 'yes' ) {
			$postSpecificTaxonomy = ! empty( $settings['postSpecificTaxonomy'] ) ? $settings['postSpecificTaxonomy'] : '';
			if ( ! empty( $postSpecificTaxonomy ) ) {
				$prevPost = get_previous_post( true, '', $postSpecificTaxonomy );
				$nxtPost  = get_next_post( true, '', $postSpecificTaxonomy );
			}
		}

		$prevText = ! empty( $settings['prevText'] ) ? esc_attr( $settings['prevText'] ) : '';
		$nextText = ! empty( $settings['nextText'] ) ? esc_attr( $settings['nextText'] ) : '';

		$prevIcon = $nextIcon = $prevTextSrc = $prevIconSrc = $prevThumbSrc = $nextTextSrc = $nextIconSrc = $nextThumbSrc = $prevPostContent = $nextPostContent = '';

		if ( ! empty( $prevPost ) ) {
			$prevTitle = '<div class="ec-post-nav-title ec-post-nav-title-prev">' . $prevPost->post_title . '</div>';

			if ( ! empty( $prevText ) ) {
				$prevTextSrc = '<div class="ec-post-nav-text ec-post-nav-prev-text">' . $prevText . '</div>';
			}
			if ( ! empty( $settings['prevIcon'] ) ) {
				ob_start();
				\Elementor\Icons_Manager::render_icon( $settings['prevIcon'], array( 'aria-hidden' => 'true' ) );
				$prevIcon = ob_get_contents();
				ob_end_clean();
			}
			if ( ! empty( $prevIcon ) ) {
				$prevIconSrc = '<div class="ec-post-nav-icon ec-post-nav-prev-icon">' . $prevIcon . '</div>';
			}

			$prevUrl = '';
			if ( has_post_thumbnail( $prevPost->ID ) ) {
				$prevUrl      = get_the_post_thumbnail_url( $prevPost->ID, 'full' );
				$prevThumbSrc = '<img src="' . esc_url( $prevUrl ) . '" alt="' . get_the_title() . '" class="ec-post-nav-thumb ec-post-nav-prev-thumb" />';
			}

			if ( ! empty( $layout ) ) {
				$prevPostContent .= '<a  class="ec-post-link ec-post-link-prev" href="' . esc_url( get_permalink( $prevPost->ID ) ) . '">';
				if ( $layout == 'layout1' ) {
					$prevPostContent .= $prevIconSrc;
				} elseif ( $layout == 'layout2' ) {
					$prevPostContent .= $prevTextSrc;
				} elseif ( $layout == 'layout3' ) {
					$prevPostContent .= $prevIconSrc . $prevTextSrc;
				} elseif ( $layout == 'layout4' ) {
					$prevPostContent .= $prevIconSrc;
					$prevPostContent .= '<div class="ec-post-4-inner">';
					$prevPostContent .= $prevTextSrc . $prevTitle;
					$prevPostContent .= '</div>';
				} elseif ( $layout == 'layout5' ) {
					$prevPostContent .= $prevIconSrc . $prevTitle;
				} elseif ( $layout == 'layout6' ) {
					$prevPostContent .= $prevThumbSrc;
					$prevPostContent .= '<div class="ec-post-6-inner">';
					$prevPostContent .= $prevTextSrc . $prevTitle;
					$prevPostContent .= '</div>';
				} elseif ( $layout == 'layout7' ) {
					$prevPostContent .= '<div class="ec-post-7-inner" style="background-image : url(' . $prevUrl . ')">' . $prevTextSrc . $prevTitle . '</div>';
				}
				$prevPostContent .= '</a>';
			}
		} else {
			$prevPostContent .= '<a  class="ec-post-link ec-post-link-prev"></a>';
		}

		if ( ! empty( $nxtPost ) ) {
			$nextTitle = '<div class="ec-post-nav-title ec-post-nav-title-next">' . $nxtPost->post_title . '</div>';

			if ( ! empty( $nextText ) ) {
				$nextTextSrc = '<div class="ec-post-nav-text ec-post-nav-next-text">' . $nextText . '</div>';
			}
			if ( ! empty( $settings['nextIcon'] ) ) {
				ob_start();
				\Elementor\Icons_Manager::render_icon( $settings['nextIcon'], array( 'aria-hidden' => 'true' ) );
				$nextIcon = ob_get_contents();
				ob_end_clean();
			}
			if ( ! empty( $nextIcon ) ) {
				$nextIconSrc = '<div class="ec-post-nav-icon ec-post-nav-next-icon">' . $nextIcon . '</div>';
			}

			$nextUrl = '';
			if ( has_post_thumbnail( $nxtPost->ID ) ) {
				$nextUrl      = get_the_post_thumbnail_url( $nxtPost->ID, 'full' );
				$nextThumbSrc = '<img src="' . esc_url( $nextUrl ) . '" alt="' . get_the_title() . '" class="ec-post-nav-thumb ec-post-nav-next-thumb" />';
			}

			if ( ! empty( $layout ) ) {
				$nextPostContent .= '<a class="ec-post-link ec-post-link-next" href="' . esc_url( get_permalink( $nxtPost->ID ) ) . '">';
				if ( $layout == 'layout1' ) {
					$nextPostContent .= $nextIconSrc;
				} elseif ( $layout == 'layout2' ) {
					$nextPostContent .= $nextTextSrc;
				} elseif ( $layout == 'layout3' ) {
					$nextPostContent .= $nextTextSrc . $nextIconSrc;
				} elseif ( $layout == 'layout4' ) {
					$nextPostContent .= '<div class="ec-post-4-inner">';
					$nextPostContent .= $nextTextSrc . $nextTitle;
					$nextPostContent .= '</div>';
					$nextPostContent .= $nextIconSrc;
				} elseif ( $layout == 'layout5' ) {
					$nextPostContent .= $nextTitle . $nextIconSrc;
				} elseif ( $layout == 'layout6' ) {
					$nextPostContent .= $nextThumbSrc;
					$nextPostContent .= '<div class="ec-post-6-inner">';
					$nextPostContent .= $nextTextSrc . $nextTitle;
					$nextPostContent .= '</div>';
				} elseif ( $layout == 'layout7' ) {
					$nextPostContent .= '<div class="ec-post-7-inner" style="background-image : url(' . $nextUrl . ')">' . $nextTextSrc . $nextTitle . '</div>';
				}
				$nextPostContent .= '</a>';
			}
		} else {
			$nextPostContent .= '<a  class="ec-post-link ec-post-link-next"></a>';
		}

		$output .= '<div class="ec-post-navigation-wrapper ' . esc_attr( $layout ) . '">' . $prevPostContent . $nextPostContent . '</div>';

		echo wp_kses_normalize_entities( $output );
	}
}
