/* AI Chatbot Widget */
.chatbot-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37,99,235,0.4);
    z-index: 9998;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chatbot-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37,99,235,0.5);
}

.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 480px;
    max-height: 70vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.2);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.3s ease;
}
.chatbot-window.active { display: flex; }

@keyframes chatSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.chatbot-header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chatbot-header-info { display: flex; align-items: center; gap: 10px; }
.chatbot-avatar { font-size: 1.5rem; }
.chatbot-name { color: #fff; font-weight: 700; font-size: 0.9rem; }
.chatbot-status { color: #10b981; font-size: 0.7rem; }
.chatbot-close { background: none; border: none; color: #94a3b8; font-size: 1.5rem; cursor: pointer; }

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.bot { justify-content: flex-start; }

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-break: break-word;
}
.chat-msg.user .chat-bubble {
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg.bot .chat-bubble {
    background: #f1f5f9;
    color: #334155;
    border-bottom-left-radius: 4px;
}

.typing-dots {
    animation: blink 1.2s infinite;
    color: #94a3b8;
}
@keyframes blink { 50% { opacity: 0.3; } }

.chatbot-input {
    padding: 12px 14px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
}
.chatbot-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    outline: none;
}
.chatbot-input input:focus { border-color: #2563eb; }
.chatbot-input button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chatbot-input button:hover { background: #1d4ed8; }

/* Dark mode */
body.dark-mode .chatbot-window { background: #1e293b; }
body.dark-mode .chat-msg.bot .chat-bubble { background: #334155; color: #e2e8f0; }
body.dark-mode .chatbot-input { border-top-color: #334155; }
body.dark-mode .chatbot-input input { background: #0f172a; border-color: #334155; color: #f1f5f9; }

@media (max-width: 480px) {
    .chatbot-window { bottom: 0; right: 0; left: 0; width: 100%; max-width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; }
    .chatbot-fab { bottom: 16px; right: 16px; }
}
