/* WordPress Theme Anti-Conflict Reset */
#saas-chatbot-container, #saas-chatbot-container * {
  box-sizing: border-box !important;
}

#saas-chatbot-container { position: fixed; bottom: 20px; right: 20px; z-index: 999999; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

/* Chat Trigger Button */
#saas-chatbot-btn { width: 60px; height: 60px; background: #3178ff; border-radius: 50%; cursor: pointer; box-shadow: 0 4px 14px rgba(49, 120, 255, 0.4); display: flex; align-items: center; justify-content: center; transition: transform 0.3s ease, box-shadow 0.3s ease; }
#saas-chatbot-btn:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(49, 120, 255, 0.6); }
#saas-chatbot-btn svg { fill: white; width: 30px; height: 30px; }

/* Main Chat Window */
#saas-chatbot-window { display: none; width: 350px; height: 500px; background: #ffffff; border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); flex-direction: column; overflow: hidden; margin-bottom: 20px; border: 1px solid #f3f4f6; }

/* Header Premium Design */
#saas-chatbot-header { background: linear-gradient(90deg, rgba(49,120,255,0.05) 0%, rgba(49,120,255,0.1) 100%); padding: 16px; border-bottom: 1px solid #f3f4f6; display: flex; justify-content: space-between; align-items: center; }
.header-content { display: flex; align-items: center; gap: 12px; }
.header-icon { width: 40px; height: 40px; background: #3178ff; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.header-icon svg { color: white; width: 22px; height: 22px; }
.header-text h2 { margin: 0; font-size: 16px; font-weight: 700; color: #111827; line-height: 1.2; }
.header-text p { margin: 0; font-size: 12px; color: #6b7280; margin-top: 2px; }
#saas-chatbot-close { cursor: pointer; font-size: 26px; color: #9ca3af; line-height: 1; transition: color 0.2s; padding-bottom: 4px; }
#saas-chatbot-close:hover { color: #111827; }

/* Messages Area */
#saas-chatbot-messages { flex: 1; padding: 20px; overflow-y: auto; background: #f9fafb; display: flex; flex-direction: column; gap: 16px; }

/* Chat Bubbles Layout */
.chat-wrapper { display: flex; gap: 10px; align-items: flex-start; width: 100%; margin: 0 !important; }
.chat-wrapper.user { justify-content: flex-end; }
.avatar { width: 32px; height: 32px; background: #3178ff; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar svg { color: white; width: 18px; height: 18px; }

.chat-msg { max-width: 80%; padding: 12px 16px; font-size: 14px; line-height: 1.5; word-wrap: break-word; box-shadow: 0 1px 2px rgba(0,0,0,0.05); margin: 0 !important; }
.chat-msg.bot { background: #ffffff; color: #1f2937; border-radius: 16px 16px 16px 4px; border: 1px solid #f3f4f6; }
.chat-msg.user { background: #3178ff; color: #ffffff; border-radius: 16px 16px 4px 16px; }
.chat-msg a { color: #3178ff; text-decoration: none; font-weight: 600; box-shadow: none !important; }
.chat-msg a:hover { text-decoration: underline; }
.chat-msg.user a { color: #ffffff; text-decoration: underline; }

/* Bulletproof Typing Indicator - Fixed for WordPress */
.sellerfast-typing { display: flex; gap: 4px; align-items: center; height: 24px; padding: 4px 8px; }
.sellerfast-typing .sellerfast-dot { 
  width: 6px !important; 
  height: 6px !important; 
  background-color: #9ca3af !important; 
  border-radius: 50% !important; 
  animation: saasBotBounce 1s infinite ease-in-out !important; 
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  margin: 0 !important;
}
.sellerfast-typing .sellerfast-dot:nth-child(1) { animation-delay: -0.3s !important; }
.sellerfast-typing .sellerfast-dot:nth-child(2) { animation-delay: -0.15s !important; }
.sellerfast-typing .sellerfast-dot:nth-child(3) { animation-delay: 0s !important; }

@keyframes saasBotBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Input Area Pill Design */
#saas-chatbot-input-area { display: flex; padding: 16px; border-top: 1px solid #f3f4f6; background: #ffffff; gap: 10px; align-items: center; margin: 0 !important; }
#saas-chatbot-input { flex: 1; padding: 12px 20px; border: 2px solid #e5e7eb !important; border-radius: 9999px !important; outline: none !important; font-size: 14px; transition: border-color 0.2s; background: #f9fafb !important; color: #111827 !important; box-shadow: none !important; }
#saas-chatbot-input:focus { border-color: #3178ff !important; background: #ffffff !important; }
#saas-chatbot-send { background: #3178ff !important; color: white !important; border: none !important; width: 44px !important; height: 44px !important; border-radius: 50% !important; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(49, 120, 255, 0.3) !important; transition: transform 0.2s; padding: 0; flex-shrink: 0; }
#saas-chatbot-send:hover { transform: scale(1.05) !important; }
#saas-chatbot-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-left: -2px; }