/* Chat Button */
#my-chat-button {
  position: fixed;
  bottom: 24px;
  right: 8%;
  cursor: pointer;
  z-index: 9999;
  height: 36px;
  border-radius: 50px;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}

/* Chat Window */
#my-chat-window {
  position: fixed;
  bottom: 80px;
  right: 8%;
  width: 400px;
  height: 70vh;
  background: #fff;
  border-radius: 8px;
  z-index: 9999;
  display: none;
  flex-direction: column;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, Segoe, "Segoe UI", "Droid Sans", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
  display: flex;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
  color: #3e3e3e;
  text-align: left;
}

/* Chat Content Area */
#my-chat-content {
  flex: 1;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Chat Input Container */
#my-chat-input-container {
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #333;
  color: #fff;
  padding: 16px;
  box-sizing: border-box;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  border-radius: 0 0 8px 8px;
}

/* Chat Header */
#my-chat-header {
  background: #19899D;
  height: 40px;
  color: #fff;
  padding: 8px 16px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Mobile close button */
.mobile-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

/* Chat Input */
#my-chat-input {
  flex: 1;
  padding: 8px;
  margin-right: 8px;
  border: none;
  border-radius: 4px;
  line-height: 24px;
  font-size: 16px;
  font-family: Arial, Helvetica, sans-serif;
  resize: none;
  overflow: hidden;
  height: auto;
}

#my-chat-input:focus {
  outline: none;
  box-shadow: none;
}

#my-chat-input-container button {
  background-color: #19899D;
  color: #fff;
  height: 40px;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  width: 64px;
  font-family: -apple-system, BlinkMacSystemFont, Segoe, "Segoe UI", "Droid Sans", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 38px;
}

/* Chat Messages */
.my-chat-message {
  border-radius: 8px;
  clear: both;
  word-wrap: break-word;
}

.my-chat-message.user {
  padding: 12px 16px;
  background-color: #E5F8FB;
  margin-left: auto;
  margin-bottom: 12px;
  text-align: right;
  font-size: 0.9rem;
  max-width: 80%;
}

.my-chat-message.bot {
  margin-right: auto;
  margin-bottom: 8px;
  text-align: left;
  font-size: 0.9rem;
  min-height: 43px;
  max-width: 100%;
}

.my-chat-message.bot h2 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 4px;
}

/* Updated Welcome Row Layout */
.chat-welcome {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  font-family: -apple-system, BlinkMacSystemFont, Segoe, "Segoe UI", "Droid Sans", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.chat-welcome img {
  width: 64px;
  flex-shrink: 0;
}

.chat-welcome-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  color: #3e3e3e;
  max-width: 100%;
}

.chat-powered-by {
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 2rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-self: flex-end;
}

.chat-powered-by img {
  height: 16px;
  vertical-align: middle;
}

.chat-welcome-text {
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.chat-welcome-note {
  font-size: 12px;
  line-height: 16px;
  color: #3e3e3e;
}

/* Style for the icons container */
.bot-response-icons {
  margin: 0 8px 8px 16px;
  display: flex;
  gap: 10px;
}

.bot-response-icons img {
  cursor: pointer;
}

#my-chat-window .gform_wrapper input[type="text"],
#my-chat-window .gform_wrapper input[type="email"] {
  height: 40px;
}

#my-chat-window .gform_button {
  background-color: #19899D;
  height: 40px;
}

#my-chat-window .gfield_label {
  color: #3e3e3e;
}

#my-chat-window a {
  color: #19899D;
  text-decoration: underline;
}

/* Bot Typing */
.bot-typing {
  display: flex;
  align-items: center;
  font-style: italic;
  color: #888;
}

.bot-typing .dots {
  display: flex;
}

.bot-typing .dot {
  width: 6px;
  height: 6px;
  margin: 0 2px;
  background-color: #888;
  border-radius: 50%;
  opacity: 0.4;
  animation: blink 1.4s infinite;
}

.bot-typing .dot:nth-child(1) { animation-delay: 0s; }
.bot-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.bot-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.4; }
  40% { opacity: 1; }
}

/* Thumb icon selected */
.thumb-icon.selected {
  filter: brightness(0) saturate(100%) invert(34%) sepia(97%) saturate(2278%) hue-rotate(82deg) brightness(92%) contrast(101%);
}

/* Mobile Styles */
@media (max-width: 768px) {
  #my-chat-window {
    width: 100%;
    border-radius: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    font-size: 16px;
    background-color: #FFF;
  }

  #my-chat-header {
    position: fixed;
    height: 48px;
    top: 0;
    left: 0;
    right: 0;
    color: #fff;
    padding: 15px;
    z-index: 1000;
    border-radius: 0;
  }

  #my-chat-content {
    padding: 16px;
    flex: none;
    position: fixed;
    background-color: #FFF;
    width: 100%;
    border-radius: 0;
    right: 0;
    top: 48px;
    bottom: 48px;
    overflow-y: auto;
  }

  .chat-welcome img {
    width: 48px;
  }

  .chat-powered-by {
    font-size: 11px;
  }

  .chat-welcome-text {
    font-size: 15px;
  }

  .chat-welcome-note {
    font-size: 12px;
  }

  .my-chat-message.user,
  .my-chat-message.bot {
    font-size: 1rem;
  }

  .my-chat-message.bot h2 {
    font-size: 1.1rem;
  }

  #my-chat-input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #333;
    color: #fff;
    text-align: center;
    z-index: 1000;
    border-radius: 0 0 0 0;
  }

  #my-chat-button {
    right: 8px;
    bottom: 48px;
  }

  .no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  .mobile-close-btn {
    display: inline-block;
  }
}
