/* Chatbot Container */
#chatbot-container {
    position: fixed;
    bottom: 5px;
    right: 5px;
    width: 330px;
    z-index: 9999;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.chatbot-content-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100% - 60px); /* Account for header/input */
}
/* Chatbot Box */
/* #chatbot-box {
    display: flex;
    flex-direction: column;
    height: 500px;
    background-color: #fff;
    border: 1px solid #e1e1e1;
} */
#chatbot-box {
    display: flex;
    flex-direction: column;
    max-height: 500px; /* Changed from fixed height */
    min-height: 150px; /* Minimum height when empty */
    background-color: #fff;
    border: 1px solid #e1e1e1;
}

/* Chatbot Header */
#chatbot-box .chatbot-header-tog {
    background-color: #393939;
    color: white;
    margin: 0;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#chatbot-box #chatbot-header-tog-dark {
    background-color: #000000 !important;
}
#chatbot-box .chatbot-header-tog .chatbot-header-text {
    font-size: 20px;
    margin-left: 0px;
    margin-right: 33px;
}

/* Chatbot Icon */
#chatbot-box .chatbot-header-tog .chatbot-icon {
    display: inline-block;
    width: 45px;
    height: 45px;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 10px;
}

#chatbot-box .chatbot-header-tog .chatbot-icon img {
    width: 100%;
    height: auto;
}

/* Close Button */
#chatbot-close {
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    margin-right: 3px;
}

.chatbot-content-wrapper #chatbot-history {
    flex: 1 1 auto; /* Changed to grow/shrink as needed */
    padding: 15px;
    overflow-y: auto;
    background-color: #f8f8f8;
    min-height: 50px; 
    scroll-behavior: smooth;
    overflow-anchor: none; 
}
.chatbot-content-wrapper .chatbot-history-dark {
    background-color: #000000 !important;
}
/* Message Styles */
.bot-message, .user-message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

/* #chatbot-send:hover {
    background-color: #ffffff;
    color: #001234;
    border: 2px solid #001234;
} */

.bot-message {
    background-color: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 0 18px 18px 18px;
    margin-right: auto;
}

.user-message {
    background-color: #393939;
    color: white;
    border-radius: 18px 0 18px 18px;
    margin-left: auto;
}

#chatbot-input-area {
    display: flex;
    padding: 10px;
    background-color: #fff;
    border-top: 1px solid #e1e1e1;
    padding: 10px 12px;
    margin-bottom: 22px; 
}

#chatbot-input-area #end-chat-link {
        position: absolute;
        /* Position below chat input – tested across screen sizes. Adjust if input height changes */
        bottom: -103px;
        margin: 104px;
        margin-bottom: 101px;
        display: none;
    }

.chatbot-input-area-dark{
    background-color: #000000 !important;
}
#chatbot-input {
    flex: 1;
    padding: 20px 20px;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    outline: none;
    font-size: 14px;
}

#chatbot-input:focus {
    border-color: #393939;
}

#chatbot-send {
    background-color: #d94a4a;
    color: white;
    border: none;
    border-radius: 0px;
    padding: 10px 15px;
    margin-left: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

/* #chatbot-send:hover {
    background-color: #001234;
} */

/* Product Links in Chat */
.bot-message a {
    color: #393939;
    text-decoration: underline;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    padding: 10px 15px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #ccc;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: bounce 1.5s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

#chatbot-input-area #voiceBtn {
    right: 93px;
    position: absolute;
    cursor: pointer;
    transform: translateY(27%);
}

#chatbot-input-area #voiceBtn img {transition: box-shadow 0.3s ease;}
#chatbot-input-area #voiceBtn:hover img {
  box-shadow: 0 0 8px #393939;
}

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Responsive Design */
@media (max-width: 480px) {
    #chatbot-container {
        width: 90%;
        right: 5%;
        bottom: 10px;
    }
    
    #chatbot-box {
        height: 400px;
    }
}