/* ==========================================================================
   BAP SIGNATURES - CORPORATE CONCIERGE CHATBOT WIDGET
   Position: Bottom-Right Corner Floating Widget
   ========================================================================== */

/* Floating Chatbot Widget Container (Strictly Fixed to Bottom-Right Corner) */
.whatsapp-widget-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Floating Round Trigger Button */
.whatsapp-trigger-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366; /* WhatsApp Brand Green */
  border: 2px solid #ffffff;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  transition: all var(--transition-smooth);
  position: relative;
  outline: none;
}

.whatsapp-trigger-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.5), 0 6px 16px rgba(0, 0, 0, 0.2);
}

.whatsapp-trigger-btn svg {
  width: 30px;
  height: 30px;
  fill: #ffffff;
}

.whatsapp-online-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
}

/* Chat Popup Window (Opens above trigger from bottom-right) */
.whatsapp-chat-box {
  position: absolute;
  bottom: 74px;
  right: 0;
  width: 350px;
  max-width: calc(100vw - 36px);
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.96);
  transform-origin: bottom right;
  transition: all var(--transition-smooth);
  z-index: 10000;
}

.whatsapp-chat-box.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-box-header {
  background: #090a0f;
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.chat-header-info h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
  line-height: 1.2;
}

.chat-header-info span {
  font-size: 0.72rem;
  color: #25d366;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-header-info span::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #25d366;
}

.chat-box-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.chat-box-close:hover {
  color: #ffffff;
}

/* Chat Messages Body */
.chat-box-body {
  padding: 18px;
  background: #f8fafc;
  min-height: 220px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

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

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

.chat-msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.5;
}

.chat-msg.bot .chat-msg-bubble {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 2px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.chat-msg.user .chat-msg-bubble {
  background: #0f172a;
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.chat-msg-time {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 3px;
  align-self: flex-end;
}

/* Quick Options Grid */
.chat-quick-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.chat-option-btn {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chat-option-btn:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* Chat Footer / Input */
.chat-box-footer {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  color: #0f172a;
  outline: none;
  background: #f8fafc;
}

.chat-input:focus {
  border-color: #0f172a;
  background: #ffffff;
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0f172a;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}

.chat-send-btn:hover {
  background: #25d366;
}

.chat-send-btn svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 480px) {
  .whatsapp-widget-container {
    bottom: 18px;
    right: 18px;
  }
  .whatsapp-chat-box {
    width: calc(100vw - 36px);
    right: 0;
  }
}
