/* chatbot.css */
#ai-chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 32px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

#ai-chatbot-container.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.chatbot-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007BFF, #00C6FF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.chatbot-name-status {
    display: flex;
    flex-direction: column;
}

.chatbot-name {
    font-weight: 600;
    font-size: 15px;
    color: #111;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chatbot-actions {
    display: flex;
    gap: 8px;
}

.chatbot-action-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.chatbot-action-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #111;
}

.refresh-spin {
    animation: spin 0.5s linear;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.user {
    align-self: flex-end;
    background: #007BFF;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.bot {
    align-self: flex-start;
    background: white;
    color: #333;
    border: 1px solid rgba(0,0,0,0.05);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.chatbot-input-area {
    padding: 16px;
    background: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: rgba(255, 255, 255, 0.9);
}

.chatbot-input:focus {
    border-color: #007BFF;
}

.chatbot-send-btn {
    background: #007BFF;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.chatbot-send-btn:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

.chatbot-send-btn:active {
    transform: scale(0.95);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    display: none;
}

.typing-indicator.active {
    display: flex;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Markdown Styles (.chat-markdown) */
.chat-markdown p {
    line-height: 1.6;
    margin-bottom: 8px;
}
.chat-markdown p:last-child {
    margin-bottom: 0;
}
.chat-markdown ul, .chat-markdown ol {
    margin-left: 20px;
    margin-bottom: 8px;
}
.chat-markdown ul { list-style-type: disc; }
.chat-markdown ol { list-style-type: decimal; }
.chat-markdown li {
    margin-bottom: 4px;
}
.chat-markdown strong {
    font-weight: 700;
    color: #0056b3;
}
.chat-markdown code {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Fira Code', 'Consolas', monospace;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}
.chat-markdown pre {
    background: #1e1e1e;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 8px;
}
.chat-markdown pre code {
    background: transparent;
    padding: 0;
    color: #d4d4d4;
}
.chat-markdown blockquote {
    border-left: 3px solid #ccc;
    padding-left: 12px;
    color: #666;
    margin-left: 0;
    margin-bottom: 8px;
    font-style: italic;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #ai-chatbot-container {
        width: calc(100% - 32px);
        right: 16px;
        bottom: 70px;
        height: 500px;
    }
}
