/* Chatbot — portal classic (CSS variables from tokens + skins) */

.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: var(--font-ui, "Be Vietnam Pro", "Segoe UI", sans-serif);
}

.chatbot-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--gold-hi), var(--gold));
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    transition: transform .2s var(--ease, ease), box-shadow .2s;
    position: relative;
}

.chatbot-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.chatbot-icon .chatbot-glyph {
    font-size: 26px;
    line-height: 1;
    color: var(--ink);
}

.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--crimson);
    color: var(--gold-hi);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.chatbot-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    height: 600px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 2px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96);
    opacity: 0;
    transition: all 0.25s var(--ease, ease);
}

.chatbot-window-open {
    transform: scale(1);
    opacity: 1;
}

.chatbot-header {
    background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
    color: var(--gold-hi);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-header-left .chatbot-glyph {
    font-size: 22px;
    line-height: 1;
    color: var(--gold);
}

.chatbot-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-display, Cinzel, serif);
    letter-spacing: .04em;
    color: var(--gold-hi);
}

.chatbot-status {
    font-size: 11px;
    color: var(--muted);
}

.chatbot-header-actions {
    display: flex;
    gap: 6px;
}

.chatbot-minimize,
.chatbot-close {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--gold-hi);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s;
    padding: 0;
    font-size: 16px;
    line-height: 1;
}

.chatbot-minimize:hover,
.chatbot-close:hover {
    background: rgba(201, 162, 39, 0.12);
    border-color: var(--gold);
}

.chatbot-quick-questions {
    background: rgba(11, 14, 20, 0.55);
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    max-height: 180px;
    overflow-y: auto;
}

.quick-question-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.quick-question-btn {
    display: block;
    width: 100%;
    background: rgba(22, 26, 34, 0.9);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 9px 12px;
    margin-bottom: 7px;
    border-radius: 2px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}

.quick-question-btn:hover {
    background: rgba(201, 162, 39, 0.12);
    color: var(--gold-hi);
    border-color: var(--gold);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--ink);
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar { width: 6px; }
.chatbot-messages::-webkit-scrollbar-track { background: var(--ink-2); }
.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 2px;
}

.chatbot-message {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    animation: chatbotSlideIn 0.25s ease;
}

@keyframes chatbotSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 2px;
    background: var(--ink-3);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.message-text {
    background: var(--ink-2);
    padding: 11px 14px;
    border-radius: 2px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
    border: 1px solid var(--line);
    word-wrap: break-word;
}

.message-text strong { color: var(--gold-hi); }

.message-time {
    font-size: 11px;
    color: var(--muted);
    margin-top: 5px;
    padding: 0 2px;
}

.bot-message .message-text {
    background: var(--ink-2);
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    background: rgba(201, 162, 39, 0.18);
    border-color: var(--gold);
}

.user-message .message-content {
    align-items: flex-end;
}

.user-message .message-text {
    background: linear-gradient(180deg, rgba(201, 162, 39, 0.28), rgba(201, 162, 39, 0.12));
    color: var(--text);
    border-color: var(--gold);
}

.user-message .message-time {
    text-align: right;
}

.typing-indicator .message-text {
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.typing-dots {
    display: flex;
    gap: 5px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    animation: chatbotTyping 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatbotTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
    30% { transform: translateY(-7px); opacity: 1; }
}

.chatbot-input-container {
    display: flex;
    padding: 12px 14px;
    background: var(--ink-2);
    border-top: 1px solid var(--line);
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 11px 14px;
    font-size: 14px;
    outline: none;
    background: var(--ink);
    color: var(--text);
    font-family: inherit;
    transition: border-color .15s;
}

.chatbot-input::placeholder {
    color: var(--muted);
}

.chatbot-input:focus {
    border-color: var(--gold);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--gold-hi), var(--gold));
    border: 1px solid var(--line);
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s, filter .15s;
    padding: 0;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.chatbot-send .chatbot-glyph {
    font-size: 18px;
    line-height: 1;
}

.chatbot-footer {
    background: var(--ink-3);
    padding: 8px;
    text-align: center;
    border-top: 1px solid var(--line);
}

.chatbot-footer small {
    color: var(--muted);
    font-size: 11px;
}

@media screen and (max-width: 768px) {
    .chatbot-container { bottom: 10px; right: 10px; }
    .chatbot-icon { width: 52px; height: 52px; }
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        bottom: 10px;
        right: 10px;
        max-width: 400px;
        max-height: 600px;
    }
}

@media screen and (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 10px);
        height: calc(100vh - 80px);
        bottom: 5px;
        right: 5px;
    }
}
