/* Floating Button */
#wpai-chatbot-button:not(.bt-btn) {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  /* border-radius: 50%; */
  border-radius: 12px;
  /* background: linear-gradient(135deg, #ff7a45, #ff5638); */
  background: white; /* disable gradient background */
  padding: 0;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  cursor: pointer;
  z-index: 99999;
  box-shadow: 0 4px 10px rgba(255, 86, 56, 0.35);
  border: 1px solid rgba(255, 86, 56, 0.35);

  /* animation */
  animation: wpai-pulse 3s ease-in-out infinite;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#wpai-chatbot-button:not(.bt-btn):hover {
  animation: none;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(255, 86, 56, 0.45);
}

#wpai-chatbot-button:not(.bt-btn) img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Chatbox Panel */
#wpai-chatbot-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  min-height: 400px;
  height: auto;
  width: 400px;
  max-width: calc(100% - 48px);
  border-radius: 12px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.35);
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  font-family: system-ui, sans-serif;
  max-height: 85vh;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.35s ease;
}

/* ===== Scrollbar CSS ===== */
  /* Firefox */
  #wpai-chatbot-panel * {
    scrollbar-width: thin;
    scrollbar-color: #ff5638 #eeeeee;
  }

  /* Chrome, Edge, and Safari */
  #wpai-chatbot-panel *::-webkit-scrollbar {
    width: 5px;
  }

  #wpai-chatbot-panel *::-webkit-scrollbar-track {
    background: #eeeeee;
  }

  #wpai-chatbot-panel *::-webkit-scrollbar-thumb {
    background-color: #ff5638;
    border-radius: 4px;
    border: 2px solid #ffffff;
  }

#wpai-chatbot-panel.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.welcome-content{
  max-height: 70vh;
  overflow: auto;
  padding: 18px;
}
/* Header */
#wpai-chatbot-header {
  flex-shrink: 0;
  background: linear-gradient(135deg, #ff5638, #ff5638);
  color: white;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  letter-spacing: 0.3px;
  z-index: 2;
}

.wpai-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wpai-header-left img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: white;
}

.wpai-header-info {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.4;
}

.wpai-company-name {
  font-weight: 600;
  font-size: 15px;
}

.wpai-contact-item {
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.wpai-contact-item:hover {
  opacity: 1;
  text-decoration: underline;
}


#wpai-close-btn:hover {
  opacity: 1;
}

#wpai-chatbot-header button {
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  position: relative; 
  top: -16px;
}

#wpai-chatbot-header button:hover {
  opacity: 1;
}
#wpai-lead-form{
  margin-top:6px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
#wpai-chatbot-chat {
  display: none;
  flex-direction: column;
  height: 100%;
  flex: 1;
  overflow: hidden; /* important */
}

/* Chat Area */
#wpai-chatbot-messages {
  flex: 1;
  display: flex;
  padding: 12px;
  overflow-y: auto;
  background: #f6f7f9;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #ff5638 #f1f1f1;
  height: 73vh;
  min-height: 451px;
  max-height: 480px;
}

.wpai-user-msg {
  background: #dcf8c6;
  align-self: flex-end;
  animation: fadeIn 0.3s ease;
}

.wpai-bot-msg {
  background: #fff;
  align-self: flex-start;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Input Area */
/* #wpai-chatbot-input-area {
  flex-shrink: 0;
  display: flex;
  padding: 10px;
  border-top: 1px solid #ddd;
  background: #fff;
  gap: 8px;
  align-items: flex-end;
  z-index: 2;
} */
#wpai-chatbot-input-area {
  display: none !important;
  flex-shrink: 0;
  display: flex;
  padding: 10px;
  border-top: 1px solid #eee;
  gap: 8px;
  align-items: center;
  background: #fff;
}

#wpai-chatbot-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff; /* ✅ pure white input */
  font-size: 14px;
  resize: none; /* disable manual resize handle */
  outline: none;
  line-height: 1.4;
  min-height: 38px; /* default height */
  max-height: 100px; /* auto expand up to this */
  overflow-y: auto;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
  height: 38px;
}

#wpai-chatbot-input:focus {
  border-color: #ff5638;
  box-shadow: 0 0 0 2px rgba(255, 86, 56, 0.2);
}

/* #wpai-chatbot-send {
  background: linear-gradient(135deg, #ff7a45, #ff5638);
  border: none;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 38px; // match input height 
  font-size: 18px;
  transition: all 0.25s ease;
} */

/* #wpai-chatbot-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(255, 86, 56, 0.4);
} */

#wpai-chatbot-send {
  background: #ff5638;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  transition: transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(255, 86, 56, 0.3);
  border-radius: 12px;
}

#wpai-chatbot-send:hover {
  background: #ff734f;
  transform: scale(1.1);
  box-shadow: 0 6px 14px rgba(255, 86, 56, 0.45);
}

#wpai-chatbot-send img {
  width: 32px;
  height: 32px;
  /* filter: invert(42%) sepia(100%) saturate(600%) hue-rotate(-5deg); */
  filter: brightness(0) invert(1);
}

/* Chat bubbles */
#wpai-chatbot-messages div {
  font-size: 14px;
}
#wpai-chatbot-messages div p{
    padding-bottom: 8px;
    font-size: 14px;
    line-height: 1.3;
}
#wpai-chatbot-messages div p:empty{
  display: none;
}
#wpai-chatbot-messages div.user {
  background: #ffe4dc;
  align-self: flex-end;
  color: #333;
}

#wpai-chatbot-messages div.bot {
  background: #fff;
  align-self: flex-start;
  color: #333;
}

/* .wpai-suggestion {
  background: linear-gradient(45deg, #ff5638, #ff7f50);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: transform 0.2s, opacity 0.2s;
} */

/* .wpai-suggestion:hover {
  transform: scale(1.05);
  color: white;
} */

/* suggestions (buttons) */
/* Wrapper */
/* Wrapper */
.wpai-yesno-wrap {
  display: flex;
  gap: 10px;
}

/* General button base */
.wpai-yesno-btn {
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  border: none;
  color: #fff;
  transition: transform 0.15s ease, opacity 0.2s;
}

/* YES button (solid primary blue) */
.wpai-btn-yes {
  background: rgb(0, 123, 255);
  box-shadow: 0 2px 6px rgba(0, 123, 255, 0.35);
}

.wpai-btn-yes:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

/* NO button (soft blue-gray) */
.wpai-btn-no {
  background: rgb(108, 117, 125);
  box-shadow: 0 2px 6px rgba(108, 117, 125, 0.35);
}

.wpai-btn-no:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

/* .wpai-suggestion {
  background: linear-gradient(45deg, #ff5638, #ff7f50);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: transform 0.14s ease;
}
.wpai-suggestion:hover {
  transform: translateY(-2px);
  color: white;
} */
.wpai-suggestion{
  padding: 10px;
  text-align: center;
  border: 1px solid rgb(204, 204, 204);
  border-radius: 8px;
  background: rgb(255, 255, 255);
  color: rgb(51, 51, 51);
  cursor: pointer;
  transition: 0.2s;
  font-size: 12px;
  font-weight: 600;
}
.wpai-suggestion.selected,
.wpai-suggestion:hover,
.wpai-suggestion:active,
.wpai-suggestion:visited{
  /* rgb(255 86 56) */
  background: rgb(255 ,86 ,56 , 0.1);
  border-color: rgb(255 ,86 ,56 , 0.1);
  color: rgb(255 86 56);
}
.wpai-msg-content #extra-submit,
.wpai-msg-content button.submit-button{
  background: linear-gradient(135deg, #ff5638, #ff5638);
  color: white;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 20px;
  width: 100%;
  cursor:pointer;
}
.wpai-msg-content #extra-submit{
  margin-top: 10px;
}
.wpai-msg-content #extra-submit:hover,
.wpai-msg-content button.submit-button:hover{
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(255, 86, 56, 0.4);
}
/* Lead Form */
#wpai-chatbot-leadform input,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--regular);
  background: #fff;
  border-radius: 2px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#wpai-chatbot-leadform input:focus {
  border-color: #ff5638;
  box-shadow: 0 0px 5px 2px rgba(255, 86, 56, 0.2);
}

#wpai-start-chat {
  background:linear-gradient(135deg, #ff5638, #ff5638);
  color: white;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#wpai-start-chat:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(255, 86, 56, 0.4);
}

/* Stop animation when chat panel is active */
#wpai-chatbot-panel.active + #wpai-chatbot-button:not(.bt-btn),
#wpai-chatbot-button:not(.bt-btn).active {
  animation: none;
  transform: scale(1);
  box-shadow: none;
}

@keyframes wpai-glow {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 86, 56, 0);
  }
  50% {
    box-shadow: 0 0 18px rgba(255, 86, 56, 0.6);
  }
}

@keyframes wpai-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes wpai-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 86, 56, 0);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 24px rgba(255, 86, 56, 0.4);
  }
}

.wpai-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.wpai-error {
  font-size: 12px;
  color: #ff5638;
  font-weight: 500;
}

.wpai-messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  overflow-y: auto;
}

/* row */
.wpai-msg-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
/* bot on left, user on right */
.wpai-msg-row.bot-row {
  justify-content: flex-start;
}
.wpai-msg-row.user-row {
  justify-content: flex-end;
}

/* avatar wrap */
.wpai-avatar-wrap {
  width: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* avatar image */
.wpai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* user avatar (text circle) */
.wpai-avatar-user {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0f0f0;
  color: #333;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

/* bubble wrapper (bubble + meta timestamp) */
.wpai-bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 76%;
}

/* bubble base */
.wpai-bubble {
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.4;
  word-break: break-word;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

/* bot bubble (brand color outline / accent) */
.bot-bubble {
  background: #fff;
  border-left: 2px solid #ff5638;
  color: #222;
}

/* user bubble (green-ish) */
.user-bubble {
  background: #ffece6; /* pale orange/peach to keep brand tone */
  color: #222;
  align-self: flex-end;
}

/* meta (timestamp) */
.wpai-meta {
  font-size: 11px;
  color: #888;
  align-self: flex-start;
}

/* ensure user meta aligns right */
.wpai-msg-row.user-row .wpai-meta {
  align-self: flex-end;
}

/* thinking dots */
.wpai-thinking-dots {
  display: inline-flex;
  gap: 4px;
  font-weight: 700;
  color: #ff5638;
  font-size: 18px;
  height: 22px;
  align-items: center;
}
.wpai-thinking-dots .dot {
  opacity: 0.2;
  animation: wpai-dot 1.2s infinite;
}
.wpai-thinking-dots .dot:nth-child(2) {
  animation-delay: 0.15s;
}
.wpai-thinking-dots .dot:nth-child(3) {
  animation-delay: 0.3s;
}

.wpai-subservice-item:hover {
  background: #f9fbff;
  border-color: #007bff;
}
.wpai-subservice-item input:checked + span {
  background: #007bff;
  color: white;
}

@keyframes wpai-dot {
  0% {
    opacity: 0.2;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-4px);
  }
  100% {
    opacity: 0.2;
    transform: translateY(0);
  }
}

/* message content small animation */
.wpai-bubble .wpai-msg-content {
  font-weight: 500;
  display: inline-block;
}

/* small adjustments to existing bubble look */
.user-bubble {
  border-radius: 14px;
}
.bot-bubble {
  border-radius: 12px;
}

.wpai-bot-suggestions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

/* small responsive tweak */
@media (max-width: 420px) {
  .wpai-bubble-wrap {
    max-width: 70%;
  }
  .wpai-avatar,
  .wpai-avatar-user {
    width: 34px;
    height: 34px;
  }
}
@media (max-width: 998px){
  #wpai-chatbot-panel{
    right: 10px;
  }
  #wpai-chatbot-button:not(.bt-btn){
    right: 10px;
  }
}
@media (max-width: 600px) {
  #wpai-chatbot-panel {
    width: 96% !important;
    height: auto !important;
    bottom: 90px !important;
    right: 2% !important;
    max-height: none !important;
    max-width: 400px !important;
  }
  #wpai-chatbot-header {
    padding: 12px !important;
  }

  #wpai-chatbot-header .wpai-company-name {
    font-size: 16px !important;
  }

  #wpai-chatbot-header .wpai-contact-item {
    font-size: 12px !important;
  }

  #wpai-chatbot-input-area {
    padding: 8px !important;
    gap: 6px !important;
  }

  #wpai-chatbot-input {
    font-size: 14px !important;
    padding: 8px 10px !important;
  }

  #wpai-chatbot-send img {
    width: 20px !important;
    height: 20px !important;
  }

  #wpai-chatbot-messages {
    padding: 10px !important;
    font-size: 14px !important;
  }

  .wpai-bubble {
    font-size: 12px !important;
    padding: 8px 10px !important;
  }

  .wpai-avatar {
    width: 28px !important;
    height: 28px !important;
  }

  /* Floating button should be smaller on mobile */
  #wpai-chatbot-button:not(.bt-btn) img {
    width: 44px !important;
    height: 44px !important;
    border-radius: 10px !important;
  }
}
 

@keyframes wpai-shake {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
  100% {
    transform: translateX(0);
  }
}

.wpai-error-highlight {
  border: 1px solid red !important;
}

.wpai-shake {
  animation: wpai-shake 0.25s;
}


/* remove googel recaptcha re-captcha badge */
.grecaptcha-badge { 
    visibility: hidden !important;
    opacity: 0 !important;
}
/*custom*/
div#wpai-chatbot-leadform .wpai-chatbot-content{
  /*padding:18px;*/
  text-align:center;
}
.chat-welcome{
  margin-bottom: 0;
  color: #ff5638;
  font-family: "Inter", sans-serif;
  padding: 0;
}
.chat-welcome-text{
  font-size:14px;
  line-height: 1.3;
  color:#111111;
  margin-bottom:12px;
  padding: 0;
}
#wpai-lead-form select#wpai-country{
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  background-image: url(data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>);
  background-repeat: no-repeat;
  background-position-x: 100%;
  background-position-y: 6px;
  border-radius: 2px;
}

.form-wrap input,
.form-wrap textarea{
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ff5638;
  background-color: #ffffff;
  margin-top: 4px;
  resize:none;
  outline: none;
}
#wpai-chatbot-messages div.form-wrap {
    margin-bottom: 7px;
}