
/* Chatbot Button */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

.open-button {
    background-color: #3F3EED;
    color: white;
    padding: 12px 20px;
    border: none;
    cursor: pointer;
    border-radius: 50px;
    font-size: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s;
}

.open-button:hover {
    background-color: #0056b3;
}

/* Chatbot Popup */
.chat-popup {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 350px;
    height: 500px;
    max-height: 500px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
}

/* Header */
.chat-header {
    background-color: #3F3EED;
    color: white;
    padding: 20px 10px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h6 {
    margin: 0;
    font-size: 18px;
    white-space: nowrap !important; /* Prevent text from breaking into multiple lines */
    color: white;
    font-family: "Space Grotesk", sans-serif;
    line-height: 1.4074;
    flex-grow: 1; /* This allows the header text to take up remaining space */
    text-align: left;
}


.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.3s;
    text-align: right;
}


.close-btn:hover {
    color: #ccc;
}


/* Chat Box */
.chat-box {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    overflow-x: auto;
    background-color: #f9f9f9;
}


/* Chat Messages */
.chat-message {
    display: flex;
    margin-bottom: 15px;
}


.chat-message.user {
    justify-content: flex-end;
}


.chat-message.bot {
    justify-content: flex-start;
}


.chat-message .avatar {
    width: 30px;
    height: 30px;
    margin: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}


.chat-message.user .avatar i {
    color: #3F3EED;
}


.chat-message.bot .avatar i {
    color: #375A64;
}


.chat-message p {
    max-width: 70%;
    margin: 4px;
    padding: 10px 10px;
    border-radius: 20px;
    position: relative;
    color: #375A64;

    /* Enable text wrapping */
    overflow-wrap: break-word; /* Allows breaking long words */
    word-break: break-word;    /* Ensures words break at appropriate points */
    /*white-space: pre-wrap;     /* Preserves whitespace and wraps text */
}


.chat-message.user p {
    background-color: #3F3EED;
    color: white;
    border-bottom-right-radius: 0;
}


.chat-message.bot p {
    background-color: #FAFAFA;
    color: black;
    border-bottom-left-radius: 0;
}



/* Input Area */
.input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
    background-color: #f1f1f1;
}


/* Styling the Textarea */
.input-container textarea {
    flex: 1;
    padding: 10px 10px;    
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
    transition: border-color 0.3s;
    resize: none; /* Prevents resizing */
    height: 50px; /* Fixed height */
    font-size: 14px; /* Consistent font size */
    overflow: hidden; /* Hides scrollbars */
}


/* Focus State for Textarea */
.input-container textarea:focus {
    border-color: #3F3EED;
}


/* Send Button */
.send-btn {
    background-color: #3F3EED;
    color: white;
    border: none;
    margin-left: 10px;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    width: auto;
}


.send-btn:hover {
    background-color: #0056b3;
}


.send-btn i {
    font-size: 16px;
}


/* Responsive Design */
@media (max-width: 400px) {
    .chat-popup {
        width: 90%;
        right: 5%;
    }
}


/* Focus States */
.open-button:focus,
.close-btn:focus,
.send-btn:focus,
.input-container textarea:focus {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}


/* Loading Spinner */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FFBF00;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    margin-top: 7px;
    margin-left: 10px;
}


@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
