CREATE TABLE IF NOT EXISTS `website_intents` (
    `id`              BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
    `conversation_id` BIGINT UNSIGNED NOT NULL UNIQUE,
    `user_id`         BIGINT UNSIGNED NOT NULL,
    `industry`        VARCHAR(64)     NULL DEFAULT NULL
                          COMMENT 'Detected industry: hotel|shipping|church|visa|restaurant|store|education|agency',
    `style`           VARCHAR(64)     NULL DEFAULT NULL
                          COMMENT 'Detected style: apple|luxury|dark|modern|corporate',
    `features`        JSON            NULL DEFAULT NULL
                          COMMENT 'Array of detected feature keys e.g. ["booking","gallery"]',
    `raw_input`       TEXT            NULL DEFAULT NULL
                          COMMENT 'Original first user prompt',
    `business_name`   VARCHAR(255)    NULL DEFAULT NULL,
    `color_preference`VARCHAR(255)    NULL DEFAULT NULL,
    `extra_notes`     TEXT            NULL DEFAULT NULL,
    `status`          ENUM('collecting','complete') NOT NULL DEFAULT 'collecting',
    `created_at`      DATETIME        NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at`      DATETIME        NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    INDEX `idx_website_intents_user_id` (`user_id`),
    INDEX `idx_website_intents_status`  (`status`),
    CONSTRAINT `fk_website_intents_conversation`
        FOREIGN KEY (`conversation_id`) REFERENCES `conversations` (`id`)
        ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
