/*
	Custom CSS
	Please make sure your CSS rules are 
	more particular / have higher priority
	then other page styles
*/
 #events h3   {
	/* add your css rule here */
}


 #events p.duration, #events div.duration   {
	/* add your css rule here */
}


 #events p.description, #events div.description   {
	/* add your css rule here */
}


 #events .selectedEvent   {
	/* add your css rule here */
}


 #events input.reserve_time_btn   {
	/* add your css rule here */
}


 #events input.select_another_btn   {
	/* add your css rule here */
}


 #eventForm #start_date-block-container h3, #eventForm #timeline-container h3   {
	/* add your css rule here */
}


 #eventForm #save_button   {
	/* add your css rule here */
}


 div.ui-widget-content   {
	/* add your css rule here */
}


 div.ui-widget-header   {
	/* add your css rule here */
}


 #timeline-container table.timeline   {
	/* add your css rule here */
}


 .timeline td.not_worked_time   {
	/* add your css rule here */
}


 .timeline td.free_time   {
	/* add your css rule here */
}


 .timeline td.selected_time   {
	/* add your css rule here */
}


 .timeline td.reserved_time   {
	/* add your css rule here */
}


 div#loading   {
	/* add your css rule here */
}


 #start_date-block-container .zend_form dt, start_date-block-container .zend_form dt b, start_date-block-container .zend_form dd label   {
	/* add your css rule here */
}

// 1. 動態引入 LINE 官方的 LIFF SDK
var liffScript = document.createElement('script');
liffScript.src = "https://static.line-scdn.net/liff/edge/2/sdk.js";
document.head.appendChild(liffScript);

liffScript.onload = function() {
    // 2. 初始化 LIFF（請把下面的 '您的_LIFF_ID' 換掉）
    liff.init({ liffId: '您的_LIFF_ID' }).then(() => {
        console.log("LIFF Ready in SimplyBook");
    });
};

// 3. 監聽 SimplyBook 預約完成的訊號
document.addEventListener('bookingConfirmed', function (event) {
    if (liff.isInClient()) {
        // 4. 以用戶名義自動發送暗號給 Super 8
        liff.sendMessages([
            {
                type: 'text',
                text: '#已完成新品體驗會預約'
            }
        ])
        .then(() => {
            liff.closeWindow(); // 發送完畢自動關閉視窗，退回 LINE 聊天室
        })
        .catch((err) => {
            alert('預約成功！請手動回到聊天室領取憑證。');
            liff.closeWindow();
        });
    }
});
