<?php

//Label
$init->add_control(
	str_replace( ' ', '_', $label ) . '_subtitle_label',
	[ 
		'type' => \Elementor\Controls_Manager::HEADING,
		'label' => __( $label, 'ostech-addon' ),
		'separator' => 'after',
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_responsive_control(
	str_replace( ' ', '_', $label ) . '_padding',
	[ 
		'label' => __( 'Padding', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::DIMENSIONS,
		'size_units' => [ 'px', 'em', '%' ],
		'selectors' => [ 
			$selector => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
		],
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_group_control(
	\Elementor\Group_Control_Typography::get_type(),
	[ 
		'name' => str_replace( ' ', '_', $label ) . '_typography',
		'selector' => $selector,
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_group_control(
	\Elementor\Group_Control_Border::get_type(),
	[ 
		'name' => str_replace( ' ', '_', $label ) . '_border',
		'selector' => $selector,
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_control(
	str_replace( ' ', '_', $label ) . '_border_radius',
	[ 
		'label' => __( 'Border Radius', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::DIMENSIONS,
		'size_units' => [ 'px', '%' ],
		'selectors' => [ 
			$selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
		],
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_group_control(
	\Elementor\Group_Control_Box_Shadow::get_type(),
	[ 
		'name' => str_replace( ' ', '_', $label ) . '_box_shadow',
		'selector' => $selector,
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_control(
	str_replace( ' ', '_', $label ) . '_hr',
	[ 
		'type' => \Elementor\Controls_Manager::DIVIDER,
		'style' => 'thick',
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->start_controls_tabs( str_replace( ' ', '_', $label ) . '_tabs_button' );

$init->start_controls_tab(
	str_replace( ' ', '_', $label ) . '_tab_button_normal',
	[ 
		'label' => __( 'Normal', 'ostech-addon' ),
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_control(
	str_replace( ' ', '_', $label ) . '_color',
	[ 
		'label' => __( 'Text Color', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::COLOR,
		'default' => '',
		'selectors' => [ 
			$selector => 'color: {{VALUE}};',
		],
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_control(
	str_replace( ' ', '_', $label ) . '_bg_color',
	[ 
		'label' => __( 'Background Color', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::COLOR,
		'selectors' => [ 
			$selector => 'background-color: {{VALUE}};',
		],
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->end_controls_tab();

$init->start_controls_tab(
	str_replace( ' ', '_', $label ) . '_tab_button_hover',
	[ 
		'label' => __( 'Hover', 'ostech-addon' ),
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_control(
	str_replace( ' ', '_', $label ) . '_hover_color',
	[ 
		'label' => __( 'Text Color', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::COLOR,
		'selectors' => [ 
			$selector . ':hover,' . $selector . ':focus' => 'color: {{VALUE}};',
		],
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_control(
	str_replace( ' ', '_', $label ) . '_hover_bg_color',
	[ 
		'label' => __( 'Background Color', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::COLOR,
		'selectors' => [ 
			$hover_bg_selector => 'background-color: {{VALUE}};',
		],
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_control(
	str_replace( ' ', '_', $label ) . '_hover_border_color',
	[ 
		'label' => __( 'Border Color', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::COLOR,
		'condition' => [ 
			'button_border_border!' => '',
		],
		'selectors' => [ 
			$selector . ':hover,' . $selector . ':focus' => 'border-color: {{VALUE}};',
		],
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->end_controls_tab();
$init->end_controls_tabs();