/* 賀欣機械智慧助手 V2 前端 Widget 樣式表 */

#hohsing-chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 浮動觸發按鈕 */
#hohsing-chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0056b3;
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 86, 179, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#hohsing-chatbot-toggle:hover {
    transform: scale(1.06);
}

#hohsing-chatbot-toggle svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* 對話視窗容器 */
#hohsing-chatbot-window {
    display: none;
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 580px;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

#hohsing-chatbot-window * {
    box-sizing: border-box;
}

#hohsing-chatbot-window.open {
    display: flex;
}

/* 頂部標題列 */
.hohsing-chat-header {
    background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hohsing-chat-header-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hohsing-chat-close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 4px;
}

/* 訊息滾動區塊 */
.hohsing-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 訊息泡泡 */
.hohsing-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.hohsing-msg.bot {
    background-color: #ffffff;
    color: #212529;
    align-self: flex-start;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.hohsing-msg.user {
    background-color: #0056b3;
    color: #ffffff;
    align-self: flex-end;
}

/* 快速回覆按鈕與機型選擇清單 */
.hohsing-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.hohsing-qr-btn {
    background-color: #e7f1ff;
    color: #0056b3;
    border: 1px solid #b8daff;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.hohsing-qr-btn:hover {
    background-color: #0056b3;
    color: #ffffff;
}

/* 安全警告引用區塊 */
.hohsing-msg blockquote {
    margin: 8px 0;
    padding: 8px 12px;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
    border-radius: 4px;
    font-size: 13px;
}

/* 底部輸入區域 */
.hohsing-chat-input-area {
    padding: 12px;
    background-color: #ffffff;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
}

#hohsing-chat-input {
    flex: 1;
    border: 1px solid #ced4da;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

#hohsing-chat-input:focus {
    border-color: #0056b3;
}

#hohsing-chat-send {
    background-color: #0056b3;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 低高度螢幕適應 (高度小於 720px 時，自動調整按鈕與對話框間距，確保頂部預留充足邊距) */
@media (max-height: 720px) {
    #hohsing-chatbot-container {
        bottom: 16px;
        right: 16px;
    }
    #hohsing-chatbot-toggle {
        width: 50px;
        height: 50px;
    }
    #hohsing-chatbot-window {
        bottom: 76px;
        right: 16px;
        max-height: calc(100vh - 96px);
        max-height: calc(100dvh - 96px);
    }
}

/* 手機版適應 (螢幕小於 480px 滿版) */
@media (max-width: 480px) {
    #hohsing-chatbot-window {
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
}
