<?php
/**
 * Theme Colors Settings.
 *
 * @package pawfect
 */

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

/**
 * Theme Colors Settings.
 */
if ( ! class_exists( 'Pawfect_Options_Theme_Colors' ) ) :

    class Pawfect_Options_Theme_Colors extends pawfect_Customize_Base_Option {
        
        public function elements() {

            return array(

                // =======================================================
                // == THEME COLORS HEADING
                // =======================================================

                'pawfect_theme_colors_heading' => array(
                    'setting' => array(),
                    'control' => array(
                        'type'    => 'heading',
                        'priority' => 1,
                        'label'   => esc_html__( 'Theme Colors', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                // =======================================================
                // == COLOR PALETTE
                // =======================================================

                'pawfect_color_palette' => array(
                    'setting' => array(
                        'default' => 'warm',
                        'sanitize_callback' => 'sanitize_text_field',
                    ),
                    'control' => array(
                        'type' => 'pawfect-palette',
                        'priority' => 5,
                        'label' => esc_html__( 'Color Scheme', 'pawfect' ),
                        'description' => esc_html__( 'Choose a pre-defined color palette or select Custom to build your own.', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                        'choices' => array(
                            'warm' => array(
                                'label'  => esc_html__( 'Warm (Default)', 'pawfect' ),
                                'colors' => array( '#F4A259', '#313134', '#fef9f5', '#6B7280' ),
                            ),
                            'fresh' => array(
                                'label'  => esc_html__( 'Fresh (Light)', 'pawfect' ),
                                'colors' => array( '#000000', '#133827', '#ffffff', '#1F2937' ),
                            ),
                            'custom' => array(
                                'label'  => esc_html__( 'Custom', 'pawfect' ),
                                'colors' => array( '#e5e7eb', '#d1d5db', '#9ca3af', '#4b5563' ), // Placholder grays for 'custom' icon
                            ),
                        ),
                    ),
                ),

                // =======================================================
                // == PRIMARY COLORS
                // =======================================================

                'pawfect_primary_color' => array(
                    'setting' => array(
                        'default' => '#F4A259',
                        'sanitize_callback' => 'sanitize_hex_color',
                    ),
                    'control' => array(
                        'type' => 'color',
                        'priority' => 10,
                        'label' => esc_html__( 'Primary Color', 'pawfect' ),
                        'description' => esc_html__( 'Used for buttons, links, and accent elements', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                'pawfect_secondary_color' => array(
                    'setting' => array(
                        'default' => '#313134',
                        'sanitize_callback' => 'sanitize_hex_color',
                    ),
                    'control' => array(
                        'type' => 'color',
                        'priority' => 20,
                        'label' => esc_html__( 'Secondary Color', 'pawfect' ),
                        'description' => esc_html__( 'Used for dark text and footer backgrounds', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                'pawfect_background_color' => array(
                    'setting' => array(
                        'default' => '#fef9f5',
                        'sanitize_callback' => 'sanitize_hex_color',
                    ),
                    'control' => array(
                        'type' => 'color',
                        'priority' => 30,
                        'label' => esc_html__( 'Background Color', 'pawfect' ),
                        'description' => esc_html__( 'Main page background color', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                'pawfect_text_color' => array(
                    'setting' => array(
                        'default' => '#6B7280',
                        'sanitize_callback' => 'sanitize_hex_color',
                    ),
                    'control' => array(
                        'type' => 'color',
                        'priority' => 40,
                        'label' => esc_html__( 'Text Color', 'pawfect' ),
                        'description' => esc_html__( 'Default paragraph and body text color', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                // =======================================================
                // == HEADER COLORS (PREMIUM)
                // =======================================================

                'pawfect_header_colors_upgrade_notice' => array(
                    'setting' => array(),
                    'control' => array(
                        'type'     => 'heading',
                        'priority' => 49,
                        'label'    => esc_html__( '🔒 Advanced Header Colors', 'pawfect' ),
                        'description' => '<div style="background: #fff; border: 1px solid #c3c4c7; border-left: 4px solid #72aee6; padding: 10px 12px; margin: 10px 0;">
                            <p style="margin: 0; font-size: 13px; line-height: 1.5; color: #50575e;">' . sprintf(
                                /* translators: %1$s: opening link tag, %2$s: closing link tag */
                                esc_html__( 'Upgrade to %1$sPawfect Pro%2$s for unlimited advanced header color options and premium features!', 'pawfect' ),
                                '<a href="https://wpmatcha.com/wordpress-themes/pawfect/" target="_blank" style="color: #2271b1; text-decoration: none; font-weight: 500;">',
                                '</a>'
                            ) . '</p>
                        </div>',
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                'pawfect_header_colors_heading' => array(
                    'setting' => array(),
                    'control' => array(
                        'type'    => 'heading',
                        'priority' => 50,
                        'label'   => esc_html__( 'Header Colors', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                'pawfect_header_background_color' => array(
                    'setting' => array(
                        'default' => '#313134',
                        'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_alpha_color' ),
                    ),
                    'control' => array(
                        'type' => 'color',
                        'priority' => 60,
                        'label' => esc_html__( 'Header Background', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                'pawfect_header_text_color' => array(
                    'setting' => array(
                        'default' => '#ffffff',
                        'sanitize_callback' => 'sanitize_hex_color',
                    ),
                    'control' => array(
                        'type' => 'color',
                        'priority' => 70,
                        'label' => esc_html__( 'Header Text Color', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                // =======================================================
                // == FOOTER COLORS (PREMIUM)
                // =======================================================

                'pawfect_footer_colors_upgrade_notice' => array(
                    'setting' => array(),
                    'control' => array(
                        'type'     => 'heading',
                        'priority' => 79,
                        'label'    => esc_html__( '🔒 Advanced Footer Colors', 'pawfect' ),
                        'description' => '<div style="background: #fff; border: 1px solid #c3c4c7; border-left: 4px solid #72aee6; padding: 10px 12px; margin: 10px 0;">
                            <p style="margin: 0; font-size: 13px; line-height: 1.5; color: #50575e;">' . sprintf(
                                /* translators: %1$s: opening link tag, %2$s: closing link tag */
                                esc_html__( 'Upgrade to %1$sPawfect Pro%2$s for unlimited advanced footer color options and premium features!', 'pawfect' ),
                                '<a href="https://wpmatcha.com/wordpress-themes/pawfect/" target="_blank" style="color: #2271b1; text-decoration: none; font-weight: 500;">',
                                '</a>'
                            ) . '</p>
                        </div>',
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                'pawfect_footer_colors_heading' => array(
                    'setting' => array(),
                    'control' => array(
                        'type'    => 'heading',
                        'priority' => 80,
                        'label'   => esc_html__( 'Footer Colors', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                'pawfect_footer_background_color' => array(
                    'setting' => array(
                        'default' => '#313134',
                        'sanitize_callback' => 'sanitize_hex_color',
                    ),
                    'control' => array(
                        'type' => 'color',
                        'priority' => 90,
                        'label' => esc_html__( 'Footer Background', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                'pawfect_footer_text_color' => array(
                    'setting' => array(
                        'default' => '#ffffff',
                        'sanitize_callback' => 'sanitize_hex_color',
                    ),
                    'control' => array(
                        'type' => 'color',
                        'priority' => 100,
                        'label' => esc_html__( 'Footer Text Color', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                // =======================================================
                // == BUTTON STYLES
                // =======================================================

                'pawfect_button_styles_heading' => array(
                    'setting' => array(),
                    'control' => array(
                        'type'    => 'heading',
                        'priority' => 110,
                        'label'   => esc_html__( 'Button Styles', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                'pawfect_blog_background_color' => array(
                    'setting' => array(
                        'default' => '#fef9f5',
                        'sanitize_callback' => 'sanitize_hex_color',
                    ),
                    'control' => array(
                        'type' => 'color',
                        'priority' => 110,
                        'label' => esc_html__( 'Blog Background Color', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),
                'pawfect_service_bg_color' => array(
                    'setting' => array(
                        'default' => '#fef9f5',
                        'sanitize_callback' => 'sanitize_hex_color',
                    ),
                    'control' => array(
                        'type' => 'color',
                        'priority' => 111,
                        'label' => esc_html__( 'Why Choose Background', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),
                'pawfect_service_text_color' => array(
                    'setting' => array(
                        'default' => '#1F2937',
                        'sanitize_callback' => 'sanitize_hex_color',
                    ),
                    'control' => array(
                        'type' => 'color',
                        'priority' => 112,
                        'label' => esc_html__( 'Why Choose Text', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),
                'pawfect_portfolio_bg_color' => array(
                    'setting' => array(
                        'default' => '#ffffff',
                        'sanitize_callback' => 'sanitize_hex_color',
                    ),
                    'control' => array(
                        'type' => 'color',
                        'priority' => 113,
                        'label' => esc_html__( 'Portfolio Background', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                    ),
                ),

                'pawfect_button_style' => array(
                    'setting' => array(
                        'default' => 'modern',
                        'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_radio' ),
                    ),
                    'control' => array(
                        'type' => 'select',
                        'priority' => 120,
                         'is_default_type' => true,
                        'label' => esc_html__( 'Button Style', 'pawfect' ),
                        'description' => esc_html__( 'Choose the button style for your theme', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                        'choices' => array(
                            'modern' => esc_html__( 'Modern - Minimal', 'pawfect' ),
                            'rounded' => esc_html__( 'Rounded - Soft', 'pawfect' ),
                            'sharp' => esc_html__( 'Sharp - Clean rectangular design', 'pawfect' ),
                            'pill' => esc_html__( 'Pill - Fully rounded edges', 'pawfect' ),
                            'gradient' => esc_html__( 'Gradient - Modern gradient effect', 'pawfect' ),
                        ),
                    ),
                ),

                'pawfect_button_size' => array(
                    'setting' => array(
                        'default' => 'medium',
                        'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_radio' ),
                    ),
                    'control' => array(
                        'type' => 'select',
                        'priority' => 130,
                        'is_default_type' => true,
                        'label' => esc_html__( 'Button Size', 'pawfect' ),
                        'description' => esc_html__( 'Choose the default button size', 'pawfect' ),
                        'section' => 'pawfect_theme_colors',
                        'choices' => array(
                            'small' => esc_html__( 'Small - Compact buttons', 'pawfect' ),
                            'medium' => esc_html__( 'Medium - Standard size', 'pawfect' ),
                            'large' => esc_html__( 'Large - Prominent buttons', 'pawfect' ),
                        ),
                    ),
                ),

            );
        }
    }

    // Remove automatic instantiation - let main customizer class handle this
    // new Pawfect_Options_Theme_Colors();

endif;
