CREATE TABLE IF NOT EXISTS `templates` (
    `id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    `name` VARCHAR(255) NOT NULL UNIQUE,
    `description` TEXT,
    `primary_color` VARCHAR(7) NOT NULL DEFAULT '#3498db',
    `secondary_color` VARCHAR(7) NOT NULL DEFAULT '#2c3e50',
    `accent_color` VARCHAR(7) NOT NULL DEFAULT '#e74c3c',
    `header_bg_color` VARCHAR(7) NOT NULL DEFAULT '#ffffff',
    `footer_bg_color` VARCHAR(7) NOT NULL DEFAULT '#2c3e50',
    `text_color` VARCHAR(7) NOT NULL DEFAULT '#333333',
    `link_color` VARCHAR(7) NOT NULL DEFAULT '#3498db',
    `button_color` VARCHAR(7) NOT NULL DEFAULT '#3498db',
    `button_text_color` VARCHAR(7) NOT NULL DEFAULT '#ffffff',
    `cart_color` VARCHAR(7) NOT NULL DEFAULT '#e74c3c',
    `success_color` VARCHAR(7) NOT NULL DEFAULT '#27ae60',
    `warning_color` VARCHAR(7) NOT NULL DEFAULT '#f39c12',
    `danger_color` VARCHAR(7) NOT NULL DEFAULT '#e74c3c',
    `is_active` TINYINT(1) NOT NULL DEFAULT 0,
    `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    INDEX `idx_is_active` (`is_active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `templates` (name, description, primary_color, secondary_color, accent_color, header_bg_color, footer_bg_color, text_color, link_color, button_color, button_text_color, cart_color, success_color, warning_color, danger_color, is_active)
VALUES ('Varsayılan', 'Varsayılan site teması', '#3498db', '#2c3e50', '#e74c3c', '#ffffff', '#2c3e50', '#333333', '#3498db', '#3498db', '#ffffff', '#e74c3c', '#27ae60', '#f39c12', '#e74c3c', 1);
