/* Chat icon */
#rem-ai-chat-launcher {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  color: #fff;
  font-size: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 9999;
}

#rem-ai-chat-launcher i {
  font-size: 26px;
  color: #fff;
  border-radius: 50%;
  padding: 14px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: transform 0.2s;
  animation: chatIconTilt 10s ease-in-out infinite;
}

/* Keyframes for tilt animation */
@keyframes chatIconTilt {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(20deg); }
  50%  { transform: rotate(0deg); }
  75%  { transform: rotate(-20deg); }
  100% { transform: rotate(0deg); }
}

/* Chat window */
#rem-ai-chatbox {
  position: fixed;
  bottom: 0;
  right: -400px; /* initially hidden off-screen */
  width: 350px;
  height: 480px;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: -2px 0 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  transition: all 0.5s ease-in-out;
  z-index: 10000;
}

/* Hidden state */
#rem-ai-chatbox.rem-chat-hidden {
  display: none;
}

/* Visible state */
#rem-ai-chatbox.rem-chat-visible {
  right: 0;
  display: flex;
}

/* --- Header --- */
.rem-chat-header {
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
}

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

/* Avatar with status dot */
.rem-chat-avatar {
  position: relative;
  width: 35px;
  height: 35px;
  background: #fff;
  color: #0073aa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.rem-chat-avatar .rem-chat-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #00bc7d;
  border-radius: 50%;
  border: 2px solid #fff;
}

/* Bot name and online text */
.rem-chat-info {
  line-height: 1.2;
}

.rem-chat-name {
  font-weight: bold;
  font-size: 14px;
}

.rem-chat-status-text {
  font-size: 12px;
  color: #d4f6d7;
}

.rem-chat-status-typing {
  font-size: 12px;
  color: #d4f6d7;
  animation: remblink 1s linear infinite;
}

/* Close button */
#rem-chat-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

/* Messages area */
#rem-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background: #f9f9f9;
}
.user-msg, .ai-msg {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  max-width: 85%;
  line-height: 1.4;
  word-wrap: break-word;
}
.user-msg {
  background: #e6f2ff;
  align-self: flex-end;
  text-align: right;
  margin-left: auto;
}
.ai-msg {
  background: #fff;
  border: 1px solid #eee;
  align-self: flex-start;
  text-align: left;
}
.ai-msg strong {
  margin-bottom: 10px;
  display: inline-block;
}
.default-msg {
  background: #fffbe6;
  border: 1px solid #fff2b3;
  color: #555;
}

/* Input area */
.rem-chat-input {
  display: flex;
  border-top: 1px solid #ddd;
}
#rem-chat-text {
  flex: 1;
  border: none;
  padding: 10px;
  resize: none;
  height: 50px;
  outline: none;
  font-family: inherit;
}
#rem-chat-send {
  background: #0073aa;
  color: #fff;
  border: none;
  padding: 0 20px;
  cursor: pointer;
  transition: background 0.3s;
}
#rem-chat-send:hover {
  background: #005c87;
}

/* Scrollbar */
#rem-chat-messages::-webkit-scrollbar {
  width: 6px;
}
#rem-chat-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.msg-time {
  font-size: 10px;
  color: #999;
  text-align: right;
  margin-top: 2px;
}
.ai-msg .msg-time {
  text-align: left;
}
.ai-property-result a {
    display: flex;
    padding: 6px;
    margin-bottom: 8px;
    font-size: 14px;
}
.ai-property-result img {
  width: 70px !important;
  margin-right: 5px;
}

.rem-ai-chat-dp {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.rem-chat-avatar .rem-ai-chat-dp {
  width: 40px;
  height: 40px;
}

@keyframes remblink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}