﻿/* 浮動按鈕樣式 */
#chatButton {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: opacity 0.3s ease;
}

/* 聊天視窗 */
#chatWindow {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

    /* 顯示時套用的 class */
    #chatWindow.active {
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
    }

/* 手機版全屏 */
@media screen and (max-width: 600px) {
    #chatWindow {
        bottom: 0;
        right: 0;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

/* 頂部欄 */
#chatHeader {
    background-color: #007bff;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    #chatHeader button {
        background: none;
        border: none;
        color: white;
        font-size: 20px;
        cursor: pointer;
    }

/* 內容區域 */
#chatContent {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

/* 假的輸入區 */
#chatInput {
    padding: 10px;
    border-top: 1px solid #ccc;
}

    #chatInput input {
        width: 100%;
        padding: 8px;
        border: 1px solid #ccc;
        border-radius: 5px;
    }

/* 訊息通用樣式 */
.message {
    max-width: 75%;
    padding: 10px 15px;
    border-radius: 18px;
    margin: 8px 0;
    line-height: 1.4;
    word-wrap: break-word;
    display: inline-block;
    font-size: 14px;
}

/* 自己的訊息（靠右） */
.from-me {
    align-self: flex-end;
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 0;
}

/* 對方的訊息（靠左） */
.from-them {
    align-self: flex-start;
    background-color: #f1f1f1;
    color: #333;
    border-bottom-left-radius: 0;
}

/* 警告訊息（置中） */
.from-warning {
    align-self: center;
    background-color: #f1f1f1;
    color: #333;
    border-bottom-left-radius: 0;
}

/* 讓訊息垂直堆疊 */
#chatContent {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
