<?php
defined( 'ABSPATH' ) || exit;

function cafi_get_all_templates_config() {
    // Helper to build standard structure
    $templates = [
        // --- 0. Solid Colors ---
        [ 'id' => 'solid-midnight-black', 'type' => 'color', 'value' => '#111827', 'name' => 'Midnight Black', 'category' => 'solid' ],
        [ 'id' => 'solid-slate-gray',     'type' => 'color', 'value' => '#4B5563', 'name' => 'Slate Gray',     'category' => 'solid' ],
        [ 'id' => 'solid-purple-hazel',   'type' => 'color', 'value' => '#7C3AED', 'name' => 'Purple Hazel',   'category' => 'solid' ],
        [ 'id' => 'solid-ocean-teal',     'type' => 'color', 'value' => '#0D9488', 'name' => 'Ocean Teal',     'category' => 'solid' ],
        [ 'id' => 'solid-sunset-orange',  'type' => 'color', 'value' => '#EA580C', 'name' => 'Sunset Orange',  'category' => 'solid' ],
        [ 'id' => 'solid-chocolate',      'type' => 'color', 'value' => '#78350F', 'name' => 'Chocolate',      'category' => 'solid' ],
        [ 'id' => 'solid-deep-indigo',    'type' => 'color', 'value' => '#4338CA', 'name' => 'Deep Indigo',    'category' => 'solid' ],
        
        // --- 0. Gradients ---
        [ 'id' => 'grad-midnight-blue', 'type' => 'gradient', 'value' => '#0F2027,#203A43,#2C5364,vertical', 'name' => 'Midnight Blue', 'category' => 'gradient' ],
        [ 'id' => 'grad-sunset-vibes',  'type' => 'gradient', 'value' => '#FF512F,#DD2476,horizontal',       'name' => 'Sunset Vibes',  'category' => 'gradient' ],
        [ 'id' => 'grad-ocean-blue',    'type' => 'gradient', 'value' => '#2193b0,#6dd5ed,horizontal',       'name' => 'Ocean Blue',    'category' => 'gradient' ],
        [ 'id' => 'grad-lush-green',    'type' => 'gradient', 'value' => '#11998e,#38ef7d,vertical',         'name' => 'Lush Green',    'category' => 'gradient' ],
        [ 'id' => 'grad-purple-love',   'type' => 'gradient', 'value' => '#cc2b5e,#753a88,horizontal',       'name' => 'Purple Love',   'category' => 'gradient' ],
        [ 'id' => 'grad-dark-knight',   'type' => 'gradient', 'value' => '#232526,#414345,vertical',         'name' => 'Dark Knight',   'category' => 'gradient' ],
        [ 'id' => 'grad-piggy-pink',    'type' => 'gradient', 'value' => '#ee9ca7,#ffdde1,horizontal',       'name' => 'Piggy Pink',    'category' => 'gradient' ],
        [ 'id' => 'grad-cool-sky',      'type' => 'gradient', 'value' => '#2980B9,#6DD5FA,vertical',         'name' => 'Cool Sky',      'category' => 'gradient' ],
        [ 'id' => 'grad-morning-dew',   'type' => 'gradient', 'value' => '#C9D6FF,#E2E2E2,horizontal',       'name' => 'Morning Dew',   'category' => 'gradient' ],
        [ 'id' => 'grad-deep-space',    'type' => 'gradient', 'value' => '#000000,#434343,vertical',         'name' => 'Deep Space',    'category' => 'gradient' ],

        // --- 1. Business & Corporate ---
        [
            'id' => 'business_01', 'name' => 'Business & Corporate Template 01', 'category' => 'Business',
            'file' => 'Business & Corporate Template 01.webp',
            'settings' => [
                'font_family' => 'Roboto', 'font_weight' => 'Bold',
                'font_color' => '#373F36', 'font_size' => 60,
                'text_position' => 'middle', 'text_alignment' => 'center',
                'padding_top' => 0, 'padding_right' => 60, 'padding_bottom' => 0, 'padding_left' => 60,
                'logo_position' => 'bottom-left',
                'logo_offset_x' => 65, 'logo_offset_y' => 65,
                'logo_size' => 25
            ]
        ],
        [
            'id' => 'business_02', 'name' => 'Business & Corporate Template 02', 'category' => 'Business',
            'file' => 'Business & Corporate Template 02.webp',
            'settings' => [
                'font_family' => 'Roboto', 'font_weight' => 'Bold',
                'font_color' => '#FFFFFF', 'font_size' => 60,
                'text_position' => 'middle', 'text_alignment' => 'center',
                'padding_top' => 0, 'padding_right' => 60, 'padding_bottom' => 0, 'padding_left' => 60,
                'logo_position' => 'bottom-right',
                'logo_offset_x' => 105, 'logo_offset_y' => 35,
                'logo_size' => 25
            ]
        ],
        [
            'id' => 'business_03', 'name' => 'Business & Corporate Template 03', 'category' => 'Business',
            'file' => 'Business & Corporate Template 03.webp',
            'settings' => [
                'font_family' => 'Roboto', 'font_weight' => 'Bold',
                'font_color' => '#011459', 'font_size' => 60,
                'text_position' => 'middle', 'text_alignment' => 'center',
                'padding_top' => 0, 'padding_right' => 60, 'padding_bottom' => 0, 'padding_left' => 60,
                'logo_position' => 'bottom-right',
                'logo_offset_x' => 65, 'logo_offset_y' => 65,
                'logo_size' => 25
            ]
        ],
        [
            'id' => 'business_04', 'name' => 'Business & Corporate Template 04', 'category' => 'Business',
            'file' => 'Business & Corporate Template 04.webp',
            'settings' => [
                'font_family' => 'Teko', 'font_weight' => 'Bold',
                'font_size' => 80,
                'font_color' => '#FFFFFF', 
                'text_position' => 'middle', 'text_alignment' => 'center',
                'padding_top' => 0, 'padding_right' => 60, 'padding_bottom' => 0, 'padding_left' => 60,
                'logo_position' => 'bottom-left',
                'logo_offset_x' => 65, 'logo_offset_y' => 65,
                'logo_size' => 25
            ]
        ],
        [
            'id' => 'business_05', 'name' => 'Business & Corporate Template 05', 'category' => 'Business',
            'file' => 'Business & Corporate Template 05.webp',
            'settings' => [
                'font_family' => 'Oswald', 'font_weight' => 'Bold',
                'font_size' => 60,
                'font_color' => '#000000', 
                'text_position' => 'middle', 'text_alignment' => 'center', 
                'padding_top' => 0, 'padding_right' => 60, 'padding_bottom' => 0, 'padding_left' => 60,
                'logo_position' => 'bottom-left',
                'logo_offset_x' => 65, 'logo_offset_y' => 65,
                'logo_size' => 25
            ]
        ],
        [
            'id' => 'business_06', 'name' => 'Business & Corporate Template 06', 'category' => 'Business',
            'file' => 'Business & Corporate Template 06.webp',
            'settings' => [
                'font_family' => 'Roboto', 'font_weight' => 'Bold',
                'font_size' => 60,
                'font_color' => '#FFFFFF', 
                'text_position' => 'top', 'text_alignment' => 'left',
                'padding_top' => 60, 'padding_right' => 60, 'padding_bottom' => 0, 'padding_left' => 60,
                'logo_position' => 'bottom-right',
                'logo_offset_x' => 65, 'logo_offset_y' => 65,
                'logo_size' => 25
            ]
        ],

        // --- 2. Tech & Modern ---
        [
            'id' => 'tech_01', 'name' => 'Tech & Modern Template 01', 'category' => 'Tech',
            'file' => 'Tech & Modern Template 01.webp',
            'settings' => [
                'font_family' => 'Roboto', 'font_weight' => 'Bold',
                'font_color' => '#ffffff', 'font_size' => 60,
                'text_position' => 'middle', 'text_alignment' => 'center', 
                'logo_position' => 'top-left', 
                'logo_offset_x' => 65, 'logo_offset_y' => 65
            ]
        ],
        [
            'id' => 'tech_02', 'name' => 'Tech & Modern Template 02', 'category' => 'Tech',
            'file' => 'Tech & Modern Template 02.webp',
            'settings' => [
                'font_family' => 'Roboto', 'font_weight' => 'Bold',
                'font_color' => '#ea9f1e', 'font_size' => 60,
                'text_position' => 'top', 'text_alignment' => 'center',
                'logo_position' => 'bottom-right',
                'logo_offset_x' => 65, 'logo_offset_y' => 65
            ]
        ],
        [
            'id' => 'tech_03', 'name' => 'Tech & Modern Template 03', 'category' => 'Tech',
            'file' => 'Tech & Modern Template 03.webp',
            'settings' => [
                'font_family' => 'Roboto', 'font_weight' => 'Bold',
                'font_color' => '#ffffff', 'font_size' => 60,
                'text_position' => 'top', 'text_alignment' => 'center', 
                'padding_top' => 105, 'padding_left' => 310, 'padding_right' => 120,
                'logo_position' => 'bottom-left',
                'logo_offset_x' => 65, 'logo_offset_y' => 65
            ]
        ],
        [
            'id' => 'tech_04', 'name' => 'Tech & Modern Template 04', 'category' => 'Tech',
            'file' => 'Tech & Modern Template 04.webp',
            'settings' => [
                'font_family' => 'Teko', 'font_weight' => 'Bold',
                'font_size' => 70,
                'font_color' => '#FFFFFF', 
                'text_position' => 'bottom', 'text_alignment' => 'left',
                'padding_top' => 0, 'padding_right' => 390, 'padding_bottom' => 60, 'padding_left' => 60,
                'logo_position' => 'top-left',
                'logo_offset_x' => 65, 'logo_offset_y' => 65,
                'logo_size' => 25
            ]
        ],
        [
            'id' => 'tech_05', 'name' => 'Tech & Modern Template 05', 'category' => 'Tech',
            'file' => 'Tech & Modern Template 05.webp',
            'settings' => [
                'font_family' => 'Roboto', 'font_weight' => 'Bold',
                'font_size' => 60,
                'font_color' => '#FFFFFF', 
                'text_position' => 'top', 'text_alignment' => 'center', 
                'padding_top' => 60, 'padding_right' => 65, 'padding_bottom' => 60, 'padding_left' => 350,
                'logo_position' => 'bottom-left',
                'logo_offset_x' => 130, 'logo_offset_y' => 40,
                'logo_size' => 25
            ]
        ],
        [
            'id' => 'tech_06', 'name' => 'Tech & Modern Template 06', 'category' => 'Tech',
            'file' => 'Tech & Modern Template 06.webp',
            'settings' => [
                'font_family' => 'Roboto', 'font_weight' => 'Bold',
                'font_size' => 60,
                'font_color' => '#FFFFFF', 
                'text_position' => 'middle', 'text_alignment' => 'center',
                'padding_top' => 60, 'padding_right' => 65, 'padding_bottom' => 60, 'padding_left' => 60
            ]
        ],

        // --- 3. Lifestyle & Creative ---
        [
            'id' => 'life_01', 'name' => 'Lifestyle & Creative Template 01', 'category' => 'Lifestyle',
            'file' => 'Lifestyle & Creative Template 01.webp',
            'settings' => [
                'font_family' => 'Arvo', 'font_weight' => 'Bold',
                'font_color' => '#ff9371', 'font_size' => 60,
                'text_position' => 'top', 'text_alignment' => 'center',
                'padding_top' => 80, 'padding_left' => 63, 'padding_right' => 360,
                'logo_position' => 'bottom-right',
                'logo_offset_x' => 65, 'logo_offset_y' => 65
            ]
        ],
        [
            'id' => 'life_02', 'name' => 'Lifestyle & Creative Template 02', 'category' => 'Lifestyle',
            'file' => 'Lifestyle & Creative Template 02.webp',
            'settings' => [
                'font_family' => 'Arvo', 'font_weight' => 'Regular',
                'font_color' => '#806c57', 'font_size' => 60,
                'text_position' => 'top', 'text_alignment' => 'center',
                'padding_top' => 126, 'padding_left' => 190, 'padding_right' => 80,
                'logo_position' => 'bottom-left',
                'logo_offset_x' => 65, 'logo_offset_y' => 65
            ]
        ],
        [
            'id' => 'life_03', 'name' => 'Lifestyle & Creative Template 03', 'category' => 'Lifestyle',
            'file' => 'Lifestyle & Creative Template 03.webp',
            'settings' => [
                'font_family' => 'Nanum Gothic', 'font_weight' => 'Bold',
                'font_color' => '#806c57', 'font_size' => 60,
                'text_position' => 'top', 'text_alignment' => 'center',
                'padding_top' => 160,
                'logo_position' => 'bottom-left',
                'logo_offset_x' => 65, 'logo_offset_y' => 65
            ]
        ],
        [
            'id' => 'life_04', 'name' => 'Lifestyle & Creative Template 04', 'category' => 'Lifestyle',
            'file' => 'Lifestyle & Creative Template 04.webp',
            'settings' => [
                'font_family' => 'Oswald', 'font_weight' => 'Bold', 
                'font_color' => '#545454', 'font_size' => 60,
                'text_position' => 'top', 'text_alignment' => 'left',
                'logo_position' => 'bottom-right',
                'logo_offset_x' => 65, 'logo_offset_y' => 65
            ]
        ],
        [
            'id' => 'life_05', 'name' => 'Lifestyle & Creative Template 05', 'category' => 'Lifestyle',
            'file' => 'Lifestyle & Creative Template 05.webp',
            'settings' => [
                'font_family' => 'Raleway', 'font_weight' => 'Regular',
                'font_color' => '#020202', 'font_size' => 60,
                'text_position' => 'top', 'text_alignment' => 'center',
                'padding_top' => 130,
                'logo_position' => 'bottom-left',
                'logo_offset_x' => 65, 'logo_offset_y' => 65
            ]
        ],
        [
            'id' => 'life_06', 'name' => 'Lifestyle & Creative Template 06', 'category' => 'Lifestyle',
            'file' => 'Lifestyle & Creative Template 06.webp',
            'settings' => [
                'font_family' => 'Raleway', 'font_weight' => 'Bold',
                'font_color' => '#545454', 'font_size' => 60,
                'text_position' => 'middle', 'text_alignment' => 'center',
                'logo_position' => 'bottom-left',
                'logo_offset_x' => 65, 'logo_offset_y' => 65
            ]
        ],

        // --- 4. Minimal & Abstract ---
        [
            'id' => 'min_01', 'name' => 'Minimal & Abstract Template 01', 'category' => 'Minimal',
            'file' => 'Minimal & Abstract Template 01.webp',
            'settings' => [
                'font_family' => 'Raleway', 'font_weight' => 'Bold',
                'font_color' => '#435fad', 'font_size' => 60,
                'text_position' => 'middle', 'text_alignment' => 'center',
                'logo_position' => 'bottom-left',
                'logo_offset_x' => 65, 'logo_offset_y' => 65
            ]
        ],
        [
            'id' => 'min_02', 'name' => 'Minimal & Abstract Template 02', 'category' => 'Minimal',
            'file' => 'Minimal & Abstract Template 02.webp',
            'settings' => [
                'font_family' => 'Raleway', 'font_weight' => 'Bold',
                'font_color' => '#6700b8', 'font_size' => 60,
                'text_position' => 'middle', 'text_alignment' => 'center'
            ]
        ],
        [
            'id' => 'min_03', 'name' => 'Minimal & Abstract Template 03', 'category' => 'Minimal',
            'file' => 'Minimal & Abstract Template 03.webp',
            'settings' => [
                'font_family' => 'Raleway', 'font_weight' => 'Bold',
                'font_color' => '#ffffff', 'font_size' => 60,
                'text_position' => 'middle', 'text_alignment' => 'center'
            ]
        ],
        [
            'id' => 'min_04', 'name' => 'Minimal & Abstract Template 04', 'category' => 'Minimal',
            'file' => 'Minimal & Abstract Template 04.webp',
            'settings' => [
                'font_family' => 'Raleway', 'font_weight' => 'Bold',
                'font_color' => '#000000', 'font_size' => 70,
                'text_position' => 'middle', 'text_alignment' => 'center',
                'logo_position' => 'top-center',
                'logo_offset_x' => 0,
                'logo_offset_y' => 65
            ]
        ],
        [
            'id' => 'min_05', 'name' => 'Minimal & Abstract Template 05', 'category' => 'Minimal',
            'file' => 'Minimal & Abstract Template 05.webp',
            'settings' => [
                'font_family' => 'Raleway', 'font_weight' => 'Bold',
                'font_color' => '#565250', 'font_size' => 70,
                'text_position' => 'middle', 'text_alignment' => 'center',
                'logo_position' => 'top-right',
                'logo_offset_x' => 65, 'logo_offset_y' => 65
            ]
        ],
        [
            'id' => 'min_06', 'name' => 'Minimal & Abstract Template 06', 'category' => 'Minimal',
            'file' => 'Minimal & Abstract Template 06.webp',
            'settings' => [
                'font_family' => 'Raleway', 'font_weight' => 'Bold',
                'font_color' => '#ffffff', 'font_size' => 60,
                'text_position' => 'middle', 'text_alignment' => 'center',
                'padding_top' => 113,
                'logo_position' => 'bottom-center',
                'logo_offset_x' => 0,
                'logo_offset_y' => 45 
            ]
        ]
    ];
    
    return $templates;
}
