/* CHAT ICON */
#chat-icon {
  position: fixed;
  bottom: 80px;
  right: 23px;
  width: 60px;
  height: 60px;
  background: orange;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  z-index: 9999;
}

/* CHAT BOX */
#chat-box {
  position: fixed;
  bottom: 20px;
  right: 93px;
  width: 400px;
  height: 600px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.25);
  display: none;
  flex-direction: column;
  font-family: "Open Sans", sans-serif;
  z-index: 9999;
}

/* HEADER */
.chat-header {
  padding: 12px 15px;
  font-weight: bold;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: black;
}

.chat-actions i {
  margin-left: 10px;
  cursor: pointer;
  color: black;
}

/* BODY */
.chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column; /* stack messages vertically */
  gap: 8px; /* spacing between messages */
}

.chat-avatar {
  width: 140px;
  height: 70px;
  border-radius: 50%;
  display: block;
  margin: 0 auto 15px auto; /* ⬅ centers the avatar */
}

.chat-body h2 {
  margin: 0;
  font-weight: 400;
}

.chat-body h1 {
  margin: 5px 0 20px;
  font-size: 24px;
}

/* DISCLAIMER */
.chat-disclaimer {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 10px;
  text-align: left;
  font-size: 13px;
  color: #555;
}

/* FOOTER */
.chat-footer {
  padding: 12px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
}

.chat-footer textarea {
  flex: 1;
  resize: none;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 10px;
  font-size: 13px;
  height: 42px;
}

/* SEND BUTTON */
.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: orange;
  color: #fff;
  border: none;
  cursor: pointer;
}

.chat-avatar {
  width: 140px;
  height: 70px;
  border-radius: 50%;
}

/* Maximized state */
#chat-box.maximized {
  width: 95vw;
  height: 97vh;
  bottom: 1.5vh;
  right: 1.5vw;
  border-radius: 12px;
}

/* General message styles */
.message {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.3;
  display: flex;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  margin-bottom: 12px;
}

/* User message on right */
.user-message {
  align-self: flex-end; /* align to right */
  background: orange; /* blue bubble */
  color: white;
  border-top-right-radius: 0;
}

/* Bot message on left */
.bot-message {
  align-self: flex-start; /* align to left */
  background: #e5e5ea; /* gray bubble */
  color: #555;
  border-top-left-radius: 0;
}

/* Inner content styling (optional, for consistent padding) */
.message-content {
  padding: 8px 12px;
  border-radius: 15px;
  max-width: 100%;
  color: #555;
  word-wrap: break-word;
}

/*Mobile layout*/
@media (max-width: 768px) {

  #chat-box {
    width: 70vw;
    height: 90vh;
    right: 20;
    bottom: 20;
    border-radius: 0;
  }

  #chat-icon {
    bottom: 80px;
    right: 26px;
    width: 52px;
    height: 52px;
    font-size: 22px;
  }

  .chat-body {
    padding: 14px;
  }

  .chat-footer textarea {
    font-size: 16px;
    height: 44px;
  }

  .message {
    max-width: 85%;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .chat-avatar {
    width: 110px;
    height: 55px;
  }
}