/* ═══════════════════════════════════════════════════════
   AI CHATBOT — Infinity Solutions
   ═══════════════════════════════════════════════════════ */

/* Launcher button */
.chat-launcher {
  position: fixed; bottom: 28px; right: 28px; z-index: 9000;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  border: none; cursor: pointer;
  box-shadow: 0 4px 24px rgba(37,99,235,.45), 0 2px 8px rgba(0,0,0,.15);
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s, box-shadow .25s;
  animation: launcherPop .4s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes launcherPop { from{opacity:0;transform:scale(.5)} to{opacity:1;transform:scale(1)} }
.chat-launcher:hover { transform: scale(1.08); box-shadow: 0 8px 32px rgba(37,99,235,.55); }
.chat-launcher svg { transition: opacity .2s, transform .2s; }
.chat-launcher .icon-chat { position: absolute; }
.chat-launcher .icon-close { position: absolute; opacity: 0; transform: rotate(-90deg); }
.chat-launcher.open .icon-chat { opacity: 0; transform: rotate(90deg); }
.chat-launcher.open .icon-close { opacity: 1; transform: rotate(0deg); }

/* Unread dot */
.chat-launcher-dot {
  position: absolute; top: 4px; right: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #F59E0B; border: 2px solid #fff;
  font-size: .55rem; font-weight: 800; color: #fff;
  display: flex; align-items: center; justify-content: center;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%,100%{transform:scale(1)} 50%{transform:scale(1.2)} }

/* Chat window */
.chat-window {
  position: fixed; bottom: 100px; right: 28px; z-index: 8999;
  width: 380px; height: 560px;
  background: #fff; border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.08);
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(.92) translateY(16px); opacity: 0; pointer-events: none;
  transition: transform .3s cubic-bezier(.34,1.2,.64,1), opacity .25s ease;
  transform-origin: bottom right;
}
.chat-window.open {
  transform: scale(1) translateY(0); opacity: 1; pointer-events: all;
}

/* Header */
.chat-header {
  background: linear-gradient(135deg, #1E3A8A, #2563EB);
  padding: 18px 20px; display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.chat-header-av {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: 2px solid rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.chat-header-info { flex: 1; }
.chat-header-name { font-size: .92rem; font-weight: 700; color: #fff; font-family: 'Plus Jakarta Sans',sans-serif; }
.chat-header-status { display: flex; align-items: center; gap: 5px; font-size: .72rem; color: rgba(255,255,255,.75); margin-top: 2px; }
.chat-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #34D399; flex-shrink: 0; animation: pulse-dot 2s infinite; }
.chat-header-badge { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); border-radius: 100px; padding: 3px 10px; font-size: .65rem; font-weight: 700; color: rgba(255,255,255,.9); letter-spacing: .05em; }

/* Messages */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  background: #F8FAFC;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 2px; }

/* Message bubble */
.msg { display: flex; gap: 8px; align-items: flex-end; animation: msgIn .25s ease both; }
@keyframes msgIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.msg.user { flex-direction: row-reverse; }
.msg-av { width: 28px; height: 28px; border-radius: 50%; background: #DBEAFE; display: flex; align-items: center; justify-content: center; font-size: .8rem; flex-shrink: 0; }
.msg-bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: .875rem;
  line-height: 1.55; font-family: 'Plus Jakarta Sans',sans-serif;
}
.msg.bot .msg-bubble { background: #fff; color: #1E293B; border-radius: 4px 16px 16px 16px; box-shadow: 0 1px 4px rgba(0,0,0,.08); border: 1px solid #E2E8F0; }
.msg.user .msg-bubble { background: linear-gradient(135deg, #2563EB, #1D4ED8); color: #fff; border-radius: 16px 4px 16px 16px; }
.msg-time { font-size: .65rem; color: #94A3B8; margin-top: 3px; text-align: center; }

/* Typing indicator */
.typing-indicator { display: flex; align-items: center; gap: 4px; padding: 10px 14px; background: #fff; border-radius: 4px 16px 16px 16px; box-shadow: 0 1px 4px rgba(0,0,0,.08); border: 1px solid #E2E8F0; width: fit-content; }
.typing-dot { width: 7px; height: 7px; border-radius: 50%; background: #94A3B8; animation: typingBounce 1.2s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }

/* Quick replies */
.quick-replies { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 0 4px; }
.qr-btn {
  background: #fff; border: 1.5px solid #BFDBFE; color: #1D4ED8; border-radius: 100px;
  padding: 6px 14px; font-size: .78rem; font-weight: 600; cursor: pointer;
  font-family: 'Plus Jakarta Sans',sans-serif; transition: all .15s;
}
.qr-btn:hover { background: #EFF6FF; border-color: #93C5FD; }

/* Input area */
.chat-input-area { padding: 12px 14px; border-top: 1px solid #E2E8F0; background: #fff; display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.chat-input {
  flex: 1; border: 1.5px solid #E2E8F0; border-radius: 12px;
  padding: 10px 14px; font-family: 'Plus Jakarta Sans',sans-serif; font-size: .875rem;
  color: #1E293B; outline: none; resize: none; min-height: 40px; max-height: 100px;
  transition: border-color .2s; background: #F8FAFC; line-height: 1.45;
}
.chat-input:focus { border-color: #3B82F6; background: #fff; }
.chat-input::placeholder { color: #94A3B8; }
.chat-send {
  width: 38px; height: 38px; border-radius: 10px; border: none; flex-shrink: 0;
  background: linear-gradient(135deg, #2563EB, #1D4ED8); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.chat-send:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(37,99,235,.4); }
.chat-send:disabled { background: #E2E8F0; cursor: not-allowed; transform: none; box-shadow: none; }

/* Powered by */
.chat-powered { text-align: center; padding: 6px; font-size: .65rem; color: #94A3B8; background: #fff; border-top: 1px solid #F1F5F9; }

@media (max-width: 440px) {
  .chat-window { width: calc(100vw - 32px); right: 16px; height: 70vh; }
  .chat-launcher { right: 16px; bottom: 16px; }
}
