/* ============================================================
   BITLINKO CHAT SUPPORT WIDGET
   ============================================================ */

/* ===== CONTAINER ===== */
#chat-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99999;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ===== FLOATING BUTTON ===== */
.chat-fab {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1A7A6E 0%, #0F2A28 100%);
  border: none; cursor: pointer;
  box-shadow: 0 8px 32px rgba(26,122,110,.45), 0 2px 8px rgba(0,0,0,.2);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem;
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 12px 40px rgba(26,122,110,.55); }
.chat-fab:active { transform: scale(.96); }

/* pulse ring */
.chat-fab::before {
  content: '';
  position: absolute; inset: -5px;
  border-radius: 50%;
  background: rgba(26,122,110,.22);
  animation: chatPulse 2.2s ease-in-out infinite;
}
@keyframes chatPulse {
  0%,100% { transform: scale(1); opacity: 1; }
  60%      { transform: scale(1.35); opacity: 0; }
}

/* notification badge */
.chat-badge {
  position: absolute; top: -2px; right: -2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #E11D48; color: #fff;
  font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  animation: chatBadgePop .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes chatBadgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}
.chat-badge.hidden { display: none; }

/* ===== CHAT WINDOW ===== */
.chat-win {
  position: absolute;
  bottom: 76px; right: 0;
  width: 360px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0,0,0,.18), 0 8px 24px rgba(0,0,0,.1);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: scale(.88) translateY(20px);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.34,1.26,.64,1), opacity .25s ease;
  max-height: 540px;
}
.chat-win.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ===== HEADER ===== */
.chat-head {
  background: linear-gradient(135deg, #0F2A28 0%, #1A5C54 100%);
  padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.chat-head-left { display: flex; align-items: center; gap: 12px; }
.chat-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #1A7A6E, #C9A84C);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem; font-weight: 800; color: #fff;
  font-family: 'Sora', sans-serif; flex-shrink: 0;
}
.chat-head-name { font-size: .9375rem; font-weight: 700; color: #fff; }
.chat-head-status { font-size: .75rem; color: rgba(255,255,255,.6); margin-top: 1px; display: flex; align-items: center; gap: 5px; }
.chat-head-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #4ADE80; display: block; }
.chat-close-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: none; cursor: pointer;
  color: rgba(255,255,255,.8); font-size: .875rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s; flex-shrink: 0;
}
.chat-close-btn:hover { background: rgba(255,255,255,.22); color: #fff; }

/* ===== MESSAGES AREA ===== */
.chat-msgs {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 18px 16px 8px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 280px; max-height: 340px;
  scroll-behavior: smooth;
}
.chat-msgs::-webkit-scrollbar { width: 4px; }
.chat-msgs::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

/* ===== MESSAGE BUBBLES ===== */
.chat-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; }
.chat-msg.bot { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #1A7A6E, #0F2A28);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 800; color: #fff; flex-shrink: 0;
  margin-bottom: 2px;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: .875rem; line-height: 1.55;
  animation: msgSlide .25s ease;
}
@keyframes msgSlide {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bot .msg-bubble {
  background: #F1F5F9;
  color: #1E293B;
  border-bottom-left-radius: 4px;
}
.user .msg-bubble {
  background: linear-gradient(135deg, #1A7A6E, #0F2A28);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* typing indicator */
.typing-dots {
  display: flex; gap: 4px; align-items: center; padding: 4px 2px;
}
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #94A3B8; display: block;
  animation: typingBounce 1.2s ease infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce {
  0%,80%,100% { transform: translateY(0); }
  40%          { transform: translateY(-6px); }
}

/* ===== QUICK REPLIES ===== */
.chat-qr {
  padding: 6px 14px 10px;
  display: flex; flex-wrap: wrap; gap: 8px;
  flex-shrink: 0;
}
.qr-btn {
  padding: 8px 14px; border-radius: 100px;
  background: #fff; color: #1A7A6E;
  border: 1.5px solid #1A7A6E;
  font-size: .8125rem; font-weight: 600;
  cursor: pointer; transition: all .2s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.qr-btn:hover { background: #1A7A6E; color: #fff; }
.qr-btn:active { transform: scale(.96); }

/* ===== INPUT AREA ===== */
.chat-inp-wrap {
  padding: 10px 14px 14px;
  display: flex; gap: 8px; align-items: center;
  border-top: 1px solid #F1F5F9;
  flex-shrink: 0;
}
.chat-inp {
  flex: 1; padding: 10px 14px;
  border: 1.5px solid #E2E8F0; border-radius: 100px;
  font-size: .875rem; font-family: inherit; color: #1E293B;
  outline: none; background: #F8FAFC;
  transition: border-color .2s;
}
.chat-inp:focus { border-color: #1A7A6E; background: #fff; }
.chat-inp::placeholder { color: #94A3B8; }
.chat-inp:disabled { opacity: .5; cursor: not-allowed; }
.chat-send {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #1A7A6E, #0F2A28);
  border: none; cursor: pointer; color: #fff; font-size: .9375rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform .2s, box-shadow .2s;
}
.chat-send:hover { transform: scale(1.1); box-shadow: 0 4px 16px rgba(26,122,110,.4); }
.chat-send:active { transform: scale(.95); }
.chat-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* ===== SUCCESS SCREEN ===== */
.chat-success {
  padding: 32px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.chat-success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #4ADE80, #16A34A);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
  animation: successPop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes successPop { from { transform: scale(0); } to { transform: scale(1); } }
.chat-success h3 { font-size: 1.0625rem; font-weight: 700; color: #0F172A; margin: 0; }
.chat-success p  { font-size: .875rem; color: #64748B; margin: 0; line-height: 1.6; }
.chat-success-contact {
  margin-top: 8px; padding: 14px 18px;
  background: #F1F5F9; border-radius: 12px; width: 100%;
  font-size: .8125rem; color: #475569; line-height: 1.8;
}

/* ===== MOBILE ===== */
@media (max-width: 420px) {
  #chat-widget { bottom: 16px; right: 16px; }
  .chat-win { width: calc(100vw - 32px); right: 0; }
}
