/* Floating Action Buttons Positioning: WhatsApp on Left, Chatbot on Right */
.wa-fab {
  position: fixed !important;
  bottom: 26px !important;
  left: 26px !important;
  right: auto !important;
  z-index: 999 !important;
}
.wa-fab-tip {
  left: 68px !important;
  right: auto !important;
}

.is-chat-btn {
  position: fixed;
  bottom: 26px;
  right: 26px;
  left: auto;
  z-index: 998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0B1E3D, #1A5C96);
  border: 2px solid #E8B84B;
  box-shadow: 0 6px 20px rgba(11, 30, 61, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.is-chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 28px rgba(200, 150, 42, 0.55);
}
.is-chat-btn svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}
.is-chat-window{
  position:fixed;
  bottom:90px;
  right:26px;
  z-index:1000;
  width:380px;
  max-width:calc(100vw - 32px);
  height:520px;
  max-height:calc(100vh - 120px);
  background:#fff;
  border-radius:18px;
  box-shadow:0 16px 40px rgba(11,30,61,0.28);
  border:1px solid rgba(26,92,150,0.18);
  display:none;
  flex-direction:column;
  overflow:hidden;
  font-family:'DM Sans',sans-serif;
  animation:isChatFadeIn .25s ease-out;
}
.is-chat-window.open{
  display:flex;
}
@keyframes isChatFadeIn{
  from{opacity:0;transform:translateY(12px)}
  to{opacity:1;transform:translateY(0)}
}
.is-chat-header{
  background:linear-gradient(135deg,#0B1E3D 0%,#173663 100%);
  color:#fff;
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid rgba(200,150,42,0.3);
}
.is-chat-header-info h4{
  font-size:14px;
  font-weight:700;
  color:#fff;
  margin:0;
  display:flex;
  align-items:center;
  gap:6px;
}
.is-chat-status{
  display:inline-block;
  width:8px;
  height:8px;
  background:#22c55e;
  border-radius:50%;
}
.is-chat-header-info p{
  font-size:11px;
  color:#E8B84B;
  margin:2px 0 0;
}
.is-chat-close{
  background:none;
  border:none;
  color:rgba(255,255,255,0.7);
  font-size:22px;
  cursor:pointer;
  padding:2px 6px;
  line-height:1;
}
.is-chat-close:hover{
  color:#fff;
}
.is-chat-body{
  flex:1;
  padding:16px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:12px;
  background:#FAFBFD;
}
.is-chat-body::-webkit-scrollbar{
  width:6px;
}
.is-chat-body::-webkit-scrollbar-thumb{
  background:rgba(11,30,61,0.15);
  border-radius:10px;
}
.is-chat-msg{
  max-width:85%;
  padding:10px 14px;
  border-radius:14px;
  font-size:13px;
  line-height:1.55;
  word-break:break-word;
}
.is-chat-msg.bot{
  background:#fff;
  color:#1C2B3A;
  align-self:flex-start;
  border-bottom-left-radius:3px;
  border:1px solid rgba(26,92,150,0.1);
  box-shadow:0 2px 6px rgba(0,0,0,0.03);
}
.is-chat-msg.user{
  background:linear-gradient(135deg,#0B1E3D,#1A5C96);
  color:#fff;
  align-self:flex-end;
  border-bottom-right-radius:3px;
}
.is-chat-msg.bot p{
  margin:0 0 6px 0;
}
.is-chat-msg.bot p:last-child{
  margin-bottom:0;
}
.is-chat-msg.bot ul, .is-chat-msg.bot ol{
  margin:4px 0 6px 18px;
  padding:0;
}
.is-chat-msg.bot li{
  margin-bottom:4px;
}

/* TYPING INDICATOR */
.is-typing-indicator{
  display:none;
  align-self:flex-start;
  background:#fff;
  border:1px solid rgba(26,92,150,0.1);
  padding:10px 16px;
  border-radius:14px;
  border-bottom-left-radius:3px;
}
.is-typing-indicator.active{
  display:flex;
  gap:4px;
  align-items:center;
}
.is-dot{
  width:6px;
  height:6px;
  background:var(--gold,#C8962A);
  border-radius:50%;
  animation:isDotPulse 1.4s infinite ease-in-out;
}
.is-dot:nth-child(2){animation-delay:.2s}
.is-dot:nth-child(3){animation-delay:.4s}
@keyframes isDotPulse{
  0%,80%,100%{transform:scale(0.6);opacity:.4}
  40%{transform:scale(1);opacity:1}
}

/* CITATIONS & ACTION BUTTONS */
.is-chat-citations{
  margin-top:8px;
  padding-top:8px;
  border-top:1px dashed rgba(26,92,150,0.15);
  font-size:11px;
  color:#5A7190;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.is-chat-citations a{
  color:#C8962A;
  text-decoration:none;
  font-weight:600;
}
.is-chat-quick-actions{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:6px;
}
.is-chat-action-btn{
  background:rgba(200,150,42,0.08);
  border:1px solid rgba(200,150,42,0.3);
  color:#0B1E3D;
  font-size:12px;
  font-weight:600;
  padding:8px 12px;
  border-radius:8px;
  text-align:left;
  cursor:pointer;
  transition:all .18s;
}
.is-chat-action-btn:hover{
  background:#C8962A;
  color:#fff;
  border-color:#C8962A;
}

/* LEAD CAPTURE FORM */
.is-lead-form-card{
  background:#fff;
  border:1.5px solid #E8B84B;
  border-radius:12px;
  padding:14px;
  margin-top:6px;
  box-shadow:0 4px 14px rgba(200,150,42,0.12);
}
.is-lead-form-card h5{
  margin:0 0 4px 0;
  font-size:13px;
  color:#0B1E3D;
  font-weight:700;
}
.is-lead-form-card p{
  font-size:11.5px;
  color:#5A7190;
  margin:0 0 10px 0;
}
.is-lead-input{
  width:100%;
  padding:7px 10px;
  font-size:12px;
  border:1px solid rgba(26,92,150,0.2);
  border-radius:6px;
  margin-bottom:8px;
  outline:none;
  box-sizing:border-box;
}
.is-lead-input:focus{
  border-color:#C8962A;
}
.is-lead-submit{
  width:100%;
  padding:8px;
  background:linear-gradient(135deg,#C8962A,#E8B84B);
  border:none;
  color:#0B1E3D;
  font-weight:700;
  font-size:12.5px;
  border-radius:6px;
  cursor:pointer;
  transition:transform .15s;
}
.is-lead-submit:hover{
  transform:translateY(-1px);
}

/* FOOTER INPUT */
.is-chat-footer{
  padding:12px 16px;
  background:#fff;
  border-top:1px solid rgba(26,92,150,0.1);
  display:flex;
  gap:8px;
}
.is-chat-input{
  flex:1;
  border:1px solid rgba(26,92,150,0.2);
  border-radius:8px;
  padding:8px 12px;
  font-size:13px;
  outline:none;
}
.is-chat-input:focus{
  border-color:#C8962A;
}
.is-chat-send{
  background:linear-gradient(135deg,#C8962A,#E8B84B);
  color:#0B1E3D;
  border:none;
  border-radius:8px;
  padding:0 14px;
  font-weight:700;
  font-size:13px;
  cursor:pointer;
}

@media(max-width:768px){
  .wa-fab {
    left: 18px !important;
    bottom: 20px !important;
    width: 48px !important;
    height: 48px !important;
  }
  .is-chat-btn {
    right: 18px !important;
    bottom: 20px !important;
    width: 48px !important;
    height: 48px !important;
  }
  .is-chat-window {
    width: calc(100vw - 24px) !important;
    right: 12px !important;
    bottom: 78px !important;
    height: 460px !important;
  }
}
