/* ===== Chatbot Widget ===== */
#chatbot-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    height: 48px;
    padding: 0 18px 0 14px;
    margin: 0;
    background: #f9966f;
    border-radius: 24px;
    border: none;
    cursor: pointer;
    z-index: 9999;
    box-sizing: border-box;
    box-shadow: 0 4px 16px rgba(249,150,111,0.45);
    display: flex;
    align-items: center;
    gap: 9px;
    transition: transform 0.2s, box-shadow 0.2s;
}
#chatbot-toggle:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 22px rgba(249,150,111,0.55);
}
#chatbot-toggle .chat-icon-group { display: flex; align-items: center; gap: 8px; }
#chatbot-toggle .chat-icon-group i { font-size: 16px; color: #fff; }
#chatbot-toggle .toggle-label { font-size: 13px; font-weight: 600; color: #fff; }
#chatbot-toggle .close-icon { display: none; font-size: 16px; color: #fff; }
#chatbot-toggle.open .chat-icon-group { display: none; }
#chatbot-toggle.open .close-icon { display: block; }
#chatbot-toggle.open { padding: 0 18px; }

#chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 28px;
    width: 400px;
    max-width: calc(100vw - 40px);
    max-height: 580px;
    background: #1a1a1a;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.45);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}
#chatbot-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

#chatbot-header {
    background: #f9966f;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
#chatbot-header .avatar {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
#chatbot-header .avatar i { font-size: 16px; color: #fff; }
#chatbot-header .info { flex: 1; min-width: 0; }
#chatbot-header .name { font-weight: 700; font-size: 13px; color: #fff; line-height: 1.2; }
#chatbot-header .subtitle { font-size: 11px; color: rgba(255,255,255,0.8); }

#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}
#chatbot-messages::-webkit-scrollbar { width: 4px; }
#chatbot-messages::-webkit-scrollbar-track { background: transparent; }
#chatbot-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

.chat-msg.bot {
    max-width: 100%;
}
.chat-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.chat-msg.bot {
    background: #2a2a2a;
    color: #e8e8e8;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-msg.user {
    background: #f9966f;
    color: #fff;

    border-bottom-right-radius: 4px;
}
.chat-msg.typing {
    background: #2a2a2a;
    color: #888;
    align-self: flex-start;
    font-style: italic;
}
.chat-msg.bot ul { margin: 6px 0 2px 0; padding-left: 18px; }
.chat-msg.bot li { margin-bottom: 4px; }
.chat-msg.bot strong { color: #f9966f; font-weight: 600; }

#chatbot-input-area {
    padding: 10px 12px;
    background: #111;
    display: flex;
    gap: 6px;
    border-top: 1px solid #2a2a2a;
    align-items: center;
    flex-shrink: 0;
}
#chatbot-input {
    flex: 1;
    align-self: center;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #e8e8e8;
    outline: none;
    resize: none;
    overflow: hidden;
    line-height: 1.4;
    height: 36px;
    max-height: 80px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: inherit;
    display: block;
    -webkit-appearance: none;
    appearance: none;
}
#chatbot-input:focus { border-color: #f9966f; }
#chatbot-input::placeholder { color: #666; }

#chatbot-send {
    background: #f9966f;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    box-shadow: none;
    box-sizing: border-box;
    flex-shrink: 0;
    align-self: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
#chatbot-send i { font-size: 13px; color: #fff; }
#chatbot-send:hover { background: #e87d55; }
#chatbot-send:disabled { background: #444; cursor: not-allowed; }

@media (max-width: 480px) {
    #chatbot-window { width: calc(100vw - 20px); right: 10px; bottom: 80px; }
    #chatbot-toggle {
    padding: 0 18px 0 14px;
    margin: 0;
    box-shadow: 0 4px 16px rgba(249,150,111,0.45);
    box-sizing: border-box; right: 14px; bottom: 14px; }
}
