/* ═══════════════════════════════════════════════════════════════
   E&I SEs AI Assistant — Chat Widget CSS
   Design: Deep Navy + Gold — matches eitcsp.com brand
   ═══════════════════════════════════════════════════════════════ */

.eitcsp-chat-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a1628, #152240);
    border: 2px solid #c8a84e;
    color: #c8a84e;
    font-size: 24px;
    cursor: pointer;
    z-index: 99998;
    box-shadow: 0 4px 24px rgba(200, 168, 78, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.eitcsp-chat-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 32px rgba(200, 168, 78, 0.35);
}
.eitcsp-chat-trigger.hidden { display: none; }

.eitcsp-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 140px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(10, 22, 40, 0.25);
    z-index: 99999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(200, 168, 78, 0.3);
    font-family: 'Segoe UI', system-ui, -apple-system, 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
}
.eitcsp-chat-window.open { display: flex; }

.eitcsp-chat-header {
    background: linear-gradient(135deg, #0a1628, #152240);
    color: #c8a84e;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(200, 168, 78, 0.2);
    flex-shrink: 0;
}
.eitcsp-chat-header span {
    display: flex;
    align-items: center;
    gap: 8px;
}
.eitcsp-chat-close {
    background: none;
    border: none;
    color: #c8a84e;
    cursor: pointer;
    font-size: 20px;
    padding: 2px 6px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.eitcsp-chat-close:hover { opacity: 1; }

.eitcsp-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f7f6f3;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.eitcsp-chat-body::-webkit-scrollbar { width: 4px; }
.eitcsp-chat-body::-webkit-scrollbar-thumb { background: #d2d2d7; border-radius: 4px; }

.eitcsp-chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.55;
    animation: eitcspFadeIn 0.25s ease;
}
@keyframes eitcspFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.eitcsp-chat-msg.assistant {
    align-self: flex-start;
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid #e8e8ed;
    border-bottom-left-radius: 4px;
}
.eitcsp-chat-msg.user {
    align-self: flex-end;
    background: #0a1628;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}
.eitcsp-chat-msg.typing {
    align-self: flex-start;
    background: #ffffff;
    color: #888;
    border: 1px solid #e8e8ed;
    font-style: italic;
    border-bottom-left-radius: 4px;
}

.eitcsp-chat-input-wrap {
    display: flex;
    padding: 12px 16px;
    border-top: 1px solid #e8e8ed;
    background: #ffffff;
    gap: 8px;
    flex-shrink: 0;
}
.eitcsp-chat-input-wrap input {
    flex: 1;
    border: 1px solid #d2d2d7;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.eitcsp-chat-input-wrap input:focus {
    border-color: #c8a84e;
}
.eitcsp-chat-input-wrap button {
    background: linear-gradient(135deg, #0a1628, #152240);
    color: #c8a84e;
    border: 1px solid #c8a84e;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.eitcsp-chat-input-wrap button:hover { transform: scale(1.05); }
.eitcsp-chat-input-wrap button:disabled { opacity: 0.5; cursor: default; transform: none; }

.eitcsp-chat-disclaimer {
    font-size: 10px;
    color: #aaa;
    text-align: center;
    padding: 4px 16px 8px;
    background: #ffffff;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .eitcsp-chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .eitcsp-chat-trigger {
        bottom: 16px;
        right: 16px;
    }
}
