<?php
/**
 * @package     productive-forms
 * @author      productiveminds.com
 * @copyright   productiveminds.com
 */


// Start:: Content
$this->start_controls_section(
    'section_content_layout',
    [
        'label' => esc_html__( 'Layout', 'productive-forms' ),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
    ]
);

$this->add_control(
    'display_email_field_only',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Email Field Only?', 'productive-forms' ),
        'options' => [
        ] + productive_global_get_yes_or_no_options(),
        'default' => '0',
    ]
);

$this->add_control(
    'productive_forms_newsletter_form_style',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Form Position', 'productive-forms' ),
        'options' => [
            'portrait' => esc_html__( 'Portrait', 'productive-forms' ),
            'landscape' => esc_html__( 'Landscape', 'productive-forms' ),
        ],
        'default' => 'landscape',
    ]
);

// Widget Container
$this->add_control(
    'section_style_each_widget_box_hr',
    [
        'type' => \Elementor\Controls_Manager::DIVIDER,
    ]
);
$this->add_control(
    'section_style_each_widget_box_hr_label',
    [
        'label' => esc_html__( 'Widget Container', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::RAW_HTML,
    ]
);

$this->add_responsive_control(
    'section_style_layout_width_content_box',
    [
        'label' => esc_html__( 'Width', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'px', '%' ],
        'range' => [
            'px' => [
                'min' => 100,
                'max' => 32000,
                'step' => 10,
            ],
            '%' => [
                'min' => 10,
                'max' => 100,
                'step' => 1,
            ],
        ],
        'default' => [
            'unit' => '%',
            'size' => 100,
        ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section .productiveminds_section_uno' => 'width: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'section_style_layout_max_width_content_box',
    [
        'label' => esc_html__( 'Max Width (px)', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'px' ],
        'range' => [
            'px' => [
                'min' => 100,
                'max' => 3000,
                'step' => 10,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section .productiveminds_section_uno' => 'max-width: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'section_content_layout_align_box',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Container Justification', 'productive-forms' ),
        'options' => [
        ] + productive_global_get_horizontal_css_align_options(),
        'default' => 'center',
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section' => 'justify-content: {{VALUE}}; justify-items: {{VALUE}}',
        ],
    ]
);

$this->end_controls_section();
// End:: Content




/**
 * 
 * Start:: Styles
 * 
 */
$this->start_controls_section(
    'section_style_layout',
    [
        'label' => esc_html__( 'Layout', 'productive-forms' ),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    ]
);

$this->add_responsive_control(
    'section_style_each_item_col_gap',
    [
        'label' => esc_html__( 'Column Gap', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'rem', 'px' ],
        'range' => [
            'rem' => [
                'min' => 0,
                'max' => 50,
                'step' => 1,
            ],
            'px' => [
                'min' => 0,
                'max' => 1000,
                'step' => 10,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section.newsletter-element .productive_forms_form_newsletter_form .productive-forms-box-grid-inputs-grid' => 'column-gap: {{SIZE}}{{UNIT}}',
            '{{WRAPPER}} .productiveminds_section.newsletter-element .productive_forms_form_newsletter_form .productive-forms-box-grid' => 'column-gap: {{SIZE}}{{UNIT}}',
        ],
        'condition' => [
            'productive_forms_newsletter_form_style' => [ 'landscape', ],
        ],
    ]
);

$this->add_responsive_control(
    'section_style_each_item_row_gap',
    [
        'label' => esc_html__( 'Row gap (smallscreen)', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'rem', 'px' ],
        'range' => [
            'rem' => [
                'min' => 0,
                'max' => 50,
                'step' => 1,
            ],
            'px' => [
                'min' => 0,
                'max' => 1000,
                'step' => 10,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section.newsletter-element .productive_forms_form_newsletter_form' => 'row-gap: {{SIZE}}{{UNIT}}',
        ],
        'condition' => [
            'productive_forms_newsletter_form_style' => [ 'portrait', ],
        ],
    ]
);

// End:: Content Title

$this->end_controls_section();
// End:: Styles