/* 
 * Kognetiks Chatbot - Stylesheet
 * 
 * This CSS file contains styles for the Chatbot 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;
}

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

/* Padding for Avatars - Ver 1.5.0 */
#chatgpt-open-btn.dashicon {
    padding: 25px;
    font-family: inherit !important;
    height: 20px;
    width: 20px;
}

/* Avatar Settings - Ver 1.5.0 */
.chatbot-bubble {
    background-color: #f0f0f0;
    color: #000000;
    border-radius: 3px;
    padding: 10px 15px; /* Balanced padding */
    margin: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: absolute;
    right: 80px;
    z-index: 100;
    white-space: normal;
    display: inline-block;
    font: inherit !important;
    /*font-family: inherit !important;*/
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    box-sizing: border-box;
    min-width: 300px; /* Minimum width */
    max-width: 500px; /* Maximum width */
    max-height: 100px; /* Maximum height */
    overflow-y: auto; /* Scrollbar for overflow content */
}

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

/* CSS for the chatbot interface */
#chatbot-chatgpt {
    transition: width 0.5s ease, height 0.5s ease;
    width: 1px;
    height: 1px;
    overflow: hidden;
    position: fixed;
    bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    padding-bottom: 10px;
}

/* Support for a floating version of the chatbot - Ver 1.7.1 */
.chatbot-floating-style {
    width: 1px;
    height: 1px;
    overflow: hidden;
    position: fixed;
    bottom: 10px;
    right: 10px;
    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;
    z-index: 100;
    padding-bottom: 10px;
}

/* Support for an embedded version of the chatbot - Ver 1.7.1 */
.chatbot-embedded-style {
    height: 50vh !important; /* Adjust as needed */
    overflow: hidden;
    position: relative !important; /* Keeps bot in the same position */
    margin: 10px auto; /* Centers horizontally and gives margin at top and bottom */
    padding: 10px; /* Adds padding inside the chatbot */
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    left: 0;
    right: 0;
}

/* Removed CSS from JS file - Ver 1.7.3 */
.chatbot-wide {
    width: 500px !important;
    /* height: 450px !important; */
    height: 45vh !important; /* Adjust as needed */
    overflow: visible;
}

/* Removed CSS from JS file - Ver 1.7.3 */
.chatbot-narrow {
    width: 300px !important;
    /* height: 450px !important; */
    height: 45vh !important; /* Adjust as needed */
    overflow: visible;
}

/* Removed CSS from JS file - Ver 1.7.3 */
.chatbot-full {
    width: 100% !important;
    height: 100% !important;
    overflow: visible;
}

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

#chatbot-chatgpt.embedded-width {
    width: 90%;
}

#chatbot-chatgpt-header {
    background-color: #222222;
    color: #ffffff;
    padding: 10px;
    font-size: 16px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#chatbot-chatgpt-header-embedded {
    background-color: #222222;
    color: #ffffff;
    padding: 10px;
    font-size: 16px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#chatbot-chatgpt-conversation {
    flex-grow: 1;
    padding: 10px 10px 10px 20px !important;
    overflow-y: auto;
    max-height: 90vh; /* Adjust the percentage as needed */
}

/* REPLACED IN V2.0.9 WITH BELOW */
/* #chatbot-chatgpt-input {
    display: flex;
    padding: 10px;
    align-content: stretch;
    justify-content: center;
    align-items: center;
} */

/* REPLACED IN V2.0.9 INSTEAD OF ABOVE */
#chatbot-chatgpt-input {
    display: flex;
    justify-content: center;
    align-items: start;
    gap: 5px;
    width: 100%;
}

#chatbot-chatgpt-input-area {
    flex-grow: 1;
    max-width: 95%;
}

#chatbot-chatgpt-message {
    flex-grow: 1;
    border: 1px solid black;
    border-radius: 3px;
    background: ghostwhite;
}

#chatbot-chatgpt-message:focus {
    border: 1px solid black; /* Change this to any color you prefer */
    outline: none; /* This removes the default outline */
}

#chatbot-chatgpt-submit {
    background-color: #f1f1f1;
    border: none;
    border-radius: 1px;
    padding: 1px 1px;
    margin-left: 1px;
    cursor: pointer;
}

#chatbot-chatgpt-buttons-container {
    justify-content: center;
    flex-grow: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

#chatbot-chatgpt-submit:hover {
    background-color: #dcdcdc !important;    
}

/* File Upload Button - Ver 1.7.6 */
#chatbot-chatgpt-upload-file {
    background-color: #f1f1f1;
    border: none;
    border-radius: 1px;
    padding: 1px 1px;
    margin-left: 1px;
    cursor: pointer;
}

#chatbot-chatgpt-upload-file:hover {
    background-color: #dcdcdc !important;    
}

/* File Upload MP3 Button - Ver 2.0.1 */
#chatbot-chatgpt-upload-mp3 {
    background-color: #f1f1f1;
    border: none;
    border-radius: 1px;
    padding: 1px 1px;
    margin-left: 1px;
    cursor: pointer;
}

#chatbot-chatgpt-upload-mp3:hover {
    background-color: #dcdcdc !important;    
}

#chatbot-chatgpt-erase-btn {
    background-color: #f1f1f1;
    border: none;
    border-radius: 1px;
    padding: 1px 1px;
    margin-left: 1px;
    cursor: pointer;
}

#chatbot-chatgpt-erase-btn:hover {
    background-color: #dcdcdc !important;    
}

/* Text to Speech Button - Ver 1.7.6 */
#chatbot-chatgpt-text-to-speech-btn {
    background-color: #f1f1f1;
    border: none;
    border-radius: 1px;
    padding: 1px 1px;
    margin-left: 1px;
    cursor: pointer;
}

#chatbot-chatgpt-text-to-speech-btn:hover {
    background-color: #dcdcdc !important;    
}

#chatbot-chatgpt-download-transcript-btn:hover {
    background-color: #dcdcdc !important; 
}

#chatbot-chatgpt-download-transcript-btn {
    background-color: #f1f1f1;
    border: none;
    border-radius: 1px;
    padding: 1px 1px;
    margin-left: 1px;
    cursor: pointer;
}

/* Speech Recognition Button - Ver 2.1.5.1 */
#chatbot-chatgpt-speech-recognition-btn:hover {
    background-color: #dcdcdc !important; 
}

#chatbot-chatgpt-speech-recognition-btn {
    background-color: #f1f1f1;
    border: none;
    border-radius: 1px;
    padding: 1px 1px;
    margin-left: 1px;
    cursor: pointer;
}

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

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

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

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

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

.error-message {
    display: inline-block;
    background-color: red;
    color: black;
    padding: 5px 10px;
    border-radius: 12px 12px 12px 0;
    overflow-wrap: anywhere;
    font: inherit;
}

.error-text {
    color: black;
    font: inherit;
}

.message-space {
    height: 10px;
}

.chatbot-collapse-btn {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #f1f1f1;
    border: none;
    cursor: pointer;
    text-align: center;
    /* Adjusted padding - Ver 1.8.6 */
    padding: 1px;
    border-radius: 1px;
    justify-content: center;
    flex-wrap: nowrap;
    margin-top: 0;
}

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

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

/* #chatbot-open-btn {
    position: fixed;
    bottom: 5%;
    right: 5%;
    background-color: #ec2d2d;
    border: none;
    cursor: pointer;
    padding: 5px;
    float: right;
    font: inherit;
    font-family: inherit;
} */

/* Reset font family for Dashicons */
#chatgpt-open-btn-dashicon {
    position: relative;
    /* Removed font-family - Ver 1.8.6 */
    /* font-family: dashicons, inherit !important; */
    font-family: inherit !important;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 20px;
    width: 20px;
}

#chatgpt-open-btn {
    transition: width 0.5s ease, height 0.5s ease;
    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%;
    width: 50px;
    z-index: 100;
    font: inherit !important;
    /* Removed font-family - Ver 1.8.6 */
    /* font-family: dashicons, inherit !important; */
    /*font-family: inherit !important;*/
    display: flex; 
    justify-content: center; 
    align-items: center;
}

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

#chatbot-chatgpt-title.title {
    color: #ffffff;
    font-size: inherit;
    flex-grow: 1;
}

.chatbot-typing-indicator {
    display: inline-flex;
    justify-content: flex-start;
    background-color: #5BC236;
    padding: 5px 10px;
    border-radius: 12px 12px 12px 0;
}

.chatbot-typing-dot {
    margin-right: 3px;
    animation: typing 1s infinite;
    color: #ffffff;
}

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

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

.chatbot-attribution {
    text-align: center;
    font-size: 11px;
}

.chatbot-attribution-link {
    text-decoration: none;
    font-size: 10px;
}

.chatbot-attribution-text {
    text-align: center;
    font-size: 11px;
}

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

/* REPLACED IN V2.0.9 WITH BELOW */
/* #chatbot-chatgpt-custom-buttons {
    text-align: center;
} */

/* REPLACED IN V2.0.9 INSTEAD OF ABOVE */
#chatbot-chatgpt-custom-buttons {
    justify-content: center;
    flex-grow: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    padding: 5px;
}

.chatbot-chatgpt-custom-button-class {
    background-color: #3B82F6;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    text-decoration: none;
    align-items: center;
    display: inline-flex;
  }

.chatbot-chatgpt-custom-button-class:hover {
    background-color: #1E3A8A;
}

.chatbot-chatgpt-custom-button-class a {
    color: inherit;
    text-decoration: none !important;
}

.chatbot-chatgpt-custom-button-class a:hover {
    color: inherit;
    text-decoration: none !important;
}

/* Original history class - keep for backward compatibility */
.chatbot-chatgpt-chatbot-history {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 10px;
    background-color: #f1f1f1;
    border-radius: 5px;
    margin: 10px;
}

/* Override for conversation history shortcode date groups */
.chatbot-chatgpt-chatbot-history-wrapper .chatbot-chatgpt-chatbot-history {
    display: block;
    flex-direction: initial;
    align-items: initial;
    justify-content: initial;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
    margin: 0 0 20px 0;
}

/* Added in Version 2.0.3 - 2024 05 29 */
@media only screen and (max-width: 600px) {
    #chatbot-chatgpt-conversation {
        flex-grow: 1;
        padding: 10px;
        overflow-y: auto;
        max-height: 200px; /* Adjust the percentage as needed */
    }
}
    
/* Added in Version 2.0.3 - 2024 05 29 */
@media only screen and (min-width: 600px) {
#chatbot-chatgpt-conversation {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    max-height: 400px; /* Adjust the percentage as needed */
    }
}

/* Added in Version 2.2.7 - 2025 03 17 */
#chatbot-chatgpt-header {
    position: relative;
}

/* Added in Version 2.2.7 - 2025 03 17 */
.chatbot-resize-btn {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #f1f1f1;
    border: none;
    cursor: pointer;
    text-align: center;
    /* Adjusted padding - Ver 1.8.6 */
    padding: 1px;
    border-radius: 1px;
    justify-content: center;
    flex-wrap: nowrap;
    margin-top: 0;
}

.chatbot-resize-btn:hover {
    background-color: #dcdcdc;    
}

/* Added in Version 2.2.7 - 2025 03 17 */
.chatbot-resize-up-btn {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #f1f1f1;
    border: none;
    cursor: pointer;
    text-align: center;
    /* Adjusted padding - Ver 1.8.6 */
    padding: 1px;
    border-radius: 1px;
    justify-content: center;
    flex-wrap: nowrap;
    margin-top: 0;
}

.chatbot-resize-up-btn:hover {
    background-color: #dcdcdc;    
}


/* Added in Version 2.2.7 - 2025 03 17 */
.chatbot-resize-down-btn {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #f1f1f1;
    border: none;
    cursor: pointer;
    text-align: center;
    /* Adjusted padding - Ver 1.8.6 */
    padding: 1px;
    border-radius: 1px;
    justify-content: center;
    flex-wrap: nowrap;
    margin-top: 0;
}

.chatbot-resize-down-btn:hover {
    background-color: #dcdcdc;    
}

/* Added in Version 2.2.7 - 2025 03 17 */
.chatbot-header-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

#chatbot-widget-iframe {
    max-width: none;
    max-height: none;
    overflow: visible;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

iframe {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

html, body {
    overflow-x: hidden; /* Prevents unwanted horizontal scrolling */
}

/* Conversation History Styles - Ver 2.3.6 */
.chatbot-chatgpt-chatbot-history-wrapper {
    margin: 20px 0;
}

.chatbot-chatgpt-chatbot-history > a {
    display: block;
    padding: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    margin-bottom: 5px;
}

.chatbot-chatgpt-chatbot-history > a:hover {
    background-color: #e0e0e0;
}

.chatbot-chatgpt-chatbot-history .thread-messages {
    padding: 10px;
    background-color: #fafafa;
    border: 1px solid #ddd;
}

.chatbot-chatgpt-chatbot-history .history-message {
    margin-bottom: 15px;
    padding: 10px;
    border-left: 3px solid #ddd;
}

.chatbot-chatgpt-chatbot-history .history-message.user-message {
    background-color: #e3f2fd;
    border-left-color: #2196f3;
}

.chatbot-chatgpt-chatbot-history .history-message.bot-message {
    background-color: #f5f5f5;
    border-left-color: #4caf50;
}

.chatbot-chatgpt-chatbot-history .history-message b {
    /* display: block; */
    margin-bottom: 5px;
    color: #555;
}

.chatbot-chatgpt-chatbot-history .message-content {
    line-height: 1.6;
}

.chatbot-chatgpt-chatbot-history .message-content ul,
.chatbot-chatgpt-chatbot-history .message-content ol {
    margin: 10px 0;
    padding-left: 30px;
}

.chatbot-chatgpt-chatbot-history .message-content li {
    margin: 5px 0;
}

.chatbot-chatgpt-chatbot-history .message-content a {
    color: #2196f3;
    text-decoration: underline;
}

.chatbot-chatgpt-chatbot-history .message-content a:hover {
    color: #1976d2;
}

.chatbot-chatgpt-chatbot-history .message-content p {
    margin: 10px 0;
}

.chatbot-chatgpt-chatbot-history .message-content h1,
.chatbot-chatgpt-chatbot-history .message-content h2,
.chatbot-chatgpt-chatbot-history .message-content h3,
.chatbot-chatgpt-chatbot-history .message-content h4,
.chatbot-chatgpt-chatbot-history .message-content h5,
.chatbot-chatgpt-chatbot-history .message-content h6 {
    margin: 15px 0 10px 0;
    font-weight: bold;
}

