/* ============================================
   BONZAIRE AI ASSISTANT CHATBOT
   ============================================ */

/* Floating toggle button */
.chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E40AF, #3B82F6);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(30,64,175,.35);
  transition: all .3s ease;
  color: #fff;
}
.chatbot-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(30,64,175,.45);
}
.chatbot-toggle .chatbot-icon-open,
.chatbot-toggle .chatbot-icon-close {
  position: absolute;
  transition: opacity .2s, transform .2s;
}
.chatbot-toggle .chatbot-icon-close {
  opacity: 0;
  transform: rotate(-90deg);
}
.chatbot-toggle.active .chatbot-icon-open {
  opacity: 0;
  transform: rotate(90deg);
}
.chatbot-toggle.active .chatbot-icon-close {
  opacity: 1;
  transform: rotate(0deg);
}

/* Notification dot */
.chatbot-toggle .chatbot-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #EF4444;
  border: 2px solid #fff;
  animation: chatbot-pulse 2s infinite;
}
.chatbot-toggle.active .chatbot-dot { display: none; }

@keyframes chatbot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Chat window */
.chatbot-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  z-index: 9999;
  width: 380px;
  max-height: 540px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 48px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(.96);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.chatbot-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.chatbot-header {
  background: linear-gradient(135deg, #1E40AF, #3B82F6);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chatbot-avatar svg { color: #fff; }
.chatbot-header-info { flex: 1; }
.chatbot-header-info h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.chatbot-header-info p {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  gap: 5px;
}
.chatbot-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34D399;
  display: inline-block;
}

/* Messages area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: 340px;
  background: #F8FAFC;
}
.chatbot-messages::-webkit-scrollbar { width: 4px; }
.chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }

/* Message bubbles */
.chatbot-msg {
  display: flex;
  gap: 8px;
  max-width: 88%;
  animation: chatbot-fadeIn .3s ease;
}
.chatbot-msg.bot { align-self: flex-start; }
.chatbot-msg.user { align-self: flex-end; flex-direction: row-reverse; }

@keyframes chatbot-fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chatbot-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
}
.chatbot-msg.bot .chatbot-msg-avatar {
  background: linear-gradient(135deg, #1E40AF, #3B82F6);
  color: #fff;
}
.chatbot-msg.user .chatbot-msg-avatar {
  background: #E2E8F0;
  color: #475569;
  font-weight: 600;
}

.chatbot-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  word-wrap: break-word;
}
.chatbot-msg.bot .chatbot-bubble {
  background: #fff;
  color: #1E293B;
  border: 1px solid #E2E8F0;
  border-top-left-radius: 4px;
}
.chatbot-msg.user .chatbot-bubble {
  background: linear-gradient(135deg, #1E40AF, #3B82F6);
  color: #fff;
  border-top-right-radius: 4px;
}
.chatbot-bubble a {
  color: #3B82F6;
  text-decoration: underline;
  font-weight: 500;
}
.chatbot-msg.user .chatbot-bubble a {
  color: #BFDBFE;
}
.chatbot-bubble strong {
  font-weight: 600;
}

/* Quick replies / suggestion chips */
.chatbot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  animation: chatbot-fadeIn .4s ease;
}
.chatbot-chip {
  background: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.chatbot-chip:hover {
  background: #1E40AF;
  color: #fff;
  border-color: #1E40AF;
}

/* Typing indicator */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  border-top-left-radius: 4px;
  width: fit-content;
}
.chatbot-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94A3B8;
  animation: chatbot-typingDot 1.2s ease-in-out infinite;
}
.chatbot-typing span:nth-child(2) { animation-delay: .2s; }
.chatbot-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes chatbot-typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Input area */
.chatbot-input-area {
  padding: 12px 16px;
  border-top: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
}
.chatbot-input {
  flex: 1;
  border: 1px solid #E2E8F0;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: #1E293B;
  background: #F8FAFC;
  outline: none;
  transition: border-color .2s;
}
.chatbot-input::placeholder { color: #94A3B8; }
.chatbot-input:focus { border-color: #3B82F6; background: #fff; }

.chatbot-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #1E40AF, #3B82F6);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}
.chatbot-send:hover { transform: scale(1.05); box-shadow: 0 2px 8px rgba(30,64,175,.3); }
.chatbot-send:disabled { opacity: .5; cursor: default; transform: none; }

/* Mobile responsive */
@media (max-width: 480px) {
  .chatbot-window {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 80px;
    max-height: calc(100vh - 120px);
    border-radius: 12px;
  }
  .chatbot-toggle {
    bottom: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
  }
  .chatbot-messages { min-height: 220px; max-height: calc(100vh - 280px); }
}

/* ============================================
   SOCIAL LOGIN BUTTONS
   ============================================ */
.social-login-section {
  margin-top: 4px;
}
.social-login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: #94A3B8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.social-login-divider::before,
.social-login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E2E8F0;
}

.social-login-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.social-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #fff;
  font-size: 13.5px;
  font-weight: 500;
  color: #1E293B;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.social-login-btn:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.social-login-btn svg { flex-shrink: 0; }

.social-login-btn.google-btn:hover { border-color: #EA4335; }
.social-login-btn.facebook-btn { background: #1877F2; color: #fff; border-color: #1877F2; }
.social-login-btn.facebook-btn:hover { background: #166FE5; }
.social-login-btn.viber-btn { background: #7360F2; color: #fff; border-color: #7360F2; }
.social-login-btn.viber-btn:hover { background: #6350E0; }
