/* ============================================================
   extendedIDEA Chatbot — Durgai Amman Real Estate
   Change the colours in :root to match the client's brand.
   ============================================================ */

:root {
  --ei-primary: #0156f1;        /* main brand colour (header, buttons) */
  --ei-primary-dark: #0143c0;   /* darker shade for hover */
  --ei-accent: #44ee1f;         /* accent (progress bar, highlights) */
  --ei-bg: #ffffff;
  --ei-bot-bg: #f1f3f5;
  --ei-bot-text: #222222;
  --ei-user-bg: var(--ei-primary);
  --ei-user-text: #ffffff;
  --ei-border: #e3e6ea;
  --ei-radius: 16px;
  --ei-font: inherit;           /* or e.g. "Poppins", sans-serif */
  --ei-z: 99999;
}

/* ---------- Toggle button ---------- */
#ei-chat-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--ei-z);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--ei-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: var(--ei-font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: background 0.2s, transform 0.2s;
}
#ei-chat-toggle:hover { background: var(--ei-primary-dark); transform: translateY(-2px); }

/* ---------- Widget ---------- */
#ei-chatbot-widget {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: var(--ei-z);
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 540px;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  background: var(--ei-bg);
  border-radius: var(--ei-radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  font-family: var(--ei-font);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}
#ei-chatbot-widget.ei-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ---------- Header ---------- */
#ei-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--ei-primary);
  color: #fff;
}
#ei-header-left { display: flex; align-items: center; gap: 10px; }
.ei-logo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #fff; }
.ei-logo-placeholder {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
}
#ei-header-text { display: flex; flex-direction: column; line-height: 1.25; }
#ei-header-title { font-size: 15px; font-weight: 700; }
#ei-header-subtitle { font-size: 12px; opacity: 0.85; }
#ei-header-status { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.ei-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; display: inline-block; }

/* ---------- Progress ---------- */
#ei-progress-bar {
  position: relative;
  height: 5px;
  background: var(--ei-border);
}
#ei-progress-fill {
  height: 100%;
  width: 0;
  background: var(--ei-accent);
  transition: width 0.35s ease;
}
#ei-progress-label {
  position: absolute;
  right: 10px;
  top: 8px;
  font-size: 11px;
  color: #777;
}

/* ---------- Messages ---------- */
#ei-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.ei-bot, .ei-user {
  max-width: 82%;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.45;
  border-radius: 14px;
  word-wrap: break-word;
  animation: ei-pop 0.2s ease;
}
.ei-bot {
  align-self: flex-start;
  background: var(--ei-bot-bg);
  color: var(--ei-bot-text);
  border-bottom-left-radius: 4px;
}
.ei-user {
  align-self: flex-end;
  background: var(--ei-user-bg);
  color: var(--ei-user-text);
  border-bottom-right-radius: 4px;
}
@keyframes ei-pop {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Typing indicator */
.ei-typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.ei-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #9aa0a6;
  animation: ei-bounce 1.2s infinite ease-in-out;
}
.ei-typing span:nth-child(2) { animation-delay: 0.15s; }
.ei-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ei-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ---------- Options ---------- */
#ei-options-wrap {
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 14px 14px;
  max-height: 200px;
  overflow-y: auto;
}
.ei-option-btn {
  padding: 9px 14px;
  background: #fff;
  color: var(--ei-primary);
  border: 1.5px solid var(--ei-primary);
  border-radius: 999px;
  font-family: var(--ei-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.15s, color 0.15s;
}
.ei-option-btn:hover { background: var(--ei-primary); color: #fff; }

/* ---------- Input area ---------- */
#ei-input-area {
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--ei-border);
  background: #fff;
  flex-wrap: wrap;
}
#ei-chat-input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1.5px solid var(--ei-border);
  border-radius: 999px;
  font-family: var(--ei-font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
#ei-chat-input:focus { border-color: var(--ei-primary); }
#ei-send-btn {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ei-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s;
}
#ei-send-btn:hover { background: var(--ei-primary-dark); }
#ei-skip-btn {
  display: none;
  width: 100%;
  background: none;
  border: none;
  color: #777;
  font-size: 13px;
  text-align: right;
  cursor: pointer;
  padding: 0 4px;
}
#ei-skip-btn:hover { color: var(--ei-primary); text-decoration: underline; }

/* ---------- Footer ---------- */
#ei-chat-footer {
  padding: 7px;
  text-align: center;
  font-size: 11px;
  color: #999;
  background: #fafafa;
  border-top: 1px solid var(--ei-border);
}
#ei-chat-footer a { color: var(--ei-primary); text-decoration: none; font-weight: 600; }

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
  #ei-chatbot-widget {
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  #ei-chat-toggle { right: 14px; bottom: 14px; }
  #ei-chat-toggle #ei-toggle-label { display: none; }
  #ei-chat-toggle { padding: 14px; }
}
