/* AICT RAG Chatbot Styles */
#aict-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#aict-chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#aict-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
}

#aict-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s, transform 0.3s;
}

#aict-chatbot-window.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

#aict-chatbot-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
}

#aict-chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    line-height: 1;
}

#aict-chatbot-close:hover {
    opacity: 1;
}

#aict-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

.aict-message.user {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.aict-message.assistant {
    background: #f1f5f9;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.aict-message.loading {
    background: #f1f5f9;
    color: #64748b;
}

.aict-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.aict-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.aict-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.aict-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

#aict-chatbot-input-area {
    display: flex;
    padding: 16px;
    gap: 8px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

#aict-chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#aict-chatbot-input:focus {
    border-color: #6366f1;
}

#aict-chatbot-send {
    padding: 12px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#aict-chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

#aict-chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Welcome message */
.aict-welcome {
    text-align: center;
    color: #64748b;
    padding: 20px;
}

.aict-welcome h3 {
    color: #1e293b;
    margin: 0 0 8px 0;
}

.aict-welcome p {
    margin: 0;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
    #aict-chatbot-window {
        width: calc(100vw - 20px);
        right: -10px;
        bottom: 70px;
        height: calc(100vh - 100px);
    }

    #aict-chatbot-toggle {
        width: 50px;
        height: 50px;
    }
}
