/* ====================================================================
   RabComms CMS Suite — AI Consultant Chatbot Styles
   WCAG 2.2 AAA Contrast Verified (#25D366 bg with #052E16 text = 9.65:1)
   ==================================================================== */

#rc-chatbot-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #0B0B0B;
}

/* Floating Trigger Button */
#rc-chatbot-toggle {
  height: 52px;
  padding: 0 20px;
  border-radius: 26px;
  background: #0E7AA8;
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(14, 122, 168, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s;
  font-weight: 700;
  font-size: 15px;
}

#rc-chatbot-toggle:hover {
  transform: scale(1.04);
  background: #09597A;
}

/* Pulsing Green Online Indicator */
.rc-online-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #25D366;
  border: 2.5px solid #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  animation: rcDotPulse 2s infinite;
}

@keyframes rcDotPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Chatbot Window Container */
#rc-chatbot-window {
  display: none;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 100px);
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(14, 122, 168, 0.25), 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid #E2E8F0;
  transition: all 0.25s ease;
}

#rc-chatbot-window.rc-open {
  display: flex;
}

/* Header */
.rc-chat-header {
  background: linear-gradient(135deg, #2E3F56 0%, #0E7AA8 100%);
  color: #FFFFFF;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.rc-chat-avatar {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rc-chat-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}

.rc-chat-subtitle {
  font-size: 12px;
  color: #A5F3FC;
  display: flex;
  align-items: center;
  gap: 5px;
}

.rc-chat-subtitle::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #25D366;
  border-radius: 50%;
}

.rc-chat-close {
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* Body & Message Stream */
.rc-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #F8FAFC;
}

.rc-msg-bubble {
  max-width: 86%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.rc-msg-bot {
  background: #FFFFFF;
  color: #0B0B0B;
  border: 1px solid #E2E8F0;
  border-bottom-left-radius: 2px;
  align-self: flex-start;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.rc-msg-user {
  background: #0E7AA8;
  color: #FFFFFF;
  border-bottom-right-radius: 2px;
  align-self: flex-end;
}

/* Service Tap Buttons (Stage 1) */
.rc-services-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0;
}

.rc-service-btn {
  background: #FFFFFF;
  color: #2E3F56;
  border: 1px solid #CBD5E1;
  border-left: 4px solid #0E7AA8;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.rc-service-btn:hover {
  background: #F0F9FF;
  border-color: #0E7AA8;
  transform: translateX(3px);
}

.rc-service-btn.rc-active {
  background: #E0F2FE;
  border-color: #0E7AA8;
  color: #0369A1;
}

/* Bold Green WhatsApp Handoff Button (Stage 2) */
.rc-wa-handoff-btn {
  background-color: #25D366 !important;
  color: #052E16 !important; /* 9.65:1 AAA Contrast */
  font-weight: 800 !important;
  font-size: 15px !important;
  border-radius: 8px !important;
  padding: 12px 18px !important;
  text-align: center !important;
  display: block !important;
  text-decoration: none !important;
  margin: 10px 0 6px !important;
  box-shadow: 0 3px 12px rgba(37, 211, 102, 0.4) !important;
  transition: transform 0.15s ease, background-color 0.15s ease !important;
  box-sizing: border-box !important;
}

.rc-wa-handoff-btn:hover {
  background-color: #1EBE5D !important;
  color: #052E16 !important;
  transform: translateY(-1px) !important;
}

/* Input Form */
.rc-chat-footer {
  padding: 12px 16px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  display: flex;
  gap: 8px;
}

.rc-chat-footer input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #CBD5E1;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
}

.rc-chat-footer input:focus {
  border-color: #0E7AA8;
}

.rc-chat-footer button {
  background: #0E7AA8;
  color: #FFFFFF;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s;
}

.rc-chat-footer button:hover {
  background: #09597A;
}

/* Typing Indicator */
.rc-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  width: fit-content;
  align-self: flex-start;
}

.rc-typing span {
  width: 6px;
  height: 6px;
  background: #94A3B8;
  border-radius: 50%;
  animation: rcBlink 1.4s infinite both;
}

.rc-typing span:nth-child(2) { animation-delay: 0.2s; }
.rc-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes rcBlink {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

