/* ============================================================
   chatbot.css — Ganspar Life Sciences Help & Support Chatbot
   ============================================================ */

/* Floating Launcher Button */
.chatbot-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #073a72 0%, #2daae1 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 6px 20px rgba(7, 58, 114, 0.4);
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbot-launcher:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 10px 25px rgba(45, 170, 225, 0.5);
}

.chatbot-launcher .launcher-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
  animation: chatPulse 2s infinite;
}

@keyframes chatPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Chat Widget Container */
.chatbot-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(7, 58, 114, 0.25), 0 0 1px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(7, 58, 114, 0.08);
}

.chatbot-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chatbot Header */
.chatbot-header {
  background: linear-gradient(135deg, #073a72 0%, #1a5daa 100%);
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.chatbot-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.chatbot-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.chatbot-avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  background: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.chatbot-header-title h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatbot-header-title p {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: #cbd5e1;
}

.chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatbot-hdr-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.chatbot-hdr-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages Area */
.chatbot-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.chat-msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: chatMsgFadeIn 0.3s ease;
}

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

.chat-msg.bot {
  align-self: flex-start;
}

.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.45;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.chat-msg.bot .chat-msg-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.chat-msg.user .chat-msg-bubble {
  background: linear-gradient(135deg, #073a72 0%, #2daae1 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-msg-time {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 4px;
  display: block;
}

.chat-msg.user .chat-msg-time {
  text-align: right;
  color: rgba(255, 255, 255, 0.8);
}

/* Quick Action Pills */
.chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chat-pill-btn {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chat-pill-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  transform: translateY(-1px);
}

/* Typing Animation */
.chat-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  align-self: flex-start;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.chat-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.chat-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* In-Chat Lead Form */
.chat-lead-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.chat-lead-box input, .chat-lead-box textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 8px;
  font-family: inherit;
  outline: none;
}

.chat-lead-box input:focus, .chat-lead-box textarea:focus {
  border-color: #2daae1;
}

.chat-lead-submit {
  width: 100%;
  background: #073a72;
  color: #ffffff;
  border: none;
  padding: 8px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-lead-submit:hover {
  background: #2daae1;
}

/* Chat Input Bar */
.chatbot-footer {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.chatbot-input-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border-radius: 24px;
  padding: 4px 6px 4px 14px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.chatbot-input-form:focus-within {
  background: #ffffff;
  border-color: #2daae1;
  box-shadow: 0 0 0 3px rgba(45, 170, 225, 0.15);
}

.chatbot-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.88rem;
  color: #1e293b;
  font-family: inherit;
}

.chatbot-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #073a72 0%, #2daae1 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.chatbot-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(45, 170, 225, 0.4);
}

.chatbot-powered {
  text-align: center;
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 6px;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .whatsapp-float {
    bottom: 78px !important;
    right: 16px !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 1.3rem !important;
  }
  .chatbot-launcher {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }
  .chatbot-window {
    bottom: 75px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
    height: calc(100vh - 90px);
    border-radius: 16px;
  }
}
