/* Loader overlay */
.chat-loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8); /* Semi-transparent white background */
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 24px;
  z-index: 2000;
  opacity: 1;
  /* visibility: hidden; */
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

/* Loader spinner */
.chat-loader {
  border: 4px solid rgba(108, 29, 204, 0.3);
  border-top: 4px solid rgba(108, 29, 204, 1);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

/* Show loader when active */
.chat-widget.loading .chat-loader-overlay {
  opacity: 1;
  visibility: visible;
}

/* Spinner animation */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Chat Icon at the bottom right */
#chat-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  visibility: hidden;
}

#unread-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #E30168;
  color: #F9FAFB;
  border-radius: 100%;
  width: 20px;
  height: 20px;
  display: none;
  justify-content: center;
  align-items: center;
  font-family: "Nunito" !important;
  font-weight: 700;
  font-size: 12px;
  line-height: 24px;
  letter-spacing: 0.24px;
  visibility: hidden;
}

#chat-icon button {
  font-size: 30px;
  background: rgba(108, 29, 204, 1);
  color: white;
  border: none;
  border-radius: 100%;
  padding: 16px;
  cursor: pointer;
  height: 56px;
  width: 56px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0px 16px 32px -4px rgba(145, 158, 171, 0.12);
}

#chat-icon button .chat-icon-svg {
  width: 20px;
  height: 20px;
  object-fit: cover;
}

/* Chat Widget - Initially Hidden */
#chat-widget {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 440px;
  height: 512px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  top: auto;
  display: flex;
  flex-direction: column;
  transition: opacity 0.1s ease-in-out, visibility 0.1s ease-in-out,
    transform 0.1s ease-in-out;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

/* Chat Widget - When Open */
#chat-widget.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0); /* Moves back up smoothly */
}

.chat-header {
  background-color: #fff;
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  height: fit-content;
  border-bottom: 1px solid rgba(145, 158, 171, 0.24);
  visibility: hidden;
}

.chat-header-organization-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header-organization-section .organization-image {
  width: 40px;
  height: 40px;
  border-radius: 100%;
  object-fit: cover;
}

.chat-header-organization-section .organization-name {
  font-family: "Nunito" !important;
  font-weight: 500;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 0.24px;
  color: rgba(33, 43, 54, 1);
}

.chat-header button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 11px;
  color: rgba(89, 106, 120, 1);
}

.chat-header .close-icon {
  width: 15px;
  height: 15px;
  object-fit: cover;
}

/* chatbox body */
.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  overflow-y: auto;
  height: 100%;
  background-color: #fff;
  border-bottom-right-radius: 24px;
  border-bottom-left-radius: 24px;
  visibility: hidden;
}

/* messages container */
#messages {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding-bottom: 10px;
}

/* single thread  */

.single-thread {
  display: flex;
  align-items: end;
  gap: 8px;
}

.single-thread .sender-image {
  width: 40px;
  height: 40px;
  border-radius: 100%;
  object-fit: cover;
  margin-bottom: 8px;
}

.host-name {
  font-family: "Nunito" !important;
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.16px;
  color: rgba(89, 106, 120, 1);
  padding-left: 56px;
  margin-bottom: 8px;
}

/* message bar  */
.received_message {
  margin-bottom: 8px;
  max-width: 85%;
  border-radius: 16px;
  padding: 16px;
  background: rgba(244, 246, 248, 1);
  font-family: "Nunito" !important;
  font-weight: 500;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 0.24px;
  color: rgba(33, 43, 54, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.form-input {
  height: 100%;
  border: none;
  font-family: "Nunito" !important;
  font-weight: 400;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 0.16px;
  color: rgba(33, 43, 54, 1);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(196, 205, 213, 1);
}
.form-input-error-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}
.form-input-withError {
  height: 100%;
  border: none;
  font-family: "Nunito" !important;
  font-weight: 400;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 0.16px;
  color: rgba(33, 43, 54, 1);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(227, 1, 104, 1);
}

.error-message {
  font-family: "Nunito" !important;
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.16px;
  color: rgba(227, 1, 104, 1);
  display: none;
}

.form-input:focus,
.form-input-withError:focus {
  outline: none;
}

.next-btn {
  border: none;
  font-family: "Nunito" !important;
  font-weight: 600;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 1.25px;
  text-align: center;
  color: rgba(145, 158, 171, 1);
  background: none;
  cursor: pointer;
  width: fit-content;
}
/* chatbox footer */
.chat-input {
  display: none;
  justify-content: space-between;
  align-items: center;
  height: 48px;
  border-radius: 8px;
  padding-top: 4px;
  padding-right: 8px;
  padding-bottom: 4px;
  padding-left: 16px;
  border-width: 1px;
  color: rgba(255, 255, 255, 1);
  border: 1px solid rgba(196, 205, 213, 1);
}

.chat-input input {
  width: 100%;
  height: 100%;
  border: none;
  font-family: "Nunito" !important;
  font-weight: 400;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 0.16px;
  color: rgba(89, 106, 120, 1);
}

.chat-input input:focus {
  outline: none;
}

.chat-input button {
  border: none;
  border-radius: 4px;
  padding: 0px;
  background: none;
  cursor: pointer;
}

.chat-input .send-icon {
  width: 24px;
  height: 24px;
  object-fit: cover;
}

.chat-step {
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

.hidden {
  opacity: 0;
  display: none;
}

.sent {
  background-color: #6200ea;
  color: white;
  width: 70%;
  margin-left: auto;
  margin-bottom: 8px;
  margin-right: 8px;
  max-width: 80%;
  border-radius: 16px;
  padding: 16px;
  font-family: "Nunito" !important;
  font-weight: 500;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 0.24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.last-name-error{
  display: none;
}
