/* Floating chat button */
.chatbot-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #4a6fa5;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.2s;
}

.chatbot-icon:hover {
    transform: scale(1.1);
}

.chatbot-icon img {
    width: 30px;
    height: 30px;
    filter: brightness(0) invert(1);
}

/* Chat container - initially hidden */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    transform-origin: bottom right;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 999;
}

.chatbot-container.active {
    transform: scale(1);
    opacity: 1;
}

.chat-header {
    background-color: #4a6fa5;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-btn {
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.chat-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.lang-btn {
    color: white !important;
    font-size: 14px !important;
    background-color: transparent !important;
}

.close-btn {
    font-size: 20px;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    background-color: #e6e6e6;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.user-message {
    background-color: #4a6fa5;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    margin-left: auto;
}

.questions-container {
    padding: 10px;
    background-color: white;
    border-top: 1px solid #eee;
    overflow-y: scroll; 
    height: 10em;
    
}

.question-btn {
    display: block;
    width: 100%;
    padding: 8px;
    margin-bottom: 5px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s;
}

.question-btn:hover {
    background-color: #e0e0e0;
}

.welcome-message {
    text-align: center;
    color: #666;
    margin-bottom: 15px;
    opacity: 1;
}

.typing-indicator {
    display: flex;
    padding: 8px 12px;
    background-color: #e6e6e6;
    border-radius: 18px;
    align-self: flex-start;
    margin-bottom: 10px;
    max-width: 60px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #666;
    border-radius: 50%;
    margin: 0 2px;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-5px);
    }
}

/* Responsive styles for mobile devices */
@media (max-width: 576px) {
    .chatbot-icon {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .chatbot-icon img {
        width: 25px;
        height: 25px;
    }
    
    .chatbot-container {
        width: calc(100% - 40px);
        height: 60vh;
        max-height: 500px;
        bottom: 80px;
        right: 20px;
    }
    
    .chat-header {
        padding: 12px 15px;
    }
    
    .chat-btn {
        font-size: 13px;
        padding: 4px;
    }
    
    .close-btn {
        font-size: 18px;
    }
    
    .chat-messages {
        padding: 12px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .question-btn {
        padding: 7px 10px;
        font-size: 14px;
    }
    
    .typing-indicator {
        max-width: 50px;
    }
    
    .typing-dot {
        width: 6px;
        height: 6px;
    }
}

/* Adjustments for very small screens */
@media (max-width: 400px) {
    .chatbot-container {
        height: 55vh;
    }

    .questions-container {
         overflow-y: scroll; 
            height: 7em;
    }
    
    .chat-header {
        padding: 10px 12px;
    }
    
    .chat-header span {
        font-size: 15px;
    }
    
    .chat-btn {
        font-size: 12px;
    }
    
    .close-btn {
        font-size: 16px;
    }
}