/* ═══════════════════════════════════════════
   MST NETWORKS — AI GUIDE CHATBOT WIDGET
   ═══════════════════════════════════════════ */

/* Trigger button */
.float-btn-wrap {
  position: fixed; bottom: 32px; right: 96px;
  z-index: 9500; display: flex; flex-direction: column;
  align-items: flex-end; gap: 14px;
  pointer-events: none; /* Let clicks pass through */
}
.float-trigger {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--red); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(200,16,46,0.55);
  transition: all .3s cubic-bezier(.22,1,.36,1);
  position: relative; flex-shrink: 0;
  pointer-events: auto; /* Re-enable clicks for trigger */
}
.float-trigger:hover { background: var(--red-bright); transform: scale(1.08); box-shadow: 0 6px 32px rgba(200,16,46,0.7); }
.float-trigger svg { width: 24px; height: 24px; fill: #fff; transition: transform .35s; }
.float-trigger.open svg { transform: rotate(45deg); }
.float-trigger::before {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(200,16,46,0.4);
  animation: chatPulse 2.2s ease-out infinite;
}
@keyframes chatPulse { 0%{transform:scale(1);opacity:1;} 100%{transform:scale(1.55);opacity:0;} }

/* Unread badge */
.chat-badge {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--red);
  font-size: .65rem; font-weight: 800; color: var(--red);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0);
  transition: all .3s cubic-bezier(.22,1,.36,1);
}
.chat-badge.show { opacity: 1; transform: scale(1); }

/* Chat window */
.chatbot-window {
  width: 360px; height: 520px;
  background: #0d0d0d; border: 1px solid rgba(200,16,46,0.25);
  border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(200,16,46,0.08);
  transform: translateY(20px) scale(0.95); opacity: 0;
  pointer-events: none; transform-origin: bottom right;
  transition: all .3s cubic-bezier(.22,1,.36,1);
}
.chatbot-window.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }

/* Header */
.chat-header {
  background: #111; padding: 14px 18px;
  border-bottom: 1px solid rgba(200,16,46,0.15);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.chat-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(200,16,46,0.12); border: 1px solid rgba(200,16,46,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.chat-header-info { flex: 1; }
.chat-header-info h4 { font-size: .88rem; font-weight: 700; margin: 0; color: #fff; }
.chat-header-info p { font-size: .7rem; color: #4ade80; margin: 0; display: flex; align-items: center; gap: 5px; }
.chat-header-info p::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #4ade80; display: inline-block; }
.chat-close-btn {
  background: none; border: none; color: #555; cursor: pointer;
  font-size: 1.2rem; padding: 4px; transition: color .2s; line-height: 1;
}
.chat-close-btn:hover { color: var(--red); }

/* Messages area */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: rgba(200,16,46,0.2) transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(200,16,46,0.2); border-radius: 2px; }

/* Bubbles */
.chat-msg { display: flex; gap: 8px; align-items: flex-end; }
.chat-msg.bot { flex-direction: row; }
.chat-msg.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: rgba(200,16,46,0.12); border: 1px solid rgba(200,16,46,0.2);
  display: flex; align-items: center; justify-content: center; font-size: .75rem;
}
.msg-bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 14px;
  font-size: .82rem; line-height: 1.55; font-family: var(--font);
}
.chat-msg.bot .msg-bubble {
  background: #1a1a1a; border: 1px solid rgba(200,16,46,0.12);
  color: #ddd; border-radius: 14px 14px 14px 4px;
}
.chat-msg.user .msg-bubble {
  background: var(--red); color: #fff;
  border-radius: 14px 14px 4px 14px;
}
.msg-bubble a { color: #ff6b6b; text-decoration: underline; }
.msg-bubble strong { color: #fff; }

/* Typing indicator */
.typing-indicator { display: flex; gap: 4px; padding: 12px 14px; align-items: center; }
.typing-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(200,16,46,0.5);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }

/* Quick replies */
.quick-replies {
  padding: 6px 14px 10px; display: flex;
  flex-wrap: wrap; gap: 7px; flex-shrink: 0;
}
.quick-chip {
  font-size: .74rem; font-weight: 600; font-family: var(--font);
  padding: 6px 12px; border-radius: 100px; cursor: pointer;
  background: rgba(200,16,46,0.07); border: 1px solid rgba(200,16,46,0.25);
  color: #ccc; transition: all .2s; white-space: nowrap;
}
.quick-chip:hover { background: rgba(200,16,46,0.18); border-color: var(--red); color: #fff; }

/* Input bar */
.chat-input-bar {
  padding: 10px 14px 14px; border-top: 1px solid rgba(200,16,46,0.1);
  display: flex; gap: 8px; align-items: center; flex-shrink: 0;
  background: #0d0d0d;
}
#chat-input {
  flex: 1; background: #1a1a1a; border: 1px solid rgba(200,16,46,0.18);
  border-radius: 8px; padding: 9px 13px; color: #ddd;
  font-family: var(--font); font-size: .82rem; outline: none;
  transition: border-color .2s;
}
#chat-input:focus { border-color: rgba(200,16,46,0.5); }
#chat-input::placeholder { color: #444; }
#chat-send {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--red); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .2s;
}
#chat-send:hover { background: var(--red-bright); }
#chat-send svg { width: 16px; height: 16px; fill: #fff; }

/* Bot message fade-in */
@keyframes msgIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }
.chat-msg { animation: msgIn .25s ease; }
