<?php
/**
 * Register widget areas
 *
 * @package Pawfect
 */

// Exit if accessed directly

if (!defined('ABSPATH')) {
    exit;
}

add_action('widgets_init', 'pawfect_widgets_init');
function pawfect_widgets_init() {
    
    // Main Sidebar (Enhanced Premium Styling - Matches Shop Sidebar)
    register_sidebar(array(
        'name'          => esc_html__('Sidebar Widget Area', 'pawfect'),
        'id'            => 'sidebar-1',
        'description'   => esc_html__('The Primary Widget Area for blog sidebar', 'pawfect'),
        'before_widget' => '<div id="%1$s" class="widget %2$s pawfect-bg-white pawfect-p-8 pawfect-rounded-xl pawfect-shadow-lg pawfect-border pawfect-border-gray-100 pawfect-mb-6">',
        'after_widget'  => '</div>',
        'before_title'  => '<h3 class="pawfect-widget-title pawfect-text-lg pawfect-font-bold pawfect-text-gray-900 pawfect-mb-4 pawfect-pb-2 pawfect-border-b pawfect-border-gray-200">',
        'after_title'   => '</h3>',
    ));

    // Footer Widget Areas - Individual columns like Formula Premium
    register_sidebar(array(
        'name'          => esc_html__('Footer Widget First Column', 'pawfect'),
        'id'            => 'footer-widget-1',
        'description'   => esc_html__('Footer Widget First Column', 'pawfect'),
        'before_widget' => '<div id="%1$s" class="pawfect-footer-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h5 class="pawfect-font-semibold pawfect-text-xl pawfect-mb-3 pawfect-text-white">',
        'after_title'   => '</h5>',
    ));

    register_sidebar(array(
        'name'          => esc_html__('Footer Widget Second Column', 'pawfect'),
        'id'            => 'footer-widget-2',
        'description'   => esc_html__('Footer Widget Second Column', 'pawfect'),
        'before_widget' => '<div id="%1$s" class="pawfect-footer-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h5 class="pawfect-font-semibold pawfect-text-xl pawfect-mb-3 pawfect-text-white">',
        'after_title'   => '</h5>',
    ));

    register_sidebar(array(
        'name'          => esc_html__('Footer Widget Third Column', 'pawfect'),
        'id'            => 'footer-widget-3',
        'description'   => esc_html__('Footer Widget Third Column', 'pawfect'),
        'before_widget' => '<div id="%1$s" class="pawfect-footer-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h5 class="pawfect-font-semibold pawfect-text-xl pawfect-mb-3 pawfect-text-white">',
        'after_title'   => '</h5>',
    ));

    register_sidebar(array(
        'name'          => esc_html__('Footer Widget Fourth Column', 'pawfect'),
        'id'            => 'footer-widget-4',
        'description'   => esc_html__('Footer Widget Fourth Column', 'pawfect'),
        'before_widget' => '<div id="%1$s" class="pawfect-footer-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h5 class="pawfect-font-semibold pawfect-text-xl pawfect-mb-3 pawfect-text-white">',
        'after_title'   => '</h5>',
    ));

    // Footer Feature Widget Areas (First Row - Top Feature Row)
    register_sidebar(array(
        'name'          => esc_html__('Footer Feature 1', 'pawfect'),
        'id'            => 'footer-feature-1',
        'description'   => esc_html__('Footer Feature First Column (Fast Shipping, etc.)', 'pawfect'),
        'before_widget' => '<div id="%1$s" class="pawfect-footer-feature-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h5 class="pawfect-font-semibold pawfect-text-xl pawfect-mb-2 pawfect-mt-2 pawfect-text-white">',
        'after_title'   => '</h5>',
    ));

    register_sidebar(array(
        'name'          => esc_html__('Footer Feature 2', 'pawfect'),
        'id'            => 'footer-feature-2',
        'description'   => esc_html__('Footer Feature Second Column (Free Returns, etc.)', 'pawfect'),
        'before_widget' => '<div id="%1$s" class="pawfect-footer-feature-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h5 class="pawfect-font-semibold pawfect-text-xl pawfect-mb-2 pawfect-mt-2 pawfect-text-white">',
        'after_title'   => '</h5>',
    ));

    register_sidebar(array(
        'name'          => esc_html__('Footer Feature 3', 'pawfect'),
        'id'            => 'footer-feature-3',
        'description'   => esc_html__('Footer Feature Third Column (Easy Exchanges, etc.)', 'pawfect'),
        'before_widget' => '<div id="%1$s" class="pawfect-footer-feature-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h5 class="pawfect-font-semibold pawfect-text-xl pawfect-mb-2 pawfect-mt-2 pawfect-text-white">',
        'after_title'   => '</h5>',
    ));

    register_sidebar(array(
        'name'          => esc_html__('Footer Feature 4', 'pawfect'),
        'id'            => 'footer-feature-4',
        'description'   => esc_html__('Footer Feature Fourth Column (World-Class Support, etc.)', 'pawfect'),
        'before_widget' => '<div id="%1$s" class="pawfect-footer-feature-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h5 class="pawfect-font-semibold pawfect-text-xl pawfect-mb-2 pawfect-mt-2 pawfect-text-white">',
        'after_title'   => '</h5>',
    ));

    // Footer Links Widget Areas
    register_sidebar(array(
        'name'          => esc_html__('Footer Links First Column', 'pawfect'),
        'id'            => 'footer-links-1',
        'description'   => esc_html__('Footer Links First Column', 'pawfect'),
        'before_widget' => '<div id="%1$s" class="pawfect-footer-links-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h5 class="pawfect-font-semibold pawfect-text-xl pawfect-mb-3 pawfect-text-white">',
        'after_title'   => '</h5>',
    ));

    register_sidebar(array(
        'name'          => esc_html__('Footer Links Second Column', 'pawfect'),
        'id'            => 'footer-links-2',
        'description'   => esc_html__('Footer Links Second Column', 'pawfect'),
        'before_widget' => '<div id="%1$s" class="pawfect-footer-links-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h5 class="pawfect-font-semibold pawfect-text-xl pawfect-mb-3 pawfect-text-white">',
        'after_title'   => '</h5>',
    ));

    register_sidebar(array(
        'name'          => esc_html__('Footer Links Third Column', 'pawfect'),
        'id'            => 'footer-links-3',
        'description'   => esc_html__('Footer Links Third Column', 'pawfect'),
        'before_widget' => '<div id="%1$s" class="pawfect-footer-links-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h5 class="pawfect-font-semibold pawfect-text-xl pawfect-mb-3 pawfect-text-white">',
        'after_title'   => '</h5>',
    ));

    register_sidebar(array(
        'name'          => esc_html__('Footer Links Fourth Column', 'pawfect'),
        'id'            => 'footer-links-4',
        'description'   => esc_html__('Footer Links Fourth Column', 'pawfect'),
        'before_widget' => '<div id="%1$s" class="pawfect-footer-links-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h5 class="pawfect-font-semibold pawfect-text-xl pawfect-mb-3 pawfect-text-white">',
        'after_title'   => '</h5>',
    ));

    // WooCommerce Widget Area (Enhanced Premium Styling)
    if (class_exists('WooCommerce')) {
        register_sidebar(array(
            'name'          => esc_html__('WooCommerce Sidebar Widget Area', 'pawfect'),
            'id'            => 'shop-sidebar',
            'description'   => esc_html__('This Widget area for WooCommerce Shop Sidebar', 'pawfect'),
            'before_widget' => '<div id="%1$s" class="widget %2$s pawfect-bg-white pawfect-p-8 pawfect-rounded-xl pawfect-shadow-lg pawfect-border pawfect-border-gray-100 pawfect-mb-6">',
            'after_widget'  => '</div>',
            'before_title'  => '<h3 class="pawfect-widget-title pawfect-text-lg pawfect-font-bold pawfect-text-gray-900 pawfect-mb-4 pawfect-pb-2 pawfect-border-b pawfect-border-gray-200">',
            'after_title'   => '</h3>',
        ));
    }
}