<?php
namespace ThemeAtelier\EventfulForElementor\Admin\Widgets\Options;

use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
use Elementor\Core\Kits\Documents\Tabs\Global_Typography;

class EventfulForElementorStylePagination
{
    public static function ppfe_style_pagination($widget)
    {
        $widget->start_controls_section(
            'section_grid_pagination',
            [
                'label' => esc_html__('Pagination', 'eventful-for-elementor'),
                'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
                'condition' => [
                    'show_post_pagination' => 'yes',
                ],
            ]
        );

        $widget->start_controls_tabs('grid_pagination_color_style');

        // Normal tab.
        $widget->start_controls_tab(
            'grid_pagination_normal',
            array(
                'label' => esc_html__('Normal', 'eventful-for-elementor'),
            )
        );

        // Social share color.
        $widget->add_control(
            'grid_pagination_color',
            [
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Color', 'eventful-for-elementor'),
                'default' => '#222222',
                'selectors' => [
                    '{{WRAPPER}} .efpe-post-pagination a' => 'color: {{VALUE}};',
                    '{{WRAPPER}} .efpe-load-more button' => 'color: {{VALUE}};',
                ],
            ]
        );

        // Social share background color.
        $widget->add_control(
            'grid_pagination_background_color',
            [
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Background Color', 'eventful-for-elementor'),
                'default' => '#ffffff',
                'selectors' => [
                    '{{WRAPPER}} .efpe-post-pagination a.active' => 'background-color: {{VALUE}};',
                    '{{WRAPPER}} .efpe-load-more button' => 'background-color: {{VALUE}};',
                ],
            ]
        );

        // Social share border color.
        $widget->add_control(
            'grid_pagination_border_color',
            [
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Border Color', 'eventful-for-elementor'),
                'default' => '#222222',
                'selectors' => [
                    '{{WRAPPER}} .efpe-post-pagination a' => 'border-color: {{VALUE}};',
                    '{{WRAPPER}} .efpe-load-more button' => 'border-color: {{VALUE}};',
                ],
            ]
        );

        $widget->end_controls_tab();

        // Hover tab.
        $widget->start_controls_tab(
            'grid_pagination_color_hover_tab',
            array(
                'label' => esc_html__('Hover', 'eventful-for-elementor'),
            )
        );

        // Social share hover color.
        $widget->add_control(
            'grid_pagination_hover_color',
            array(
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Color', 'eventful-for-elementor'),
                'default' => '#ffffff',
                'selectors' => array(
                    '{{WRAPPER}} .efpe-post-pagination a:hover' => 'color: {{VALUE}};',
                    '{{WRAPPER}} .efpe-load-more button:hover' => 'color: {{VALUE}};',
                ),
            )
        );

        // Social share hover background color.
        $widget->add_control(
            'grid_pagination_hover_background_color',
            [
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Background Color', 'eventful-for-elementor'),
                'default' => '#222222',
                'selectors' => [
                    '{{WRAPPER}} .efpe-post-pagination a:hover' => 'background-color: {{VALUE}};',
                    '{{WRAPPER}} .efpe-load-more button:hover' => 'background-color: {{VALUE}};',
                ],
            ]
        );

        // Social share hover border color.
        $widget->add_control(
            'grid_pagination_hover_border_color',
            [
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Border Color', 'eventful-for-elementor'),
                'selectors' => [
                    '{{WRAPPER}} .efpe-post-pagination a:hover' => 'border-color: {{VALUE}};',
                    '{{WRAPPER}} .efpe-load-more button:hover' => 'border-color: {{VALUE}};',
                ],
            ]
        );

        $widget->end_controls_tab();

        $widget->end_controls_tabs();

        // Social share border width.
        $widget->add_control(
            'grid_pagination_border_width',
            [
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'label'      => esc_html__('Border Width', 'eventful-for-elementor'),
                'separator'  => 'before',
                'size_units' => array('px'),
                'selectors'  => [
                    '{{WRAPPER}} .efpe-post-pagination a' => 'border-style: solid; border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
                    '{{WRAPPER}} .efpe-load-more button' => 'border-style: solid; border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
                ],
            ]
        );

        // Social share border radius.
        $widget->add_control(
            'grid_pagination_border_radius',
            array(
                'label'     => esc_html__('Border Radius', 'eventful-for-elementor'),
                'type'      => \Elementor\Controls_Manager::SLIDER,
                'default'   => array(
                    'size' => 0,
                ),
                'range'     => array(
                    'px' => array(
                        'min' => 0,
                        'max' => 100,
                    ),
                ),
                'selectors' => array(
                    '{{WRAPPER}} .efpe-post-pagination a' => 'border-radius: {{SIZE}}{{UNIT}}',
                    '{{WRAPPER}} .efpe-load-more button' => 'border-radius: {{SIZE}}{{UNIT}}',
                ),
            )
        );

        // Social share margin.
        $widget->add_responsive_control(
            'grid_pagination_margin',
            [
                'label'      => esc_html__('Margin', 'eventful-for-elementor'),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => ['px'],
                'selectors'  => [
                    '{{WRAPPER}} .efpe-post-pagination a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    '{{WRAPPER}} .efpe-load-more button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $widget->end_controls_section();
    }
}
