/* Copy the styling from your existing style.css file */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background: transparent;
}

body {
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  font-size: 100%;
  background: transparent;
  border-radius: 16px 16px 0px 0px;
}

*,
html {
  --primaryGradient: linear-gradient(93.12deg, #1E88E5 0.52%, #1E88E5 100%);
  --secondaryGradient: linear-gradient(268.91deg, #1E88E5 -2.14%, #1E88E5 99.69%);
  --primaryBoxShadow: 0px 10px 15px rgba(0, 0, 0, 0.1);
  --secondaryBoxShadow: 0px -10px 15px rgba(0, 0, 0, 0.1);
  --primary: #1E88E5;
}

/* CHATBOX */
.chatbox {
  position: fixed;
  bottom: 70px;
  right: 80px;
  z-index: 9998;
  border-radius: 16px 16px 0px 0px;
}

.chatbox-container {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 9998;
  border-radius: 16px 16px 0px 0px;
}

/* CONTENT IS CLOSE */


/* CONTENT ISOPEN */
.chatbox--active {
  transform: translateY(-16px);
  z-index: 123456;
  opacity: 1;
}

.loader {
  display: none;
  color: gray;
  margin-top: 14px;
  font-size: 13px;
}

.typing_loader {
  color: gray;
  margin-top: 14px;
  font-size: 13px;
  width: 100%;
}

.display_loading {
  display: block !important;
}

/* BUTTON */
.chatbox__button {
  display: none;
}

.send__button {
  padding: 10px;
  border-radius: 50%;
  background: var(--gradient, linear-gradient(135deg, #1E88E5 0%, #1E88E5 100%));
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* HEADER */
.chatbox__header {
  position: sticky;
  top: 0;
  background: #1E88E5;
}

/* MESSAGES */
.chatbox__messages {
  margin-top: auto;
  display: flex;
  overflow-y: auto;
  flex-direction: column;
  position: relative;
}

.chatbox__messages::-webkit-scrollbar-track {
  border: 0;
  background-color: #fcfdfd;
  padding: 10px;
}

.chatbox__messages::-webkit-scrollbar {
  width: 5px;
  background-color: #F5F5F5;
}

.chatbox__messages::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background-color: #6a7771;
}

.messages__item--operator {
  margin-left: auto;
  width: auto;
}

.messages__item--visitor {
  margin-right: auto;
  width: auto;
}

.edit-query {
  display: none;
  background: transparent;
  border: 0;
  margin-left: auto;
  cursor: pointer;
}

.messages__item--operator:hover .edit-query {
  display: block;
}

/* FOOTER */
.chatbox__footer {
  position: sticky;
  bottom: 0;
}


.chatbox__support {
  background: #ffffff;
  height: 500px;
  width: 380px;
  box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
  border-radius: 16px 16px 0px 0px;
}

/* HEADER */
.chatbox__header {
  background: var(--gradient, linear-gradient(135deg, #1E88E5 0%, #1E88E5 100%));
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 16px 16px 0px 0px;
}

.chatbox__image--header {
  margin-right: 5px;
  border-radius: 50%;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbox__image--header img {
  width: 50px;
  height: 50px;
  padding: 7px;
  border-radius: 50%;
  object-position: center;
  object-fit: fill;
}

.chatbox__content--header {
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: center;
  margin-left: 25px;
  flex-grow: 1;
}

.chatbox__heading--header {
  text-align: center;
  font-size: 1.2rem;
  color: white;
}

.chatbox__description--header {
  font-size: 14px;
  color: white;
  margin-top: 4px;
}

.expand-button,
.remove-expand,
.minimize-button {
  background: transparent;
  border: 0;
  cursor: pointer;
  margin-left: auto !important;
  display: flex;
}

.minimize-button {
  transition: transform 0.3s ease;
}

/* Messages */
.chatbox__messages {
  padding: 0 16px;
  border-radius: 16px;
}

.messages__item {
  margin-top: 10px;
  padding: 12px;
  width: 100%;
  color: #000;
  word-wrap: break-word;
}

.messages__item--operator,
.messages__item--visitor {
  display: flex;
  gap: 10px;
  border-radius: 34px;
  border: 1px solid #00a65200;
  background: #e3f2fd;
  word-wrap: break-word;
  width: fit-content;
  font-size: 16px;
}

.messages__item--operator p,
.messages__item--visitor p {
  line-height: 1.4;
  align-self: center;
  word-wrap: break-word;
  font-size: 16px;
}

.messages__item--operator {
  border-top-right-radius: 0px;
  border-top-left-radius: 34px;
  border-bottom-left-radius: 34px;
  border-bottom-right-radius: 34px;
  background-color: #bbdefb;
}

.messages__item--operator img,
.messages__item--visitor img {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
  margin: 5px 0;
}

.chatbox__reload {
  padding: 14px;
  color: #fff;
  background: inherit;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbox__footer {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: 16px;
}

.chatbox__footer .footer-inside {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: #f2f2f2;
  border-radius: 100px;
  gap: 10px;
}

.chatbox__footer input {
  width: 100%;
  border: none;
  padding: 10px 0;
  background-color: transparent;
  font-size: 14px;
  outline: none;
}

.chatbox__footer input::placeholder {
  color: #999;
}

.chatbox__footer input:focus-visible {
  outline: none;
}

.chatbox__send--footer {
  color: #fff;
}

.remove-expand,
.expand-button {
  display: none;
}

.chatbox__button button,
.chatbox__button button:focus,
.chatbox__button button:visited {
  padding: 10px;
  background: white;
  border: none;
  outline: none;
  border-top-left-radius: 50px;
  border-top-right-radius: 50px;
  border-bottom-left-radius: 50px;
  box-shadow: 0px 10px 15px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.expand-chat .chatbox__support {
  height: 600px;
  width: 480px;
  border-radius: 16px;
  transition: all .5s ease-in-out;
}

.expand-chat .chatbox__header {
  border-radius: 16px 16px 0 0;
}

.expand-chat .chatbox__messages {
  height: calc(100% - 150px);
  overflow-y: auto;
}

.expand-chat .chatbox__footer {
  margin-top: auto;
  padding-left: 16px;
  padding-right: 16px;
}

.expand-chat .chatbox__footer input {
  width: 100%;
}

@media (max-width: 575.98px) {
  .chatbox__messages {
    padding: 0 8px;
  }
  .chatbox__footer {
    padding: 10px;
  }
  .chatbox__support {
    height: 480px;
    width: 280px;
  }
  .chatbox {
    bottom: 80px;
    right: 30px;
  }
  .chat-button {
    bottom: 10px;
    right: 10px;
    width: 45px;
    height: 45px;
  }
  .chatbox__reload {
    display: none;
  }
  #startButton {
    display: none;
  }
  #startButton.active {
    display: block;
    position: fixed;
    bottom: 10px;
    right: 10px;
    padding: 10px;
    border: none;
    border-radius: 50%;
    background: #1E88E5;
    color: white;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Chat button styling */
.chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: var(--primary);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chat-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.chat-button svg {
  width: 30px;
  height: 30px;
  color: white;
  transition: transform 0.3s ease;
}

.chat-button .close-icon {
  transform: rotate(0deg);
}

.chat-button.hidden {
  display: flex !important;
}

/* Typing indicator animation */
.typing-indicator {
  padding: 10px 15px !important;
  margin-bottom: 10px;
  border-radius: 18px !important;
  width: auto !important;
  display: inline-block !important;
  min-width: 60px;
}

.typing-animation {
  display: flex;
  align-items: center;
  height: 20px;
}

.typing-animation .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #606060;
  margin-right: 4px;
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-animation .dot:nth-child(1) {
  animation-delay: 0s;
}

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

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

@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
}

/* Start with chatbox hidden */
.chatbox__support {
  display: flex;
  flex-direction: column;
  height: 500px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  transform: translateY(20px);
}

.chatbox--active .chatbox__support {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  border-radius: 1000px;
}

/* Ensure proper z-index for layers */
.chatbox {
  z-index: 9998;
}

.chat-button {
  z-index: 9999;
}

/* Add a rotation animation when switching */
@keyframes rotateIn {
  from { transform: rotate(45deg); opacity: 0; }
  to { transform: rotate(0deg); opacity: 1; }
}

.chat-button .close-icon[style*="display: block"] {
  animation: rotateIn 0.3s forwards;
}

/* Copy your markdown styling CSS here */
.markdown-content {
  font-size: 14px;
  line-height: 1.5;
  width: 100% !important;
  display: block !important;
}

.markdown-content p {
  margin-bottom: 8px;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin-top: 10px;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.markdown-content h1 { font-size: 1.5em; }
.markdown-content h2 { font-size: 1.3em; }
.markdown-content h3 { font-size: 1.1em; }
.markdown-content h4 { font-size: 1em; }

.markdown-content code {
  background-color: #f0f0f0;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
}

.markdown-content pre {
  background-color: #f0f0f0;
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
  margin: 10px 0;
}

.markdown-content pre code {
  background-color: transparent;
  padding: 0;
}

.markdown-content ol,
.markdown-content ul {
  margin-left: 20px;
  margin-bottom: 10px;
}

.markdown-content li {
  margin-bottom: 3px;
}

.markdown-content table {
  border-collapse: collapse;
  margin: 10px 0;
  width: 100%;
  display: table !important;
  table-layout: fixed;
  overflow-x: auto;
  border-spacing: 0;
}

.markdown-content th,
.markdown-content td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
  display: table-cell !important;
  word-wrap: break-word;
}

.markdown-content th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.markdown-content tr {
  display: table-row !important;
}

.markdown-content tr:nth-child(even) {
  background-color: #f9f9f9;
}

.markdown-content thead {
  display: table-header-group !important;
}

.markdown-content tbody {
  display: table-row-group !important;
}

.markdown-content blockquote {
  border-left: 3px solid #ccc;
  padding-left: 10px;
  margin-left: 5px;
  color: #666;
  font-style: italic;
}

.markdown-content a {
  color: #1E88E5;
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
}

/* Adjust message containers to better display markdown */
.messages__item--visitor {
  padding: 12px 15px !important;
  max-width: 80% !important;
  background: #e3f2fd !important;
  border-radius: 12px !important;
  margin-bottom: 10px !important;
  width: auto !important;
  display: block !important;
}

.messages__item--operator {
  padding: 12px 15px !important;
  max-width: 80% !important;
  background: #bbdefb !important;
  border-radius: 12px !important;
  margin-bottom: 10px !important;
  width: auto !important;
  display: block !important;
}

/* Fix bullet points and lists */
.markdown-content ul {
  list-style-type: disc !important;
  padding-left: 20px !important;
  margin: 8px 0 !important;
  list-style-position: outside !important;
}

.markdown-content ol {
  list-style-type: decimal !important;
  padding-left: 20px !important;
  margin: 8px 0 !important;
  list-style-position: outside !important;
}

.markdown-content li {
  display: list-item !important;
  margin-bottom: 5px !important;
  text-align: left !important;
}

/* Force bullet points to show */
.markdown-content ul li::before {
  content: '•' !important;
  position: absolute !important;
  left: -15px !important;
  color: inherit !important;
}

.markdown-content ul li {
  position: relative !important;
  padding-left: 5px !important;
}

/* Ensure proper spacing between list items */
.markdown-content ul li + li,
.markdown-content ol li + li {
  margin-top: 5px !important;
}

