/* Import Google font - Poppins */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

/* ---------- Chatbot toggler & container ---------- */
.chatbot-toggler {
  position: fixed;
  bottom: 15px;
  right: 26px;
  outline: none;
  border: none;
  height: 50px;
  width: 50px;
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #952fd6;
  transition: all 0.2s ease;
  z-index: 10000;
}
body.show-chatbot .chatbot-toggler {
  transform: rotate(90deg);
}
.chatbot-toggler span {
  color: #fff;
  position: absolute;
  user-select: none;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.chatbot-toggler span:last-child,
body.show-chatbot .chatbot-toggler span:first-child {
  opacity: 0;
  transform: scale(0.9);
}
body.show-chatbot .chatbot-toggler span:last-child {
  opacity: 1;
  transform: scale(1);
}

/* ---------- Chat panel ---------- */
.chatbot {
  position: fixed;
  right: 35px;
  bottom: 70px;
  width: 400px;
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
  transform-origin: bottom right;
  box-shadow: 0 0 128px 0 rgba(0, 0, 0, 0.08),
    0 32px 64px -48px rgba(0, 0, 0, 0.4);
  transition: all 0.14s ease;
  display: flex;
  flex-direction: column;
  z-index: 10000;
}
body.show-chatbot .chatbot {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* header */
.chatbot header {
  padding: 16px 0;
  position: relative;
  text-align: center;
  color: #fff;
  background: linear-gradient(90deg, #952fd6, #a45fe0);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.chatbot header h2 {
  font-size: 1.2rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: #fff;
}
.chatbot header span {
  position: absolute;
  right: 15px;
  top: 50%;
  display: none;
  cursor: pointer;
  transform: translateY(-50%);
}

/* ---------- Chatbox area ---------- */
.chatbot .chatbox {
  overflow-y: auto;
  height: 70vh;
  padding: 30px 20px 20px;
  background: linear-gradient(180deg, #fff, #fbfbfb);
}

/* custom scrollbars (webkit) */
.chatbot :where(.chatbox, textarea)::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.chatbot :where(.chatbox, textarea)::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 25px;
}
.chatbot :where(.chatbox, textarea)::-webkit-scrollbar-thumb {
  background: #d3d3d3;
  border-radius: 25px;
}

/* ---------- Chat bubbles ---------- */
.chatbox .chat {
  display: flex;
  list-style: none;
  margin-bottom: 10px;
  align-items: flex-end;
}
.chatbox .outgoing {
  margin: 20px 0;
  justify-content: flex-end;
}
.chatbox .incoming span {
  width: 34px;
  height: 34px;
  color: #fff;
  cursor: default;
  text-align: center;
  line-height: 34px;
  align-self: flex-start;
  background: #952fd6;
  border-radius: 6px;
  margin: 0 12px 6px 0;
  font-size: 18px;
}
.chatbox .chat p {
  padding: 12px 16px;
  border-radius: 10px 10px 0 10px;
  max-width: 85%;
  color: #fff;
  font-size: 14px;
  background: #952fd6;
  margin-bottom: 0px;
  word-break: break-word;
}
.chatbox .outgoing p {
  background: linear-gradient(90deg, #f5f9ff, #eaf5ff);
  color: #0b2a4a;
  border-radius: 10px 10px 10px 0;
}
.chatbox .incoming p {
  border-radius: 10px 10px 10px 0;
  color: #111827;
  background: #f2f2f2;
  font-weight: 400;
  text-align: justify;
}

/* small links inside chat bubble */
.chat.incoming a,
.chat.incoming a:link,
.chat.incoming a:visited {
  color: #952fd6;
  text-decoration: underline;
  font-weight: 500;
}

/* input elements inside bubbles (contact/quote) */
.chatbox .chat p input,
.chatbox .chat p textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #bfbfbf;
  border-radius: 6px;
  outline: none;
  font-size: 14px;
}
.chatbox .chat p textarea {
  margin-bottom: 0px;
  min-height: 72px;
  resize: vertical;
  max-height: 220px;
}

/* error message bubble */
.chatbox .chat p.error {
  color: #721c24;
  background: #f8d7da;
}

/* ---------- Chat input area ---------- */
.chatbot .chat-input {
  display: flex;
  gap: 8px;
  position: absolute;
  bottom: 0;
  width: 100%;
  background: #fff;
  padding: 8px 16px;
  border-top: 1px solid #eee;
  align-items: center;
  display: none;
}
.chat-input textarea {
  height: 55px;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  max-height: 180px;
  padding: 12px 10px;
  font-size: 0.95rem;
  background: transparent;
}
.chat-input span {
  align-self: flex-end;
  color: #952fd6;
  cursor: pointer;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  font-size: 1.35rem;
  width: 40px;
  border-radius: 8px;
}
.chat-input textarea:not(:placeholder-shown) ~ span,
.chat-input textarea:focus ~ span {
  visibility: visible;
}

/* ---------- Follow-ups, quick replies & small UI controls ---------- */
.follow-up-options {
  display: block;
  margin-top: 14px;
}
.follow-up-options .followup-btn {
  background: #fff;
  border: 1px solid #e7e7ee;
  padding: 8px 12px;
  border-radius: 999px;
  margin-right: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #111827;
  transition: all 0.14s ease;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
.follow-up-options .followup-btn:hover,
.follow-up-options .followup-btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  outline: none;
}

/* quick replies under every message */
.quick-replies {
  margin-top: 8px;
}
.qr-btn {
  background: #fff;
  border: 1px solid #e6e9ef;
  padding: 6px 8px;
  border-radius: 6px;
  margin-right: 8px;
  cursor: pointer;
  font-size: 13px;
}

/* yes/no answer buttons */
.ans-btn {
  background: #fff;
  border: 1px solid #e6e9ef;
  padding: 6px 10px;
  border-radius: 6px;
  margin-right: 8px;
  cursor: pointer;
  font-size: 13px;
}

/* small quick actions used after "not resolved" */
.small-qr {
  background: #fff;
  border: 1px solid #e6e9ef;
  padding: 6px 10px;
  border-radius: 6px;
  margin-right: 8px;
  cursor: pointer;
}

/* wrapper for post-no-options */
.post-no-options {
  margin-top: 8px;
}

/* ---------- Contact-card & Quote-composer ---------- */
.contact-card,
.quote-composer {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #eee;
  background: #fff;
  max-width: 520px;
}
.contact-card input,
.quote-composer input,
.quote-composer textarea {
  padding: 8px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}
.contact-card .actions,
.quote-composer .actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.contact-card button,
.quote-composer button,
.submission-form button {
  border: 0;
  background: #e3499d;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.contact-card button.secondary,
.quote-composer button.secondary {
  background: #fff;
  color: #952fd6;
  border: 1px solid #e6e6ee;
}

/* ---------- Validation / error helpers ---------- */
.field-error {
  color: #b00020;
  font-size: 12px;
}
input.invalid,
textarea.invalid {
  outline: 1.5px solid rgba(176, 0, 32, 0.12);
  box-shadow: 0 0 0 3px rgba(176, 0, 32, 0.03);
}

/* also style HTML5 invalid pseudo */
input:invalid,
textarea:invalid {
  box-shadow: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 490px) {
  .chatbot-toggler {
    right: 20px;
    bottom: 20px;
  }
  .chatbot {
    right: 0;
    bottom: 0;
    height: 100%;
    border-radius: 0;
    width: 100%;
  }
  .chatbot .chatbox {
    height: 90%;
    padding: 25px 15px 120px;
  }
  .chatbot .chat-input {
    padding: 8px 12px;
  }
  .chatbot header span {
    display: block;
  }
}

/* ---------- Small focus/a11y helpers ---------- */
.follow-up-options .followup-btn:focus,
.qr-btn:focus,
.ans-btn:focus,
.small-qr:focus,
.contact-card button:focus,
.quote-composer button:focus,
.chat-input span:focus {
  outline: 3px solid rgba(149, 47, 214, 0.16);
  outline-offset: 2px;
  border-radius: 8px;
}

/* keep bubble line-height comfortable */
.chatbox .chat p {
  line-height: 1.35;
}

/* small helper to ensure reply area doesn't overlap last messages on small screens */
@media (max-height: 700px) {
  .chatbot .chatbox {
    padding-bottom: 140px;
  }
}
/* Radio-style follow-up options */
.followup-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.followup-radios input[type="radio"].followup-radio {
  display: none;
}
.followup-radios .followup-label {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e7e7ee;
  cursor: pointer;
  font-size: 13px;
  color: #111827;
  transition: all 0.12s ease;
}
.followup-radios .followup-label:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
.followup-label.selected {
  /*   background: #ea439f; */
  color: #fff;
  /*   border-color: #ea439f;
  box-shadow: 0 8px 24px rgba(149, 47, 214, 0.12); */
}

/* Idle options small adjustments */
.follow-up-options.idle-options .followup-label {
  font-weight: 600;
}

.chatbox .chat p input[type="radio"] {
  margin-bottom: 0px;
  width: auto;
}
.submission-form {
  background-color: white;
}
.callBtn {
  background: green !important;
}
.contentDiv {
  margin-top: 15px;
  text-indent: 30px;
}
.follow-up-options div {
  /*   background: white; */
  padding: 12px 10px;
  border-radius: 10px;
  /*   box-shadow: 0px 0px 11px 0px #ebebeb; */
}
.follow-up-options > div:has(input[type="radio"]:checked) {
  background: #ea439f;
  box-shadow: 0 8px 24px rgba(149, 47, 214, 0.12);
}
.idleDiv {
  padding: 12px 10px;
  border-radius: 10px;
}
.idleDiv.selected {
  background: #ea439f;
  color: white;
  box-shadow: 0 8px 24px rgba(149, 47, 214, 0.12);
}
