/* style.css */

/* Basic resets */
body {
    margin: 0;
    padding: 0;
    font-family: 'Lucida Sans', Arial, sans-serif;
    font-size:14px;
    height: 100%;
    width: 100%;
    overflow: hidden; 
}

.page-wrapper {
    /*padding: 20px;*/
    position: relative;
    top:0;
    bottom:0;
    height:100%;
    width:100%;
    background-color: #f5ede3;
    box-sizing: border-box;
}

/* Container holding sidebar and main chat */
.container {
    display: flex;
    height: 100%;
    width:100%;
    justify-content: center;
    flex-direction: column;
    position: fixed;
}

/* Top Line */
.top-line {
    display:flex;
    justify-content: center;
    text-align: center;
    padding: 10px;
    border-bottom: 1px solid #ccc;
    position: absolute;
    width: 100%;
    top: 0;
    z-index: 10;
}

.verification-section {
    margin-bottom: 0.5rem;
    text-align: left;
    display: flex;
    flex-direction: column;
}
.verification-section hidden {
    visibility: hidden;
}
.verification-section.column {
    flex-direction: column;
}

.verification-section h3, .verification-section.title strong {
    margin-top: 0;
    text-align: left;
}

.verification-section input[type="text"], 
.verification-section textarea /*, .verification-section form */ {
    width: 55%;
    padding: 0.5rem;
}
.verification-section input[type="file"] {
  display: none;
}
.verification-section textarea {
    width: 100%;
}
.verification-section form {
    background-color: none;
    width: 100%;
}

/* Main Chat Area Adjustments */
.main-chat {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    display: flex;
    flex-direction: ron;
    padding: 0;
}

/* Chatbox */
.chatbox {
    /* Ensure chatbox expands to fill available space */
    display: flex;
    /*justify-content: flex-end; */
    /*flex: 1; */
    transition: width 0.3s ease;
    box-sizing: border-box;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
    padding: 4rem 2%;
    /* background-color: #f9f9f9; /* Off-white/light grey */
    /*background-color: #f4f1e9; /* Light beige, vintage paper feel */
    background-color:#fff0e1; /* #f5ede3; /*#f7f1e3; /* Light beige, vintage paper */
    /*border: 1px solid #ccc; */
    /*margin-bottom: 2rem; */
    /* border:1px red dashed; */
}
#chatbox-messages {
    display: flex;
    flex-shrink: 1;
    flex-grow: 1;
    flex-direction: column;
    overflow-y: auto;
    height:100%;
    width:100%;
}

/* Message bubbles */
/* Fade-in effect for message boxes */
.message {
    margin: 0.5rem 2% 0.5rem 1rem;
    min-width: 70%;
    max-width: 100%;
    width:80%;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    position: relative;
    right:0.5rem;
    opacity: 0; /* Initially invisible */
    animation: fadeIn 0.25s forwards; /* Fade-in animation */
    color: #555555; /* Dark grey for readability */
}
.message div {
    padding: 0 1rem;
    border-radius: 8px;
    word-wrap: break-word;
    animation: fadeIn 0.25s forwards; /* Fade-in animation */
    box-shadow: 2px 2px 1px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    color: #333333; /* Dark grey for readability */
    width: auto;
    min-width: 40px;
    display: inline-block;
}

/* Keyframes for the fade-in effect */
@keyframes fadeIn {
    from {
        opacity: 0; /* Start fully transparent */
    }
    to {
        opacity: 1; /* End fully visible */
    }
}

/* User messages */
.message.user {
    display: flex;
    align-self: flex-end;
    margin-left: auto;
    margin-right: 0.5%;
    align-items: flex-end;
    flex-direction: column;
}
.message.user div {
    /*background-color: #4e4545;
    border:2px solid #7a6c6c; */
    /*background-color: #8a9ea3; /* Soft, muted blue-grey for a modern touch */
    /*border: 2px solid #b0c4c7; /* Lighter, complementary border color */
    background-color: #dbe9ff; /* Pastel mint */
    border: 2px solid #e3eeff; /* Slightly darker mint for border */
}

.message.assistant {
    display: flex;
    align-self: flex-start;
    margin-left: auto;
    margin-right: 0.5%;
    align-items: flex-start;
    flex-direction: column;
    margin-right: auto;
    margin-left: 1.5%;
}
/* Assistant messages */
.message.assistant div {
    /*background-color: #b7491f;
    border:2px solid #eb5e28; */
    /* background-color: #d9d9d9; /* Light grey-beige for a soft look */
    /* border: 2px solid #b3b3b3; /* Slightly darker border for subtle contrast */
    /*background-color: #5a7d9a; /* Muted grey-blue */
    /*border: 2px solid #7d9ab7; /* Lighter grey-blue border */
   /* background-color: #e0eaf1; /* Soft light grey-blue */
   /* border: 2px solid #c5d6e3; /* Lighter grey-blue border */
    background-color: #fdfdfd; /* Off-white background */
    border: 2px solid #ffffff; /* White border */
    color: #101010;
}
.message.assistant.extended {
    width:92.5%;
}

/* System messages */
.message.system {
    text-align: center;
    align-self: center;
    max-width: 80%;
    margin: 10px auto;
}
.message.system div {
    background-color: #e0e0e0;
    color: #000;
    border-radius: 5px;
}

/* General Text Styling */
.message {
    font-family: 'Lucida Sans', 'Arial', sans-serif; /* Clean, modern font */
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}
.message > span {
font-size: 1rem;
  margin-bottom: 0.25rem;
  padding-left: 0.5rem;
  color: #bbbbbb;
  display: block;
}
.message div p {
    font-size: 0.8rem; /* Adjust if needed */
    margin: 0.55rem 0.1rem;
}

#resetButton {
    background-color: #000000;
}

.input-wrapper {
    position: absolute;
    bottom: 0;
    width: 100%;
    max-height: 90px;
}

/* Input area */
.input-area {
    display: flex;
    flex-direction: row;
    background-color: transparent;
    width:100%;
}

.input-area input[type="text"] {
    flex: 1;
    padding: 15px;
    border:none;
    border-top: 1px #d5d5d5 solid;
    outline: none;
}

.verification-section button, #resetButton, .input-area button, .toggle-button, 
.file-upload-section button, .verification-section .custom-file-upload, button {
    padding: 0.5rem;
    background-color: #355097; /*#2961C4; /* #4f71aa; /* 597099 /* #EB5E28; */
    color: #fff;
    border: 1px #d5d5d5 solid;
    cursor: pointer;
    font-size:0.75rem;
    /*font-weight: bold;*/
    transition: box-shadow 0.3s ease;
}
.verification-section button, .verification-section .custom-file-upload {
    width: 40%;
    /* background-color: #EB5E28; */
    margin-bottom: 5px;
}
.verification-section button:hover, #resetButton:hover, .input-area button:hover, 
.toggle-button:hover, .file-upload-section button:hover, button:hover, 
.verification-section .custom-file-upload:hover {
    box-shadow: 0px 2px 5px rgba(36, 36, 36, 0.2);
}
.verification-section .custom-file-upload {
    display: block;
    box-sizing: border-box;
    text-align: center;
}

.input-area button {
    width:11%;
    font-size: 1rem;
}

.input-area button img {
    max-width: 40px;
    height:auto;
}

#sendButton {
    background-image:url(https://ai.opunet.com/chat/assistant/v2b/assets/icons/add_chat_simple.gif);
}
#resetButton {
    background-image:url(https://ai.opunet.com/chat/assistant/v2b/assets/icons/reset.svg);
}
#sendButton, #resetButton {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat; 
}

/* Style for the upload progress bar */
#uploadProgress {
    width: 100%;
    height: 20px;
    display: none; /* Initially hidden */
    margin-top: 10px;
}


/* Typing indicator */
.typing-indicator {
    position: relative;
    display: flex;
    width:100%;
    align-items: center;
    padding: 5px 10px;
    background-color: transparent;
    color:black;
    padding-left:8%;
}

.typing-indicator span {
    display: inline-block;
    font-size: 1.5rem;
    animation: blink 1s infinite;
    color: black;
}

.typing-indicator .dot-one {
    animation-delay: 0s;
}

.typing-indicator .dot-two {
    animation-delay: 0.2s;
}

.typing-indicator .dot-three {
    animation-delay: 0.4s;
}

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

/* Style for searchResults and other result containers to ensure proper spacing */
#searchResults, 
#vectorStoresResults, 
#vectorStoreFilesResults, 
#deleteFileResult {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #555;
}

/* File Upload and Search Sections */
.file-upload-section, .search-section {
    margin-bottom: 20px;
}

.file-upload-section h3, .search-section h3 {
    margin-top: 0;
}

.file-upload-section button, .search-section button {
    width: 100%;
    padding: 10px;
    margin-bottom: 5px;
}

.file-upload-section button:hover, .search-section button:hover {
    /* background-color: #128C7E; */
}

/* Results Styling */
#vectorStoresResults, #vectorStoreFilesResults, #deleteFileResult, #searchResults {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #555;
}

#vectorStoresResults ul, #vectorStoreFilesResults ul, #searchResults ul {
    list-style-type: none;
    padding-left: 0;
}

#vectorStoresResults li, #vectorStoreFilesResults li, #searchResults li {
    margin-bottom: 5px;
}

/* Sidebar collapsed state */
.left-sidebar.sidebar-collapsed, 
.right-sidebar.sidebar-collapsed {
    /* width: 20%; */
    /* transition: width 0.5s ease, padding 0.5s ease; */
    transition: transform 0.5s ease;
    min-width: 40px;
    width: auto;
    /*display:none;*/
}
/* Collapsed State */
 .left-sidebar.sidebar-collapsed {
    transform: translateX(-100%);
}

.right-sidebar.sidebar-collapsed {
    transform: translateX(100%);
}

/* Regular Sidebar Styling */
.left-sidebar, .right-sidebar {
    position: relative;
    width: 22%;
    display: flex;
    flex: 0 0 auto;
    border: 1px solid #ccc;
    /* overflow: hidden; */
    transition: transform 2s ease;
    transform: translateX(0%);
}
.left-sidebar {
    width:40%;
}

.left-sidebar.sidebar-collapsed .sidebar-inner, 
.right-sidebar.sidebar-collapsed .sidebar-inner {
    width:0;
    padding:0;
    transition: width 0s;
}

.left-sidebar .sidebar-inner, .right-sidebar .sidebar-inner {
    width: 100%;
    min-height: 100%;
    height: auto;
    padding: 3.5rem 4% 22% 4%;
    box-sizing: border-box;
    transition: width 0.2s;
    overflow-y: auto;
}

/* Hide Toggle Button Inside Sidebar When Expanded */
/*.left-sidebar .toggle-button,
.right-sidebar .toggle-button {
    display: none;
} */

/* Toggle buttons for sidebars */
.toggle-button {
    position: absolute;
    top: 9%; /* Align the button vertically in the middle of the page */
    /*transform: translateY(-50%); */
    width: 40px;
    background-color: #355097; /* #EB5E28; */
    color: #fff; 
    border: none;
    padding: 8px;
    cursor: pointer;
    z-index: 1000; /* Ensure it's above other elements */
    font-size: 1rem;
    transition: box-shadow 0.3s ease;
}

/* Left Sidebar Toggle Button */
#left-toggle-button {
    right: -9%; /* Stick the button to the very left of the viewport */
    border-radius: 0 5px 5px 0;
}
.left-sidebar.sidebar-collapsed #left-toggle-button {
    right: -100%;
} 

/* Right Sidebar Toggle Button */
#right-toggle-button {
    left: -17%;
    border-radius: 5px 0 0 5px;
}
.right-sidebar.sidebar-collapsed #right-toggle-button {
    left: -100%;
}

/* Contact Us Button in Right Sidebar */
.right-sidebar .additional-content button {
    margin-top: 10px;
    /*background-color: #128C7E; /* Adjust to match your theme */
    /* color: #fff; */
    width: 100%;
}

/* Overlay Styles */
.overlay {
    display: none; 
    position: fixed; 
    z-index: 1; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.4);
}

.overlay-content {
    background-color: #fefefe;
    margin: 1% auto; 
    padding: 0 1rem 1rem 1rem;
    border: 1px solid #888;
    width: 60%; 
    max-width: 80%; /* Adjust as needed */
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
    font-size: 0.75rem;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.overlay-header {
    text-align: center;
    margin-bottom: 0;
}
.overlay-header h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.thread {
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}
.thread:not(:first-child) {
    border-top: 1px #cccccc solid;
}

.overlay-chatbox {
    height: 100%; /* Adjust as needed */
    overflow-y: auto;
    padding: 10px;
    min-height: 80vh;
    border: 1px solid #ddd;
}

/* Styles for messages within the overlay - keep consistent with your chatbox styles */
.overlay-chatbox .message {
    margin: 0.2rem 0.5rem;
    min-width: 70%;
    max-width: 100%;
    width:80%;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    position: relative;
    right:0.5rem;
    opacity: 0; /* Initially invisible */
    animation: fadeIn 0.25s forwards; /* Fade-in animation */
    color: #555555; /* Dark grey for readability */
}
.overlay-chatbox .message div:not(.feedback-icons) {
    padding: 0 1rem;
    border-radius: 8px;
    word-wrap: break-word;
    animation: fadeIn 0.25s forwards; /* Fade-in animation */
    box-shadow: 2px 2px 1px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    color: #333333; /* Dark grey for readability */
    width: auto;
    min-width: 40px;
}
.overlay-chatbox .message.user {
    display: flex;
    align-self: flex-end;
    margin-left: auto;
    margin-right: 0.5%;
    align-items: flex-end;
    flex-direction: column;
}
.overlay-chatbox .message.user div {
    background-color: #dbe9ff; /* Pastel mint */
    border: 2px solid #e3eeff; /* Slightly darker mint for border */
}
.overlay-chatbox .message.assistant {
    display: flex;
    align-self: flex-start;
    margin-left: auto;
    margin-right: 0.5%;
    align-items: flex-start;
    flex-direction: column;
    margin-right: auto;
    margin-left: 1.5%;
}
/* Assistant messages */
.overlay-chatbox .message.assistant div {
    background-color: #f4f4f4; /* Off-white background */
    border: 2px solid #ffffff; /* White border */
    color: #101010;
}
.overlay-chatbox .message.assistant div p, .overlay-chatbox .message.user div p {
    font-size: 0.75rem;
    margin: 0.2rem;
}

/* Loading icon styling */
.overlay .loading-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}
.overlay .loading-icon .spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Styling feedback icons within overlay assistant messages */
.overlay .feedback-icons {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    font-size: 0.75rem;
    cursor: pointer;
    color: #555;
}

.overlay .feedback-icons .thumbs-up,
.overlay .feedback-icons .thumbs-down {
    cursor: pointer;
    font-size: 1.2rem;
}

.overlay .feedback-icons .thumbs-up:hover,
.overlay .feedback-icons .thumbs-down:hover {
    color: #000;
}

/* Feedback popup styling */
.overlay .feedback-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    padding: 20px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 90%;
    width: 400px;
}
.overlay .feedback-popup p {
    margin: 0 0 10px;
}
.overlay .feedback-popup textarea {
    width: 100%;
    padding: 8px;
    resize: vertical;
}
.overlay .feedback-popup button {
    margin-top: 10px;
    padding: 8px 12px;
    cursor: pointer;
}

/* Feedback icon styling within overlay */
.overlay .feedback-icons {
    display: flex;
    gap: 12px;
    margin-top: 5px;
    font-size: 1rem;
    cursor: pointer;
    color: #555;
}

.overlay .feedback-icons .check-mark,
.overlay .feedback-icons .cross-mark {
    cursor: pointer;
}

.overlay .feedback-icons .check-mark:hover {
    color: green;
}

.overlay .feedback-icons .cross-mark:hover {
    color: red;
}

/* Styling for feedback popup within overlay */
.overlay .feedback-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    padding: 20px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 90%;
    width: 400px;
}

.overlay .feedback-popup textarea {
    width: 100%;
    padding: 8px;
}

.overlay .feedback-popup button {
    margin-top: 10px;
    padding: 8px 12px;
}

/* Style for feedback popup within overlay */
.overlay #feedbackPopup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    padding: 20px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 90%;
    width: 400px;
}
.overlay #feedbackPopup textarea {
    width: 100%;
    padding: 8px;
}
.overlay #feedbackPopup button {
    margin-top: 10px;
    padding: 8px 12px;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background: white;
    padding: 20px;
    width: 80%;
    max-height: 80%;
    overflow-y: auto;
    border-radius: 8px;
}

.popup-content h3 {
    margin-top: 0;
}

.popup-content button {
    margin-top: 20px;
}

.csv-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.csv-table th, .csv-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.csv-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

/* Styles for chatbot container */
.chatbot-container {
    position: absolute;
    /* Center the container */
    /* Responsive sizing */
    width: 100%;
    height: 100%;
    /*display: none; /* Initially hidden */
    overflow: visible;
    display: flex;
    flex-direction: column;
}
/* Active state for chatbot container */
.chatbot-container.active {
    display: flex;
    flex-direction: column;
}

/* Styles for close button */
.chatbot-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 99999;
}

/* Flexbox styles for inner elements */
.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.main-chat {
    flex: 1;
    display: flex;
}

.chatbox {
    flex: 1;
    overflow-y: auto;
}