/* ═══════════════════════════════════════════
   HIGH SEA MIAMI — WhatsApp Chatbot Widget
═══════════════════════════════════════════ */

/* ── Trigger Button ── */
.hsm-chat-trigger {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  width: 62px;
  height: 62px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37,211,102,.45);
  transition: transform .3s, box-shadow .3s;
  border: none;
}
.hsm-chat-trigger:hover { transform: scale(1.1); box-shadow: 0 8px 28px rgba(37,211,102,.55); }
.hsm-chat-trigger svg { width: 34px; height: 34px; fill: white; }

/* Unread badge */
.hsm-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #E24B4A;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  border: 2px solid #0A1628;
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.2)} }

/* ── Chat Window ── */
.hsm-chat-window {
  position: fixed;
  bottom: 108px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 580px;
  max-height: calc(100vh - 130px);
  background: #0f1923;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  transform: scale(0.85) translateY(30px);
  opacity: 0;
  pointer-events: none;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  transform-origin: bottom right;
}
.hsm-chat-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ── */
.hsm-header {
  background: linear-gradient(135deg, #1E3A5F, #0d2540);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.hsm-header-avatar {
  width: 42px;
  height: 42px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}
.hsm-header-info { flex: 1; min-width: 0; }
.hsm-header-name {
  font-family: 'Inter', sans-serif;
  font-size: .92rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hsm-header-status {
  font-size: .72rem;
  color: #25D366;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}
.hsm-online-dot {
  width: 7px;
  height: 7px;
  background: #25D366;
  border-radius: 50%;
  animation: onlinePulse 2s ease-in-out infinite;
}
@keyframes onlinePulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.hsm-header-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color .2s, background .2s;
  line-height: 1;
}
.hsm-header-close:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ── Chat Body ── */
.hsm-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #0f1923;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(30,58,95,.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(201,168,76,.04) 0%, transparent 50%);
  scroll-behavior: smooth;
}
.hsm-body::-webkit-scrollbar { width: 4px; }
.hsm-body::-webkit-scrollbar-track { background: transparent; }
.hsm-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

/* Date chip */
.hsm-date-chip {
  text-align: center;
  font-size: .68rem;
  color: rgba(255,255,255,.3);
  padding: 4px 10px;
  background: rgba(255,255,255,.05);
  border-radius: 10px;
  align-self: center;
  font-family: 'Inter', sans-serif;
  letter-spacing: .05em;
  margin: 4px 0;
}

/* ── Messages ── */
.hsm-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: msgIn .25s ease;
}
@keyframes msgIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
.hsm-msg.bot { align-self: flex-start; }
.hsm-msg.user { align-self: flex-end; }

.hsm-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: .875rem;
  line-height: 1.55;
  position: relative;
  word-break: break-word;
}
.hsm-msg.bot .hsm-bubble {
  background: #1E3A5F;
  color: #F8F6F2;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255,255,255,.06);
}
.hsm-msg.user .hsm-bubble {
  background: rgba(201,168,76,.18);
  color: #F8F6F2;
  border: 1px solid rgba(201,168,76,.3);
  border-bottom-right-radius: 4px;
}
.hsm-bubble strong { color: #C9A84C; }
.hsm-bubble em { color: rgba(248,246,242,.6); font-style: normal; font-size: .8rem; }

/* Message time */
.hsm-msg-time {
  font-size: .65rem;
  color: rgba(255,255,255,.3);
  align-self: flex-end;
  margin-top: 2px;
  padding: 0 2px;
  font-family: 'Inter', sans-serif;
}
.hsm-msg.bot .hsm-msg-time { align-self: flex-start; }

/* ── Typing Indicator ── */
.hsm-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #1E3A5F;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: 56px;
  animation: msgIn .2s ease;
}
.hsm-typing span {
  width: 7px; height: 7px;
  background: rgba(201,168,76,.7);
  border-radius: 50%;
  animation: typingDot 1.2s ease-in-out infinite;
}
.hsm-typing span:nth-child(2) { animation-delay: .2s; }
.hsm-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typingDot { 0%,80%,100%{transform:scale(1);opacity:.5} 40%{transform:scale(1.3);opacity:1} }

/* ── Quick Replies ── */
.hsm-qr-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 2px 4px;
  align-self: flex-start;
  max-width: 100%;
  animation: msgIn .3s ease;
}
.hsm-qr {
  background: none;
  border: 1px solid rgba(201,168,76,.4);
  color: #C9A84C;
  padding: 7px 14px;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: .8rem;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
  white-space: nowrap;
}
.hsm-qr:hover, .hsm-qr:active {
  background: #C9A84C;
  color: #0A1628;
  border-color: #C9A84C;
}
.hsm-qr:disabled { opacity: .4; cursor: default; }

/* ── Property Cards ── */
.hsm-prop-card {
  background: rgba(30,58,95,.5);
  border: 1px solid rgba(201,168,76,.2);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .25s, transform .25s;
  animation: msgIn .3s ease;
  font-family: 'Inter', sans-serif;
  margin-top: 4px;
  max-width: 300px;
  align-self: flex-start;
}
.hsm-prop-card:hover { border-color: #C9A84C; transform: translateY(-2px); }
.hsm-prop-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  background: #1E3A5F;
}
.hsm-prop-body { padding: 10px 12px 12px; }
.hsm-prop-badge {
  display: inline-block;
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
  color: #0A1628;
  background: #C9A84C;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
}
.hsm-prop-name {
  font-size: .88rem;
  font-weight: 600;
  color: #F8F6F2;
  margin-bottom: 4px;
  line-height: 1.3;
}
.hsm-prop-meta {
  font-size: .76rem;
  color: rgba(248,246,242,.55);
  margin-bottom: 6px;
  line-height: 1.4;
}
.hsm-prop-price {
  font-size: .82rem;
  color: #C9A84C;
  font-weight: 600;
}
.hsm-prop-cta {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 7px;
  background: rgba(201,168,76,.15);
  border: 1px solid rgba(201,168,76,.3);
  border-radius: 6px;
  color: #C9A84C;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-align: center;
  transition: background .2s;
}
.hsm-prop-cta:hover { background: rgba(201,168,76,.28); }

/* ── Input Area ── */
.hsm-footer {
  padding: 10px 12px;
  background: #141f2d;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.hsm-input {
  flex: 1;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 24px;
  padding: 10px 16px;
  color: #F8F6F2;
  font-family: 'Inter', sans-serif;
  font-size: .875rem;
  outline: none;
  transition: border-color .2s;
  min-width: 0;
}
.hsm-input:focus { border-color: rgba(201,168,76,.5); }
.hsm-input::placeholder { color: rgba(255,255,255,.3); }
.hsm-send {
  width: 40px;
  height: 40px;
  background: #25D366;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform .2s;
}
.hsm-send:hover { background: #20bb5a; transform: scale(1.05); }
.hsm-send svg { width: 18px; height: 18px; fill: white; }

/* WhatsApp send button */
.hsm-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: #25D366;
  border: none;
  border-radius: 10px;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: background .25s, transform .25s;
  letter-spacing: .05em;
}
.hsm-wa-btn:hover { background: #20bb5a; transform: translateY(-2px); }
.hsm-wa-btn svg { width: 22px; height: 22px; fill: white; flex-shrink: 0; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .hsm-chat-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .hsm-chat-trigger {
    bottom: 18px;
    right: 18px;
    width: 56px;
    height: 56px;
  }
}
