/* =========================================================
   chat.css — Single source of truth for chat UI styles
   Used by: style.css (@import), embed.html (<link>)
   DO NOT duplicate these styles anywhere else.
   ========================================================= */

/* =========================================================
   CHAT LAUNCHER — bottom right bubble
   ========================================================= */
#chat-launcher-wrapper {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 300;
}
#chat-launcher-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--text-main);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.06);
  transition: all 0.3s;
}
#chat-launcher-btn:hover {
  background: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(13,148,136,0.35);
}
#chat-launcher-btn i { font-size: 16px; color: var(--primary); }
#chat-launcher-btn:hover i { color: #fff; }


/* =========================================================
   CHAT WINDOW — bottom right messenger style
   ========================================================= */
#chat-window-container {
  position: fixed;
  top: calc(var(--header-h) + 12px);
  bottom: 12px;
  right: 28px;
  width: min(480px, calc(100vw - 56px));
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  border: 2px solid rgba(255,255,255,0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 600;
}
.chat-toolbar {
  background: var(--text-main);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.bot-identity { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px;
  background: rgba(13,148,136,0.15);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 1px solid rgba(13,148,136,0.3);
  flex-shrink: 0;
}
.bot-name h3 { font-size: 13px; font-weight: 700; color: #fff; margin: 0; }
.status {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
}
.status-dot {
  width: 6px; height: 6px;
  background: #22c55e;
  border-radius: 50%;
}
.chat-controls { display: flex; gap: 10px; align-items: center; }
#chat-close-btn, #chat-clear-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
  line-height: 1;
}
#chat-close-btn:hover { color: #ef4444; }
#chat-clear-btn:hover { color: #fff; }

.demo-banner {
  background: #fffbeb;
  color: #92400e;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid #fde68a;
  flex-shrink: 0;
}
.demo-banner.hidden { display: none; }

#chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}
#chat-messages::-webkit-scrollbar { width: 4px; }
#chat-messages::-webkit-scrollbar-track { background: transparent; }
#chat-messages::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

.msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
}
.bot {
  align-self: flex-start;
  background: #fff;
  color: var(--text-main);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.user {
  align-self: flex-end;
  background: var(--text-main);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-lang-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 2px;
  background: #fff;
}
.lang-btn {
  padding: 3px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.lang-btn:hover { border-color: var(--primary); color: var(--primary); }
.lang-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.lang-bar-powered {
  margin-left: auto;
  font-size: 11px;
  color: #94a3b8;
}

.chat-input-area {
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
#user-input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 13.5px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  color: var(--text-main);
  background: #f8fafc;
  transition: border-color 0.2s;
}
#user-input:focus { border-color: var(--primary); background: #fff; }
#mic-btn {
  width: 34px; height: 34px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
#mic-btn:hover { background: #e2e8f0; color: var(--text-main); }
#mic-btn.listening { color: #ef4444; animation: pulse 1.5s infinite; background: #fef2f2; }
#send-btn {
  width: 34px; height: 34px;
  background: var(--text-main);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
#send-btn:hover { background: var(--primary); transform: scale(1.05); }


/* =========================================================
   PROPERTY CARDS
   ========================================================= */
.property-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
  justify-content: center;
}
.prop-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.group-separator {
  width: 100%;
  display: flex;
  align-items: center;
  margin: 12px 0 8px 0;
  gap: 10px;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.group-separator::before,
.group-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
@media (min-width: 400px) {
  .prop-card { width: calc(50% - 8px); }
}
.prop-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.prop-card img { width: 100%; height: 160px; object-fit: cover; }
.prop-badges { display: flex; gap: 5px; padding: 8px 12px 0; flex-wrap: wrap; }
.listing-badge, .legal-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.listing-badge.listing-sale  { background: #dcfce7; color: #15803d; }
.listing-badge.listing-rent  { background: #fef3c7; color: #b45309; }
.listing-badge.listing-lease { background: #ede9fe; color: #6d28d9; }
.legal-badge { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.distance-badge { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; }
.distance-badge i { font-size: 9px; }
.prop-info { padding: 12px; display: flex; flex-direction: column; gap: 5px; }
.prop-title { font-weight: 700; font-size: 14px; color: var(--text-main); line-height: 1.3; }
.prop-meta { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.prop-meta i { color: #cbd5e1; width: 14px; text-align: center; }
.prop-price { color: #059669; font-weight: 700; font-size: 15px; margin-top: 3px; }
.detail-btn {
  margin: 8px 12px 12px;
  padding: 8px;
  background: var(--text-main);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s;
}
.detail-btn:hover { background: var(--primary); }
.map-link {
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  transition: color 0.2s;
}
.map-link:hover { color: var(--primary); }
.map-link i.fa-map-marker-alt { color: #ef4444; }
.load-more-btn {
  background: var(--bg-off);
  color: var(--primary-dark);
  border: 1px solid var(--primary-light);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  display: block;
  margin: 12px auto 0;
  transition: all 0.2s;
}
.load-more-btn:hover { background: var(--primary-light); transform: translateY(-1px); }


/* =========================================================
   PROPERTY DETAILS MODAL
   ========================================================= */
#property-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.modal-content {
  background: #fff;
  width: 90%;
  max-width: 560px;
  border-radius: 16px;
  padding: 24px;
  position: relative;
  max-height: 88vh;
  overflow-y: auto;
  color: var(--text-main);
  box-shadow: var(--shadow-xl);
}
#modal-close-btn {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  z-index: 1;
}
#modal-close-btn:hover { background: #e2e8f0; color: #1e293b; }
.modal-img { width: 100%; height: 200px; object-fit: cover; border-radius: var(--radius-md); margin-bottom: 16px; }
.modal-title { font-family: 'Lora', serif; font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.modal-price { color: #059669; font-weight: 700; font-size: 18px; margin-bottom: 16px; }
.modal-section { margin-bottom: 16px; }
.modal-section h4 { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.modal-text { font-size: 14px; line-height: 1.7; color: #334155; }
.modal-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.overview-item { background: var(--bg-off); padding: 8px; border-radius: 6px; font-size: 13px; }
.tag-empty, .spec-empty { opacity: 0.5; font-style: italic; }
.tag-container { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--bg-off); color: var(--text-muted); padding: 4px 10px; border-radius: 4px; font-size: 12px; border: 1px solid var(--border); }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.spec-item { background: var(--bg-off); padding: 8px; border-radius: 6px; font-size: 13px; }
.spec-label { color: var(--text-muted); font-size: 10px; display: block; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }


/* =========================================================
   UTILS — shared by chat
   ========================================================= */
.hidden { display: none !important; }

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}


/* =========================================================
   RESPONSIVE — chat-specific rules only
   ========================================================= */
@media (max-width: 768px) {
  #chat-window-container {
    top: calc(var(--header-h) + 5vh);
    bottom: 5vh;
    right: 5vw;
    left: 5vw;
    width: 90vw;
    border-radius: 16px;
  }
  #chat-launcher-wrapper { bottom: 20px; right: 20px; }
  #chat-launcher-btn span { display: none; }
  #chat-launcher-btn { padding: 16px; border-radius: 50%; }
}

/* embed.html full-screen mode — when loaded inside widget iframe */
body.embed-mode {
  margin: 0;
  padding: 0;
  overflow: hidden;
}
body.embed-mode #chat-window-container {
  position: static;
  width: 100%;
  height: 100vh;
  border-radius: 0;
  box-shadow: none;
  border: none;
}
