/* Remote Solicitor AI Chatbot */
#rs-ai-chatbot {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Toggle Button */
#rs-chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #1a365d;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, background 0.2s;
  position: absolute;
  bottom: 0;
  right: 0;
}
#rs-chat-toggle:hover {
  transform: scale(1.08);
  background: #2a4a7f;
}
#rs-chat-toggle svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

/* Chat Window */
#rs-chat-window {
  display: none;
  width: 380px;
  height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  position: absolute;
  bottom: 76px;
  right: 0;
  flex-direction: column;
  overflow: hidden;
}
.rs-chat-open #rs-chat-window {
  display: flex;
}
.rs-chat-open #rs-toggle-open { display: none; }
.rs-chat-open #rs-toggle-close { display: block !important; }

/* Header */
#rs-chat-header {
  background: #1a365d;
  color: #fff;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.rs-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rs-chat-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rs-chat-avatar svg {
  width: 20px;
  height: 20px;
  color: #fff;
}
.rs-chat-title {
  font-weight: 600;
  font-size: 15px;
}
.rs-chat-subtitle {
  font-size: 12px;
  opacity: 0.8;
}
#rs-chat-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
#rs-chat-close svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

/* Messages Area */
#rs-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rs-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.rs-msg-bot {
  background: #f0f4f8;
  color: #1a202c;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.rs-msg-user {
  background: #1a365d;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.rs-msg-typing {
  background: #f0f4f8;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  padding: 12px 20px;
}
.rs-dots {
  display: flex;
  gap: 4px;
}
.rs-dots span {
  width: 8px;
  height: 8px;
  background: #a0aec0;
  border-radius: 50%;
  animation: rs-bounce 1.4s infinite ease-in-out;
}
.rs-dots span:nth-child(1) { animation-delay: 0s; }
.rs-dots span:nth-child(2) { animation-delay: 0.2s; }
.rs-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes rs-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
#rs-chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  background: #fff;
}
#rs-chat-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  outline: none;
  line-height: 1.4;
}
#rs-chat-input:focus {
  border-color: #1a365d;
}
#rs-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1a365d;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
#rs-chat-send:hover {
  background: #2a4a7f;
}
#rs-chat-send:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
}
#rs-chat-send svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

/* Mobile responsive */
@media (max-width: 480px) {
  #rs-chat-window {
    width: calc(100vw - 24px);
    height: calc(100vh - 100px);
    bottom: 76px;
    right: -8px;
    border-radius: 12px;
  }
}

/* Error message */
.rs-msg-error {
  background: #fed7d7;
  color: #c53030;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  font-size: 13px;
}
