<?php

namespace XIMSAPLUGIN\Element;

use Elementor\Controls_Manager;
use Elementor\Controls_Stack;
use Elementor\Group_Control_Typography;
use Elementor\Scheme_Typography;
use Elementor\Scheme_Color;
use Elementor\Group_Control_Border;
use Elementor\Repeater;
use Elementor\Widget_Base;
use Elementor\Utils;
use Elementor\Group_Control_Text_Shadow;
use Elementor\Plugin;

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

class fintech_payment extends Widget_Base {

	/**
	 * Get widget name.
	 *
	 * Retrieve Elementor widget name.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return string Widget name.
	 */
	public function get_name() {
		return 'fintech_payment';
	}

	/**
	 * Get widget title.
	 *
	 * Retrieve Elementor widget title.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return string Widget title.
	 */
	public function get_title() {
		return esc_html__( 'Fintech Payment', 'ximsa' );
	}

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

	/**
	 * Get widget categories.
	 *
	 * Retrieve the list of categories the Elementor widget belongs to.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return array Widget categories.
	 */
	public function get_categories() {
		return [ 'ximsa' ];
	}

	/**
	 * Register Elementor widget controls.
	 *
	 * Adds different input fields to allow the user to change and customize the widget settings.
	 *
	 * @since 1.0.0
	 * @access protected
	 */
	 
	
	protected function register_controls() {        
       
        $this->start_controls_section(
            'subscribe_info',
            [
                'label' => __( 'Subscribe Options', 'ximsa' ),
                'tab' => Controls_Manager::TAB_CONTENT,
            ]
        );
        
        $this->add_control(
			'title',
			[
				'label' => esc_html__( 'Title', 'ximsa' ),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'default' => [],
			]
		);
        $this->add_control(
			'description',
			[
				'label' => esc_html__( 'Description', 'ximsa' ),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'default' => [],
			]
		);
        $this->add_control(
			'payment_img',
			[
				'label' => esc_html__( 'Payment', 'ximsa' ),
				'type' => \Elementor\Controls_Manager::GALLERY,
				'default' => [],
			]
		);
        
		$this->end_controls_section();
        $this->start_controls_section(
            'subscribe_st',
            [
                'label' => __( 'Subscribe Settings', 'ximsa' ),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
        
        $this->add_control(
            'slider_title',
            [
                'type'      => Controls_Manager::HEADING,
                'label'     => esc_html__( 'Title Style', 'ximsa' ),
                'separator' => 'before',
            ]
        );
        
        $this->add_control(
            'sl_title_cl',
            [
                'label'     => esc_html__( 'Title Color', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .sec-title-four h2' => 'color: {{VALUE}} ',
                ],
            ]
        );
        $this->add_control(
            'sl_clr_title_cl',
            [
                'label'     => esc_html__( 'Colerd Title Color', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .sec-title-four h2 span' => 'color: {{VALUE}} ',
                ],
            ]
        );
        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name'           => 'sl_title_typography',
                'label'          => esc_html__( 'Typography', 'ximsa' ),
                'selector'       => '{{WRAPPER}} .sec-title-four h2',
                'fields_options' => [
                    'typography' => [
                        'default' => 'custom',
                    ],
                ],
            ]
        );
        $this->add_control(
            'desc_st',
            [
                'type'      => Controls_Manager::HEADING,
                'label'     => esc_html__( 'Description Style', 'ximsa' ),
                'separator' => 'before',
            ]
        );
        
        $this->add_control(
            'sl_desc_cl',
            [
                'label'     => esc_html__( 'Description Color', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .sec-title-four .text' => 'color: {{VALUE}} ',
                ],
            ]
        );
        $this->add_control(
            'sl_desc_title_cl',
            [
                'label'     => esc_html__( 'Colerd Desc Color', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .sec-title-four .text' => 'color: {{VALUE}} ',
                ],
            ]
        );
        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name'           => 'desc_title_typography',
                'label'          => esc_html__( 'Typography', 'ximsa' ),
                'selector'       => '{{WRAPPER}} .sec-title-four .text',
                'fields_options' => [
                    'typography' => [
                        'default' => 'custom',
                    ],
                ],
            ]
        );
        $this->end_controls_section();
	}
		


	protected function render() {
		
		
	$settings = $this->get_settings_for_display(); ?>
        <!-- Payments Section -->
        <section class="payments-section">
            <div class="bubble-dotted">
                <span class="dotted dotted-1"></span>
                <span class="dotted dotted-2"></span>
                <span class="dotted dotted-3"></span>
                <span class="dotted dotted-4"></span>
                <span class="dotted dotted-5"></span>
                <span class="dotted dotted-6"></span>
                <span class="dotted dotted-7"></span>
                <span class="dotted dotted-8"></span>
                <span class="dotted dotted-9"></span>
                <span class="dotted dotted-10"></span>
            </div>
            <div class="auto-container">
                <div class="sec-title-four centered">
                    <h2><?php echo wp_kses( $settings['title'], true )?></h2>
                    <div class="text"><?php echo wp_kses( $settings['description'], true )?></div>
                </div>
                <ul class="payment-options">
                    <?php foreach($settings['payment_img'] as $gall):?>
                    <li><img src="<?php echo esc_url($gall['url']);?>" alt="" /></li>
                    <?php endforeach;?>
                </ul>
            </div>
        </section>
        <!-- End Payments Section -->
    <?php  
    }
	
	

}

