:root {
  /* SimInsights Teal (Primary) */
  --primary-teal: #04A8CB;
  --secondary-teal: #0067FF;
  --teal-100: #C0E9F2;
  --teal-200: #82D4E5;
  --teal-300: #43BED8;
  --teal-400: #04A8CB;
  --teal-500: #037E98;
  --teal-600: #025466;
  --teal-700: #012A33;
  
  /* Gray Scale */
  --gray-100: #F5F5F5;
  --gray-200: #E5E5E5;
  --gray-300: #D4D4D4;
  --gray-400: #A3A3A3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  
  /* Destructive Colors */
  --destructive-400: #BA324F;
  --destructive-500: #94213A;
}

/* Chatbot Toggle Button Styles */
#sim-chatbot [data-chatbot-toggle] {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: var(--secondary-teal);
  font-size: 28px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  transition: background-color 0.3s ease;
  outline: none;
  border: none;
}

#sim-chatbot [data-chatbot-toggle]:hover,
#sim-chatbot [data-chatbot-toggle]:focus:hover {
  background-color: var(--teal-600);
}

#sim-chatbot [data-chatbot-toggle]:focus,
#sim-chatbot [data-chatbot-toggle]:active {
  background-color: var(--secondary-teal);
}

/* Top Bar With Title */
#sim-chatbot #top-bar {
  background-color: var(--gray-700);
  color: var(--gray-100);
  padding-top: 5px;
  padding-bottom: 5px;
  font-family: "DM Sans", sans-serif;
  font-size: 20px;
  font-weight: 500;
  text-align: center;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

/* Resizable Chatbot Wrapper (inverted to move native resize handle to top-left) */
#sim-chatbot #chatbot-wrapper,
#sim-chatbot [data-chatbot-container] {
  border-radius: 10px;
  height: 400px;
  width: 400px;
  max-height: 70vh;
  max-width: 70vw;
  min-height: 300px;
  min-width: 300px;
}

#sim-chatbot #chatbot-wrapper {
  display: none;
  position: fixed;
  bottom: 90px;
  right: 20px;
  resize: both;
  overflow: auto;
  z-index: 1000;
  /* Invert horizontally and vertically */
  direction: rtl;
  transform: scaleY(-1);
}

/* Chatbot Container Styles */
#sim-chatbot [data-chatbot-container] {
  display: block;
  width: 100%;
  height: 100%;
  background-color: var(--gray-900);
  color: var(--gray-100);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Inner Container for Flex Layout – flip back to normal */
#sim-chatbot .chatbot-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  direction: ltr;
  transform: scaleY(-1);
}

/* Chatbox (Message Display Area) */
#sim-chatbot [data-chatbox] {
  flex: 1;
  padding: 10px;
  margin-top: 30px;
  overflow-y: auto;
}

/* Chat Input Area Styles */
#sim-chatbot [data-chat-input-area] {
  display: flex;
  padding: 12px;
  border-top: 1px solid var(--gray-700);
  background-color: var(--gray-800);
}

/* User Input Field Styles */
#sim-chatbot .custom-input[data-user-input] {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  outline: none;
  background-color: var(--gray-700);
  color: var(--gray-100);
  font-family: "Mulish", sans-serif;
}

/* Send Button Styles */
#sim-chatbot [data-send-btn] {
  margin-left: 10px;
  width: 40px;
  height: 40px;
  background-color: var(--secondary-teal);
  color: var(--gray-100);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background-color 0.3s ease;
}

#sim-chatbot [data-send-btn]:hover {
  background-color: var(--teal-600);
}

/* Message image styles */
#sim-chatbot img.message-image {
  align-self: center;
  max-width: 160%;
  height: auto;
}

/* Message Box Styles */
#sim-chatbot .user-msg,
#sim-chatbot .assistant-msg {
  margin: 10px 0;
  display: flex;
}

#sim-chatbot .user-msg {
  justify-content: flex-end;
}

#sim-chatbot .assistant-msg {
  justify-content: flex-start;
}

/* Message Content Box */
#sim-chatbot .msg-content {
  display: inline-block;
  width: fit-content;
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 10px;
  word-wrap: break-word;
  font-family: "Mulish", sans-serif;
  font-size: 0.80em;
  color: var(--gray-100);
}

/* User Message Box using Gray 700 */
#sim-chatbot .user-msg .msg-content {
  background-color: var(--gray-700);
}

/* AI (Assistant) Message Box using Gray 800 */
#sim-chatbot .assistant-msg .msg-content {
  background-color: var(--gray-800);
}

/* Bobbing Bullets Animation Styles */
#sim-chatbot .bobbing-dots span {
  display: inline-block;
  font-size: 1.5em;
  animation: bob 1s infinite;
}

#sim-chatbot .bobbing-dots span:nth-child(1) {
  animation-delay: 0s;
}

#sim-chatbot .bobbing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

#sim-chatbot .bobbing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* Keyframes for Bobbing Animation */
@keyframes bob {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-5px);
  }
}
