/* Chatbot Container */
#chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
}

#chatbot-container.open {
    transform: translateY(0);
    opacity: 1;
}

#chatbot-container.closed {
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-title {
    font-weight: 600;
    font-size: 16px;
}

#close-chatbot {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

/* Chat Messages Area */
#chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    animation: fadeIn 0.3s ease-out;
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
}

.message-content {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.bot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    flex-shrink: 0;
}

.bot-animation {
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>') center no-repeat;
    animation: pulse 2s infinite;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #4b5563;
    flex-shrink: 0;
}

.message-text {
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.bot-message .message-text {
    background: white;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 5px;
    color: #1f2937;
}

.user-message .message-text {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

/* Typing Indicator */
.typing-indicator .message-text {
    background: transparent;
    border: none;
    padding: 0;
}

.typing-dots {
    display: flex;
    gap: 5px;
    padding: 10px 15px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    display: inline-block;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

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

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

/* Chat Input Area */
.chatbot-input-area {
    padding: 15px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    background: white;
}

#chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s;
}

#chat-input:focus {
    border-color: #3b82f6;
}

#send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

#send-button:hover {
    transform: scale(1.05);
}

/* Language Toggle */
.chatbot-language-toggle {
    padding: 0 15px 10px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.chatbot-language-option {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.chatbot-language-option.active {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
}

/* Chatbot Button */
#chatbot-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
    z-index: 1000;
    transition: all 0.3s;
}

#chatbot-button.active {
    transform: rotate(360deg);
}

#chatbot-button i {
    font-size: 24px;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* Responsive Design */
@media (max-width: 480px) {
    #chatbot-container {
        width: 90%;
        right: 5%;
        bottom: 80px;
        height: 60vh;
    }
    
    #chatbot-button {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
}