/* ===== EMBAZZY AI CHATBOT WIDGET ===== */

/* --- Floating Chat Bubble --- */
.chatbot-bubble {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0891B2, #F97316);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  z-index: 9990;
  box-shadow: 0 6px 25px rgba(8, 145, 178, 0.45), 0 0 0 0 rgba(8, 145, 178, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: chatBubblePulse 2.5s ease-in-out infinite;
  border: none;
  outline: none;
}
.chatbot-bubble:hover {
  transform: scale(1.12);
  box-shadow: 0 8px 35px rgba(8, 145, 178, 0.55);
}
.chatbot-bubble.open {
  animation: none;
  transform: rotate(0deg);
}
.chatbot-bubble .bubble-icon-chat,
.chatbot-bubble .bubble-icon-close {
  position: absolute;
  transition: all 0.3s ease;
}
.chatbot-bubble .bubble-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}
.chatbot-bubble.open .bubble-icon-chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}
.chatbot-bubble.open .bubble-icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

@keyframes chatBubblePulse {
  0%, 100% { box-shadow: 0 6px 25px rgba(8, 145, 178, 0.45), 0 0 0 0 rgba(8, 145, 178, 0.4); }
  50% { box-shadow: 0 6px 25px rgba(8, 145, 178, 0.45), 0 0 0 14px rgba(8, 145, 178, 0); }
}

/* --- Preview Badge --- */
.chatbot-preview {
  position: fixed;
  bottom: 100px;
  right: 30px;
  background: #fff;
  color: #1E293B;
  padding: 12px 20px;
  border-radius: 16px 16px 4px 16px;
  font-size: 0.85rem;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
  z-index: 9989;
  max-width: 240px;
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  border: 1px solid #E2E8F0;
}
.chatbot-preview.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  cursor: pointer;
}
.chatbot-preview-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #EF4444;
  color: #fff;
  border: 2px solid #fff;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
  line-height: 1;
}
.chatbot-preview-close:hover {
  transform: scale(1.15);
}

/* --- Chat Window --- */
.chatbot-window {
  position: fixed;
  bottom: 105px;
  right: 30px;
  width: 380px;
  max-height: 540px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
  z-index: 9991;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.92);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.chatbot-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* --- Chat Header --- */
.chatbot-header {
  background: linear-gradient(135deg, #0891B2, #0E7490);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.chatbot-header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
}
.chatbot-header-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}
.chatbot-header-info span {
  font-size: 0.72rem;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 5px;
}
.chatbot-header-info span::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  display: inline-block;
  animation: onlinePulse 2s ease-in-out infinite;
}
@keyframes onlinePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Chat Body --- */
.chatbot-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #F8FAFC;
  min-height: 280px;
  max-height: 340px;
  scroll-behavior: smooth;
}
.chatbot-body::-webkit-scrollbar {
  width: 5px;
}
.chatbot-body::-webkit-scrollbar-track {
  background: transparent;
}
.chatbot-body::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 10px;
}

/* --- Message Bubbles --- */
.chatbot-msg {
  display: flex;
  gap: 8px;
  max-width: 88%;
  animation: msgFadeIn 0.35s ease;
}
.chatbot-msg.bot {
  align-self: flex-start;
}
.chatbot-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chatbot-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0891B2, #0E7490);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
}
.chatbot-msg.user .chatbot-msg-avatar {
  background: linear-gradient(135deg, #F97316, #EA580C);
}
.chatbot-msg-bubble {
  padding: 10px 15px;
  border-radius: 16px;
  font-size: 0.85rem;
  line-height: 1.55;
  font-family: 'Poppins', sans-serif;
}
.chatbot-msg.bot .chatbot-msg-bubble {
  background: #fff;
  color: #1E293B;
  border: 1px solid #E2E8F0;
  border-top-left-radius: 4px;
}
.chatbot-msg.user .chatbot-msg-bubble {
  background: linear-gradient(135deg, #0891B2, #0E7490);
  color: #fff;
  border-top-right-radius: 4px;
}

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

/* --- Quick Reply Buttons --- */
.chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  animation: msgFadeIn 0.35s ease;
}
.chatbot-quick-btn {
  padding: 8px 16px;
  border: 1.5px solid #0891B2;
  border-radius: 50px;
  background: transparent;
  color: #0891B2;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.chatbot-quick-btn:hover {
  background: #0891B2;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}
.chatbot-quick-btn:active {
  transform: translateY(0);
}
.chatbot-quick-btn i {
  margin-right: 5px;
}

/* --- Typing Indicator --- */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  animation: msgFadeIn 0.3s ease;
}
.chatbot-typing-dots {
  display: flex;
  gap: 4px;
  padding: 12px 18px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  border-top-left-radius: 4px;
}
.chatbot-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94A3B8;
  animation: typingBounce 1.2s ease-in-out infinite;
}
.chatbot-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.chatbot-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* --- Chat Input --- */
.chatbot-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #E2E8F0;
  background: #fff;
  flex-shrink: 0;
}
.chatbot-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #E2E8F0;
  border-radius: 50px;
  font-size: 0.85rem;
  font-family: 'Poppins', sans-serif;
  color: #1E293B;
  background: #F8FAFC;
  outline: none;
  transition: border 0.3s;
}
.chatbot-input:focus {
  border-color: #0891B2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}
.chatbot-input::placeholder {
  color: #94A3B8;
}
.chatbot-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.chatbot-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #0891B2, #0E7490);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  flex-shrink: 0;
}
.chatbot-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 15px rgba(8, 145, 178, 0.4);
}
.chatbot-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* --- Thank You Actions --- */
.chatbot-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
  animation: msgFadeIn 0.4s ease;
}
.chatbot-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
}
.chatbot-action-btn.call {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff;
}
.chatbot-action-btn.whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
}
.chatbot-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* --- Powered By Footer --- */
.chatbot-footer {
  padding: 6px 16px;
  text-align: center;
  font-size: 0.65rem;
  color: #94A3B8;
  background: #fff;
  border-top: 1px solid #F1F5F9;
  flex-shrink: 0;
}
.chatbot-footer a {
  color: #0891B2;
  text-decoration: none;
  font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .chatbot-window {
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .chatbot-bubble {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
  }
  .chatbot-preview {
    right: 20px;
    bottom: 85px;
    max-width: 200px;
    font-size: 0.8rem;
  }
  .chatbot-body {
    max-height: calc(100vh - 180px);
    min-height: calc(100vh - 180px);
  }
}

@media (max-width: 768px) and (min-width: 481px) {
  .chatbot-window {
    width: 340px;
    right: 15px;
    bottom: 100px;
  }
  .chatbot-bubble {
    bottom: 25px;
    right: 20px;
  }
  .chatbot-preview {
    right: 20px;
    bottom: 95px;
  }
}
