/* chatbot.css */
#chatbot-container { position: fixed; bottom: 90px; right: 9px; z-index: 10000; font-family: '微軟正黑體', sans-serif; }

#chatbot-button {
    width: 60px; height: 60px; border-radius: 50%;
    background: #ff9100; color: white; border: none;
    cursor: pointer; font-size: 28px; box-shadow: 0 4px 15px rgba(255, 145, 0, 0.5);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s ease;
}
#chatbot-button:hover { transform: scale(1.1); }
#chat-window {
    position: absolute; bottom: 80px; right: 0;
    width: 320px; height: 450px; background: rgba(255, 255, 255, 0.98);
    border-radius: 15px; display: none; flex-direction: column;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5); overflow: hidden;
}
#chat-header { background: #ff9100; color: white; padding: 15px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
#chat-messages { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: #f7f9fb; }
#chat-input-area { display: flex; padding: 12px; background: white; border-top: 1px solid #eee; }
#chat-input-area input { flex: 1; border: 1px solid #ddd; border-radius: 20px; padding: 8px 15px; outline: none; color: #333; }
#chat-input-area button { background: none; border: none; color: #ff9100; cursor: pointer; font-weight: bold; margin-left: 5px; }

/* 訊息氣泡 */
.msg { padding: 10px 14px; border-radius: 15px; font-size: 14px; max-width: 85%; line-height: 1.5; animation: fadeIn 0.3s ease; }
.user-msg { background: #ff9100; color: white; align-self: flex-end; border-bottom-right-radius: 2px; }
.bot-msg { background: #e9ecef; color: #333; align-self: flex-start; border-bottom-left-radius: 2px; }

/* 動畫 */
.typing-dots span { animation: blink 1.4s infinite both; font-size: 20px; margin: 0 1px; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0% { opacity: .2; } 20% { opacity: 1; } 100% { opacity: .2; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 提示泡泡樣式 */
#chatbot-tooltip {
    position: absolute;
    bottom: 75px;
    right: 0;
    background: white;
    color: #333;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    white-space: nowrap;
    display: none;
    z-index: 10001;
    animation: bounce 2s infinite;
}

#chatbot-tooltip::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: white transparent transparent;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-5px);}
    60% {transform: translateY(-3px);}
}

.fade-in {
    display: block !important;
    animation: fadeIn 0.5s ease forwards;
}

.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); }
}

