/* ==========================================================================
   Africa Business Pages - AI Sales Assistant Chatbot Widget
   ========================================================================== */

@keyframes abp-bot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.6); }
  70% { box-shadow: 0 0 0 14px rgba(255, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}

@keyframes abp-bot-fadein {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes abp-bot-dot {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

#b2b-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  box-sizing: border-box;
}

#b2b-chat-widget * {
  box-sizing: border-box;
}

/* Floating Launcher Button */
#chat-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ff0000;
  border: 3px solid #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  outline: none;
  animation: abp-bot-pulse 2.2s infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

#chat-toggle-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 25px rgba(255, 0, 0, 0.45);
}

#chat-toggle-btn img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 50%;
  pointer-events: none;
}

/* Online Badge on Launcher */
#online-bubble {
  position: absolute;
  top: -10px;
  right: -5px;
  background: #22c55e;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  border: 2px solid #ffffff;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

/* Chat Window Modal */
#chat-window {
  display: none;
  position: fixed;
  bottom: 95px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid #e5e7eb;
  overflow: hidden;
  flex-direction: column;
  z-index: 999999;
}

#chat-window.open {
  display: flex !important;
  animation: abp-bot-fadein 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Chat Header */
#chat-header {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #ff0000;
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  flex-shrink: 0;
}

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

.chat-title-wrap {
  display: flex;
  flex-direction: column;
}

.chat-header-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
}

.chat-header-sub {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.chat-online-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
}

#chat-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s ease;
}

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

/* Chat Messages Area */
#chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Message Bubbles */
.chat-msg {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-msg.bot-msg {
  background: #ffffff;
  color: #1e293b;
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chat-msg.user-msg {
  background: #ff0000;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
  box-shadow: 0 2px 6px rgba(255, 0, 0, 0.25);
}

.chat-msg a {
  color: #ff0000;
  font-weight: 700;
  text-decoration: underline;
}

.chat-msg.user-msg a {
  color: #ffffff;
}

.chat-msg img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
  display: block;
  border: 1px solid #e2e8f0;
}

/* Suggestion Chips */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.chat-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 5px 10px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-chip:hover {
  background: #ff0000;
  border-color: #ff0000;
  color: #ffffff;
}

/* Typing Indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: 12px;
  border-bottom-left-radius: 3px;
  border: 1px solid #e2e8f0;
  align-self: flex-start;
  width: fit-content;
}

.chat-typing span {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  display: inline-block;
  animation: abp-bot-dot 1.4s infinite ease-in-out both;
}

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

/* Input Area */
#chat-input-area {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#chat-input {
  flex: 1;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  font-size: 13px;
  color: #1e293b;
  outline: none;
  background: #f8fafc;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#chat-input:focus {
  border-color: #ff0000;
  background: #ffffff;
}

#chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ff0000;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
  padding: 0;
}

#chat-send:hover {
  background: #d90000;
  transform: scale(1.05);
}

#chat-send:active {
  transform: scale(0.95);
}

#chat-send svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  margin-left: 2px;
}

/* Footer Copyright & Links Visibility Enhancement */
.footer-copyright,
.footer-copyright p,
.footer-copyright a,
#footer .footer-copyright p,
#footer .footer-copyright a,
#sub-menu ul li a,
.bg-slate-950,
.bg-slate-950 p,
.bg-slate-950 a {
  color: #d1d5db !important;
}

.footer-copyright a:hover,
#sub-menu ul li a:hover,
.bg-slate-950 a:hover {
  color: #ffffff !important;
}
