@charset "utf-8";
/* AI智慧客服 Widget樣式，改自MVC004/css/ai-customer-service.css靜態展示稿 */
/* bottom偏移拉高至100px，避開本站既有的FB Messenger客服外掛(_FBMessenger.cshtml)慣用的右下角位置 */

:root {
    --main-color: 21,101,200; /*主色系*/
}

/* ===== AI 客服容器 ===== */
.ai-chat-widget {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    /* 窄視窗下auto寬度shrink-to-fit運算會跑掉，明確指定寬度避免按鈕被推出可視範圍 */
    width: max-content;
    max-width: calc(100vw - 48px);
}

/* ===== 對話框視窗 ===== */
.ai-chat-box {
    width: 0;
    height: 0;
    max-height: 0;
    background: #f5f5f5;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.45s ease, transform 0.45s ease, height 0.45s ease, max-height 0.45s ease, width 0.45s ease;
}

.ai-chat-box.active {
    width: 350px;
    height: 65vh;
    max-height: 500px;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* 標題列 */
.ai-chat-header {
    background: rgb(var(--main-color));
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.ai-chat-header h2 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 2px;
    margin: 0;
}

.ai-chat-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 4px;
    border-radius: 50%;
    transition: background-color 0.15s;
}

.ai-chat-close:hover {
    background: rgba(255,255,255,0.18);
}

/* 日期標示 */
.ai-chat-date {
    text-align: center;
    font-size: 12px;
    color: #999;
    padding: 10px 0 4px;
    flex-shrink: 0;
}

/* 訊息區域 */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 14px 12px;
    margin-right: 3px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* 訊息列 */
.msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.msg-row.bot {
    flex-direction: row;
}

.msg-row.user {
    flex-direction: row-reverse;
}

/* 機器人頭像 */
.bot-avatar {
    width: 36px;
    height: 36px;
    background: #e8e8e8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #555;
}

.bot-avatar svg {
    width: 22px;
    height: 22px;
}

/* 訊息泡泡 */
.msg-bubble-wrap {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.msg-row.user .msg-bubble-wrap {
    align-items: flex-end;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.msg-row.bot .msg-bubble {
    background: #e0e0e0;
    color: #222;
    border-bottom-left-radius: 4px;
}

.msg-row.user .msg-bubble {
    background-color: color-mix(in srgb, rgb(var(--main-color)) 35%, white 65%);
    color: #222;
    border-bottom-right-radius: 4px;
}

.msg-time {
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
}

/* ===== 房型/行程卡片(ROOM_CARDS、TRIP_CARDS) ===== */
.ai-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-room-card,
.ai-trip-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.ai-card-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    background: #eee;
}

.ai-card-body {
    padding: 10px 12px;
    position: relative;
}

.ai-card-badge {
    display: inline-block;
    font-size: 11px;
    color: #fff;
    background: rgb(var(--main-color));
    border-radius: 10px;
    padding: 2px 8px;
    margin-bottom: 6px;
}

.ai-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #222;
}

.ai-card-subtitle {
    font-size: 12px;
    color: #777;
    margin-top: 2px;
}

.ai-card-desc {
    font-size: 12px;
    color: #555;
    margin-top: 6px;
    line-height: 1.5;
}

.ai-card-meta {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

.ai-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.ai-card-price {
    font-size: 15px;
    font-weight: 700;
    color: rgb(var(--main-color));
}

.ai-card-btn {
    background: rgb(var(--main-color));
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 16px;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.ai-card-btn:hover {
    opacity: 0.85;
    color: #fff;
}

/* ===== SUGGEST快捷回覆chips ===== */
.ai-suggest-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-suggest-chip {
    border: 1px solid rgb(var(--main-color));
    background: #fff;
    color: rgb(var(--main-color));
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 16px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.ai-suggest-chip:hover {
    background: rgb(var(--main-color));
    color: #fff;
}

/* 輸入列 */
.ai-chat-footer {
    display: flex;
    align-items: flex-end;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    gap: 8px;
    flex-shrink: 0;
}

.footer-input {
    flex: 1;
    border: 1px solid #ddd;
    outline: none;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    font-family: inherit;
    resize: none;
    overflow-y: hidden;
    line-height: 1.5;
    min-height: 36px;
    max-height: calc(1.5em * 3 + 16px);
    display: block;
    padding-top: 8px;
    padding-bottom: 8px;
    transition: all 0.4s;
}

.footer-input::placeholder {
    color: #bbb;
}

.footer-input:focus {
    border: 1px solid rgb(var(--main-color));
}

.footer-input:disabled {
    background: #f0f0f0;
    color: #aaa;
}

.footer-send-btn {
    width: 38px;
    height: 38px;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(135deg, #6a7fc1, #8a6fc1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.footer-send-btn:hover {
    opacity: 0.85;
}

.footer-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.footer-send-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* ===== 觸發按鈕 ===== */
.ai-trigger-btn {
    position: relative;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #1565c8;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
    z-index: 1000;
    overflow: visible;
}

.ai-trigger-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(100, 100, 200, 0.55);
}

.ai-trigger-btn svg {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 0 3px #fff);
    transition: all 0.4s;
}

.ai-trigger-btn:hover svg,
.ai-trigger-btn.open svg {
    filter: drop-shadow(0 0 5px #fff);
}

.ai-trigger-btn::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #ff6ec7,
        #a855f7,
        #4ea8e8,
        #34d399,
        #fbbf24,
        #ff6ec7
    );
    z-index: -1;
    animation: border-spin 4s linear infinite;
}

.ai-trigger-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #1565c8;
    z-index: -1;
    transition: background 0.3s;
}

.ai-trigger-btn:hover::after {
    background: #1a72d8;
}

.ai-trigger-btn.open {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(100, 100, 200, 0.55);
}

@keyframes border-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@media screen and (max-width: 600px) {
    .ai-chat-box.active {
        width: 95%;
    }
}
