/* Chatbot Floating Button */
.chatbot-button {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 55px !important;
    height: 25px !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    z-index: 999999 !important;
    transition: all 0.3s !important;
}

.chatbot-button:hover {
    transform: scale(1.1) !important;
}

.chatbot-button i {
    font-size: 25px !important;
    color: white !important;
}

/* Chatbot Window - Desktop */
.chatbot-window {
    position: fixed !important;
    bottom: 90px !important;
    right: 20px !important;
    width: 360px !important;
    height: 220px !important;
    background: white !important;
    border-radius: 15px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2) !important;
    display: none !important;
    flex-direction: column !important;
    z-index: 999998 !important;
    overflow: hidden !important;
}

.chatbot-window.open {
    display: flex !important;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    padding: 10px 15px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.chatbot-header h3 {
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.close-btn {
    background: none !important;
    border: none !important;
    color: white !important;
    font-size: 18px !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 25px !important;
    height: 25px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Messages Area */
.chatbot-messages {
    flex: 1 !important;
    padding: 10px !important;
    overflow-y: auto !important;
    background: #f8f9fa !important;
    max-height: 320px !important;
}

/* Custom Scrollbar */
.chatbot-messages::-webkit-scrollbar {
    width: 4px !important;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #667eea !important;
    border-radius: 5px !important;
}

/* Message Bubbles */
.message {
    margin-bottom: 10px !important;
    display: flex !important;
}

.message.user {
    justify-content: flex-end !important;
}

.message.bot {
    justify-content: flex-start !important;
}

.message .bubble {
    max-width: 80% !important;
    padding: 8px 12px !important;
    border-radius: 18px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    word-wrap: break-word !important;
}

.message.user .bubble {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    border-bottom-right-radius: 4px !important;
}

.message.bot .bubble {
    background: white !important;
    color: #333 !important;
    border-bottom-left-radius: 4px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

/* Typing Indicator */
.typing-indicator {
    display: flex !important;
    gap: 4px !important;
    padding: 8px 12px !important;
    background: white !important;
    border-radius: 18px !important;
    width: fit-content !important;
}

.typing-indicator span {
    width: 6px !important;
    height: 6px !important;
    background: #999 !important;
    border-radius: 50% !important;
    animation: typing 1.4s infinite !important;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* Input Area */
.chatbot-input {
    display: flex !important;
    padding: 10px !important;
    background: white !important;
    border-top: 1px solid #e0e0e0 !important;
    gap: 8px !important;
}

.chatbot-input input {
    flex: 1 !important;
    padding: 8px 12px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 20px !important;
    outline: none !important;
    font-size: 12px !important;
}

.chatbot-input input:focus {
    border-color: #667eea !important;
}

.chatbot-input button {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    border: none !important;
    border-radius: 20px !important;
    padding: 8px 12px !important;
    cursor: pointer !important;
    font-size: 12px !important;
}

/* ============================================ */
/* RESPONSIVE FOR MOBILE DEVICES */
/* ============================================ */

/* Mobile phones */
@media (max-width: 576px) {
    .chatbot-button {
        bottom: 15px !important;
        right: 15px !important;
        width: 50px !important;
        height: 50px !important;
    }
    
    .chatbot-button i {
        font-size: 22px !important;
    }
    
    .chatbot-window {
        position: fixed !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 380px !important;
        border-radius: 15px 15px 0 0 !important;
        bottom: 0 !important;
        top: auto !important;
    }
    
    .chatbot-header {
        padding: 10px 15px !important;
    }
    
    .chatbot-header h3 {
        font-size: 14px !important;
    }
    
    .chatbot-messages {
        max-height: 280px !important;
    }
    
    .message .bubble {
        max-width: 85% !important;
        font-size: 12px !important;
        padding: 8px 12px !important;
    }
}

/* Tablets */
@media (min-width: 577px) and (max-width: 768px) {
    .chatbot-window {
        width: 360px !important;
        height: 420px !important;
        bottom: 80px !important;
        right: 20px !important;
    }
}

/* Desktop */
@media (min-width: 769px) {
    .chatbot-window {
        width: 360px !important;
        height: 420px !important;
        bottom: 90px !important;
        right: 30px !important;
    }
}

/* Landscape mode fix */
@media (max-height: 500px) and (orientation: landscape) {
    .chatbot-window {
        height: 320px !important;
    }
    
    .chatbot-messages {
        max-height: 200px !important;
    }
}