/* 
 * Chatbot ChatGPT for WordPress - Stylesheet
 * 
 * This CSS file contains styles for the Chatbot ChatGPT plugin.
 * It includes styles for the chatbot interface, messages, and other UI elements.
 * 
 * Customize these styles to match your website's design.
 *
 */

/* Avatar Settings - Ver 1.5.0 */
.chatbot-avatar {
    width: 60px;
    height: 60px;
    /* margin: -20px; */
    /* margin: -10px -5px -10px -5px;  top, right, bottom, left */
}

/* Avatar Settings - Ver 1.5.0 */
.chatbot-bubble {
    background-color: #f0f0f0; /* Very light gray background */
    color: #000; /* Black text */
    border-radius: 5px;
    padding: 10px;
    margin: 10px;
    font-size: 14px;
    min-width: 150px; /* Minimum width of the bubble */
    max-width: 300px; /* Maximum width of the bubble */
    word-wrap: break-word;
    position: absolute;
    right: 80px; /* Adjust this value as needed */
    /* top: -3px; Adjust this value as needed */
    z-index: 100;
    white-space: normal; /* This will allow the text to wrap and resize the bubble */
    display: inline-block; /* This makes the width of the bubble adapt to its content, up to max-width */
    font-family: sans-serif;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16); /* Faint shadow */
}

#chatgpt-open-btn.avatar-icon {
    padding: 5px;
}

#chatgpt-open-btn.dashicon {
    /* Padding was increase from 15px to 25px after adding avatars - Ver 1.5.0 */
    padding: 25px;
}

/* Reset font family for Dashicons */
#chatgpt-open-btn {
    position: relative;
    font-family: dashicons;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Set font family to sans-serif for all text within the plugin */
.chatbot-container * {
    font-family: sans-serif;
}

#chatbot-chatgpt {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 300px;
    height: 450px;
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    /* Add z-index - Ver 1.2.1 */
    z-index: 100;
}

/* Wide - Ver 1.4.2 */
#chatbot-chatgpt.wide {
    width: 500px;
}

#chatbot-chatgpt-header {
    background-color: #222;
    color: #fff;
    padding: 10px;
    font-size: 16px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

#chatbot-chatgpt-conversation {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
}

#chatbot-chatgpt-input {
    display: flex;
    padding: 10px;
}

#chatbot-chatgpt-message {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 5px;
}

#chatbot-chatgpt-submit {
    background-color: #222;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 6px 12px;
    margin-left: 5px;
    cursor: pointer;
}

/* CSS for append message */
.chat-message {
    margin: 5px;
    padding: 5px;
    max-width: 100%;
    word-wrap: break-word;
}

.user-message {
    text-align: right;
}

.user-text {
    display: inline-block;
    background-color: #007bff;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 12px;
    border-bottom-right-radius: 0;
    overflow-wrap: anywhere;
}

.bot-message {
    text-align: left;
}

.bot-text {
    display: inline-block;
    /* font-weight: bold; */
    background-color: #5BC236;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 12px;
    border-bottom-left-radius: 0;
    overflow-wrap: anywhere;
}

.error-message {
    text-align: center;
}

.error-text {
    color: red;
    font-weight: bold;
}

.message-space {
    height: 10px;
}

/* Collapse chatbot upon user request */
.chatbot-collapse-btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 1.5%;
    right: 2%;
    background-color: #007bff;
    border: none;
    cursor: pointer;
    text-align: center;
    padding: 15px;
    border-radius: 10%;
}

.chatbot-collapse-btn:hover {
    background-color: #0257b3;    
}

.chatbot-collapsed {
    width: 48px;
    height: 48px;
    background-color: #007bff;
    border-radius: 50%;
    cursor: pointer;
    display: none;
}

/* Show the chatbot open button in the lower right corner of the window */
#chatbot-open-btn {
    position: fixed;
    bottom: 5%;
    right: 5%;
    background-color: #ec2d2d;
    border: none;
    cursor: pointer;
    padding: 5px;
    float: right;
}

#chatgpt-open-btn {
    position: fixed;
    bottom: 2%;
    right: 2%;
    background-color: #007bff;
    border: none;
    cursor: pointer;
    padding: 15px;
    float: right;
    box-shadow: 2px 4px 15px rgb(102, 92, 143);
    border-radius: 10%;
    /* Add z-index - Ver 1.2.1 */
    z-index: 100;
}

#chatgpt-open-btn:hover {
    background-color: #0257b3;
}

#chatgptTitle.title {
    color: white;
    font-size: 30px;
    /* font-weight: 300; */
}

.typing-indicator {
    display: inline-flex; /* Changed from flex to inline-flex */
    justify-content: flex-start;
    background-color: #5BC236; /* Match the green background color */
    border-radius: 12px; /* Match the border radius */
    padding: 5px 10px; /* Match the padding */
    border-bottom-left-radius: 0; /* Match the border-bottom-left-radius */
}

.typing-dot {
    margin-right: 3px;
    animation: typing 1s infinite;
    color: #ffffff; /* Match the white color of the dots */
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}