/* CHATBOT TOGGLE BUTTON */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 90px; 
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #323f7c 100% ); 
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    background: #2a3569;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.chatbot-tooltip {
    position: absolute;
    bottom: 70px;
    background: #323f7c;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.chatbot-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #323f7c transparent transparent transparent;
}

.chatbot-toggle:hover .chatbot-tooltip {
    opacity: 1;
    visibility: visible;
}

/* CHAT WINDOW */
.chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    display: none;
    z-index: 999998;
}

.chat-container.active {
    display: flex;
}

/* CHAT HEADER */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #323f7c 100% );
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.chat-title i {
    font-size: 20px;
}

.close-chat {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-chat:hover {
    background: rgba(255,255,255,0.3);
}

/* MESSAGES AREA */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* MESSAGE BUBBLES */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    animation: fadeIn 0.3s ease;
}

.bot-message {
    align-self: flex-start;
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 5px;
}

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea 0%, #323f7c 100% );
    color: white;
    border-bottom-right-radius: 5px;
}

.message-content {
    word-wrap: break-word;
    line-height: 1.4;
    
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

/* TYPING INDICATOR */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    width: fit-content;
    border: 1px solid #e0e0e0;
    align-self: flex-start;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #323f7c;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

/* INPUT AREA */
.chat-input-area {
    border-top: 1px solid #e0e0e0;
    padding: 15px;
    background: white;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#userInput {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 15px;
    color: #333;
}

#userInput:focus {
    border-color: #323f7c;
}

#sendButton {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #323f7c 100% );
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#sendButton:hover {
    transform: scale(1.05);
}

#sendButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.disclaimer {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 8px;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .chat-container {
        width: calc(100% - 40px);
        height: 70vh;
        right: 20px;
        left: 20px;
        bottom: 90px;
    }
    
    .chatbot-container {
        right: 80px;
        bottom: 20px;
    }
}
