/*
Inspired by mscbot by Indently:
https://github.com/indently/mscbot/tree/main/mscbot
*/

/* ===== Global Styles ===== */
body {
  margin: 0;
  padding: 0;
  padding-bottom: 40px; /* Space for copyright */
  min-height: 100vh;
  position: relative;
}

/* ===== Input Styling ===== */
#textInput {
  border: 3px solid rgb(235, 235, 235);
  transition: all 0.15s ease-in;
  float: left;
  box-sizing: border-box;
  flex: 1;
  width: 100%;
  min-height: 20px;
  max-height: 80px;
  overflow: auto;
  resize: none;
  white-space: pre-wrap;
  border-radius: 10px;
  padding: 10px;
  font-size: 16px;
  color: #d1d5d4; /* botText color */
  background-color: rgb(27, 35, 59); /* botText background */
  outline: none;
  margin-left: -10px;
}

#textInput:focus {
  border-color:#00FF00;
}

.input-box {
  float: left;
  border: none;
  box-sizing: border-box;
  flex: 1;
  width: 100%;
  min-height: 20px;
  max-height: 80px;
  overflow: auto;
  resize: none;
  white-space: pre-wrap;
  border-radius: 10px;
  padding: 10px;
  font-size: 16px;
  color: #d1d5d4; /* botText color */
  background-color: rgb(27, 35, 59); /* botText background */
  outline: none;
  margin-left: -10px;
}

#userInput {
  width: 95%;
  position: relative;
  right: 8px;
  margin-left: 10px;
}

/* ===== Button Styling ===== */
.code-copy-button,
.copy-all-button,
.thumbs-up-button,
.thumbsDownButton,
.speakButton,
.stopButton,
#copy-convo,
#convo-history,
#agent-action,
#upload-image,
#project-camera,
#upload-pdf,
#hamburger-menu {
  border: none;
  border-radius: 1em;
  background-color: #33415c; /* Slightly lighter than botText background */
  color: #fff; /* Light text for contrast */
  transition: background-color 0.3s ease;
  padding: 0.5em 0.7em;
}

.code-copy-button:hover,
.copy-all-button:hover,
.thumbs-up-button:hover,
.thumbsDownButton:hover,
.speakButton:hover,
.stopButton:hover,
#copy-convo:hover,
#convo-history:hover,
#agent-action:hover,
#upload-image:hover,
#project-camera:hover,
#upload-pdf:hover,
#hamburger-menu:hover {
  background-color: #98969667;
}

.custom-button {
  margin: 5px;
  padding: 2px 5px;
  background-color: #4CAF50;
  color: white;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
  font-size: 9px;
  height: auto;
}

.button-container {
  padding: 0;
  margin: 0;
}

.button-row {
  display: flex;
  justify-content: flex-start;
  padding: 0;
  margin: 0;
}

.button-row button {
  margin-right: 5px;
  color: black;
}

.buttons-container {
  margin-left: -15px;
}

/* ===== Chat Window Container ===== */
.chat-window-container {
  position: fixed;
  top: 85px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1000px;
  min-width: 320px;
  /* height: calc(100vh - 125px); */
  height: calc(100vh - 125px - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  box-sizing: border-box;
  padding: 0 15px;
  margin: 0 auto;
}

/* ===== Chat Bar Collapsible ===== */
.chat-bar-collapsible {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}

.collapsible {
  background-color: rgb(47, 129, 47);
  color: white;
  cursor: pointer;
  padding: 8px;
  width: 100%;
  text-align: left;
  outline: none;
  font-size: 16px;
  border-radius: 10px 10px 0px 0px;
  border: 3px solid white;
  border-bottom: none;
}

#chat-button:focus {
  outline: none;
}

#chat-icon:hover {
  opacity: 0.7;
}

/* ===== Content Area ===== */
.content {
  flex-grow: 1;
  height: auto;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
  /* background-color: #f1f1f1; */
  background-color: rgb(27, 35, 59);
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
}

/* ===== Full Chat Block ===== */
.full-chat-block {
  width: 100%;
  /* background: rgb(38, 36, 36); */
  background: rgb(27, 35, 59);
  border: 3px solid white;
  text-align: center;
  overflow: hidden;
  height: 100%;
  transition: max-height 0.2s ease-out;
  margin-bottom: 0;
  padding-bottom: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* ===== Outer Container ===== */
.outer-container {
  min-height: 0;
  bottom: 0%;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ===== Chat Container ===== */
.chat-container {
  max-height: none;
  width: 100%;
  position: relative;
  bottom: 0;
  left: 0;
  scroll-behavior: smooth;
  hyphens: auto;
  height: calc(100% - 80px);
  overflow-y: auto;
  flex-grow: 1;
  padding-bottom: 20px;
}

.chat-container::-webkit-scrollbar {
  display: none;
}

.chatbox-class {
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* ===== Chat Bar Input Block ===== */
.chat-bar-input-block {
  position: relative;
  bottom: 0;
  width: 100%;
  padding: 10px 10px 20px 10px;
  background-color: #33415c; /* Slightly lighter than botText background */
  display: flex;
  flex-direction: row;
  box-sizing: border-box;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* Media query for iPhone portrait orientation */
@media screen and (max-width: 600px) and (orientation: portrait) {
  .chat-bar-input-block {
    bottom: 20px; /* Adjust this value as needed */
  }

  .chat-container {
    padding-bottom: 60px; /* Adjust this value as needed */
  }
}

.chat-bar-icons {
  display: flex;
  justify-content: space-evenly;
  box-sizing: border-box;
  width: 15%;
  height: 100%;
  float: right;
  font-size: 20px;
  padding: 10px 10px 20px 10px;
}

/* ===== Chat Bubbles ===== */
.userText {
  color: white;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-size: 16px;
  font-weight: normal;
  text-align: left;
  clear: both;
}

.userText span {
  line-height: 1.5em;
  display: inline-block;
  background: rgb(37, 101, 238);
  padding: 10px;
  border-radius: 8px;
  border-bottom-right-radius: 2px;
  max-width: 97%;
  margin-left: 10px;
  animation: floatup 0.5s forwards;
  margin-bottom: 15px; /* Increased margin-bottom to match botText */
}

.botText {
  /* color: rgb(19, 18, 18); */
  color: white;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-weight: normal;
  font-size: 16px;
  text-align: left;
}

.botText span {
  line-height: 1.5em;
  display: inline-block;
  /*background: #e0e0e0; */
  background: rgb(27, 35, 59);
  padding: 10px;
  border-radius: 8px;
  border-bottom-left-radius: 2px;
  max-width: 97%;
  margin-left: 10px;
  animation: floatup 0.5s forwards;
  margin-bottom: 15px; /* Keep margin-bottom consistent */
}

/* ===== Status Text Styles ===== */
.statusText, .statusTextProgress, .errorStatusText, .errorText {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-weight: normal;
  text-align: left;
}

.statusText, .statusTextProgress {
  color: #1e6218;
}

.errorStatusText, .errorText {
  color: #9c0d0d;
}

.statusText, .errorStatusText {
  font-size: 10px;
}

.statusTextProgress {
  font-size: 12px;
}

.errorText {
  font-size: 16px;
}

.statusText span, .statusTextProgress span, .errorStatusText span {
  line-height: 1.5em;
  background: #33415c; /* Slightly lighter than botText background */
  color: #d1d5d4; /* botText color */
  padding: 10px;
  border-radius: 8px;
  border-bottom-left-radius: 2px;
  max-width: 97%;
  margin-left: 10px;
  animation: floatup 0.5s forwards;
  margin-bottom: 15px;
}

.errorText span {
  background: #edcdcd;
  line-height: 1.5em;
  display: inline-block;
  padding: 10px;
  border-radius: 8px;
  border-bottom-left-radius: 2px;
  max-width: 97%;
  margin-left: 10px;
  animation: floatup 0.5s forwards;
  margin-bottom: 15px;
}

/* ===== Animation ===== */
@keyframes floatup {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: translateY(0px);
    opacity: 1;
  }
}

/* ===== Image Selection ===== */
.image-selection-container {
  display: flex;
  flex-wrap: wrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #888 #ffffff;
}

.image-selection-container::-webkit-scrollbar {
  height: 8px;
}

.image-selection-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.image-selection-container::-webkit-scrollbar-track {
  background: #ffffff;
}

.selectableImage {
  flex: 0 0 auto;
}

/* ===== Utilities ===== */
.left-aligned {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
}

.slider-parent {
  width: 20%;
  display: inline-block;
  height: 43.98px;
  display: none;
}

.soc-class {
  height: 70%;
  width: 30%;
}

.soc-label {
  color: black;
  height: 30%;
  display: block;
}

.api-label {
  color: black;
  height: 30%;
  display: block;
  padding-left: 15px;
  border-left-color: grey;
  border-left-width: 1px;
  border-left-style: solid;
  display: none;
}

.metadata {
  font-size: 0.6em;
  color: gray;
}

.custom-bot-button {
  color: #00FF00; /* Set the desired text color */
  /* Add other styles as needed (e.g., background-color, padding, border) */
}

/* ===== Responsive Design ===== */
@media screen and (max-width: 600px) {
  .chat-window-container {
    padding: 0 10px;
    left: 0;
    transform: none;
    width: 100%;
    max-width: none;
    /* Adjust top and height for small screens */
    top: 60px; /* Adjust as needed */
    height: calc(100vh - 100px - env(safe-area-inset-bottom)); /* Adjust as needed */
  }

  
  .full-chat-block {
    width: 100%;
    border-radius: 0px;
  }
  
  .chat-bar-collapsible {
    position: relative;
    width: 100%;
  }
  
  .collapsible {
    width: 100%;
    border: 0px;
    border-top: 3px solid white;
    border-radius: 0px;
  }
}


.collapsible {
  /* Hide the title bar */
  display: none;
}

.full-chat-block {
  border: none; /* Remove the white border */
}



#toolbar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 200;
  background-color: rgb(27, 35, 59);
  color: #00FF00;
  display: flex; /* Add flexbox to center content */
  flex-direction: column; /* Stack top-bar and button-toolbar */
  align-items: center; /* Center items horizontally */
}

#top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  max-width: 1000px; /* Match chat container width */
  width: 100%; /* Take up full width of toolbar container */
  box-sizing: border-box; /* Include padding in width calculation */
}

#projectTitle {
  cursor: pointer;
  font-size: 1.2em; /* Adjust as needed */
  margin: 0; /* Remove default margins */
}

#profile_pic_id {
  border-radius: 50%;
  height: 30px;
}

#button-toolbar {
  padding: 5px 10px;
  display: flex;
  flex-wrap: wrap; /* Allow buttons to wrap to the next line */
  gap: 5px; /* Add spacing between buttons */
  max-width: 1000px; /* Match chat container width */
  width: 100%; /* Take up full width of toolbar container */
  box-sizing: border-box; /* Include padding in width calculation */
  justify-content: center; /* Center buttons horizontally */
}

.button_toolbar {
  /* Add any specific styling for your toolbar buttons here */
  background-color: transparent;
  border: none;
  color: #00FF00;
  cursor: pointer;
  font-size: 1em;
  padding: 5px 10px;
}

.green-button {
  color: #00FF00 !important; /* Use !important if needed, but try to avoid it */
}

.green-icon {
  color: #00FF00 !important; /* Style the icon separately */
}


.markdown-text {
  color: #d1d5d4; /* Default text color (light gray) */
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.markdown-header {
  color: #9cdcfe; /* Light blue/cyan - softer than the original blue */
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.markdown-code {
  color: #f4dbd6; /* Light pink/salmon - muted version of the original */
  background-color: #282c34; /* Dark background for code blocks */
  font-family: Consolas, monospace;
  margin: 0;
  padding: 0;
}

.markdown-link {
  color: #b39ddb; /* Light purple - provides contrast but isn't too harsh */
  margin: 0;
  padding: 0;
}

.markdown-list {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  color: #d1d5d4; /* Match default text color for list items */
}