/* ═══════════════════════════════════════════════
   BLACKMAMBA — Chatbot Widget
   ═══════════════════════════════════════════════ */

/* ── Toggle Button ────────────────────────── */
#chatbot-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1500;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-gold);
  color: var(--color-navy-dark);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 32px rgba(200, 164, 92, 0.3);
  transition: all 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}
#chatbot-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 40px rgba(200, 164, 92, 0.45);
}
#chatbot-toggle svg {
  width: 26px;
  height: 26px;
}

/* ── Panel ─────────────────────────────────── */
#chatbot-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1499;
  width: 100vw;
  max-height: 100vh;
  height: 100vh;
  background: var(--color-navy-dark);
  border: none;
  border-top: 1px solid rgba(200, 164, 92, 0.15);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.6);
}
#chatbot-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Panel Header ──────────────────────────── */
.chatbot-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}
.chatbot-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-navy-dark);
}
.chatbot-header-info h4 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
}
.chatbot-header-info .status {
  font-size: 0.75rem;
  color: var(--color-success);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.chatbot-header-info .status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  display: inline-block;
}

/* ── Messages Area ─────────────────────────── */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  scroll-behavior: smooth;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}
.chat-message {
  max-width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.55;
  animation: chatIn 0.3s ease;
}
@keyframes chatIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-message--bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(200, 164, 92, 0.12);
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
  color: var(--color-offwhite);
}
.chat-message--user {
  align-self: flex-end;
  background: var(--color-gold);
  color: var(--color-navy-dark);
  font-weight: 500;
  border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
}

/* ── Property Preview in Chat ──────────────── */
.chat-property-preview {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 0.5rem;
}

/* ── Image Slideshow (auto-rotating, perpetual) ── */
.chat-slideshow {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  border-radius: 8px;
  margin: 10px 0;
}
.chat-slideshow img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: slideFade var(--slide-duration, 15s) infinite;
  border: 1.5px solid rgba(200,164,92,0.2);
  box-sizing: border-box;
}

@keyframes slideFade {
  0%, 100% { opacity: 0; }
  1% { opacity: 0; }
  3% { opacity: 1; }
  15% { opacity: 1; }
  17% { opacity: 0; }
}

/* Dots indicator */
.chat-slideshow-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 4px;
}
.chat-slideshow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
}

/* ── Property data table ──────────────────── */
.chat-property-data {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
  margin: 8px 0;
  font-size: 0.82rem;
}
.chat-property-data dt {
  color: var(--color-gray-light);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.chat-property-data dd {
  color: var(--color-white);
  font-weight: 500;
  margin-bottom: 4px;
}

.chat-property-preview-body {
  padding: 0.75rem;
}
.chat-property-preview-body h5 {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.chat-property-preview-body .price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-gold);
}
.chat-property-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.chat-property-actions button {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
}
.chat-btn-detail {
  background: var(--color-gold);
  color: var(--color-navy-dark);
}
.chat-btn-whatsapp {
  background: #25D366;
  color: white;
}

/* ── Chat Typing Indicator ─────────────────── */
.chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
}
.chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-gray-light);
  animation: typingDot 1.4s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ── Input Area ────────────────────────────── */
.chatbot-input-area {
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}
.chatbot-input-area input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  padding: 0.7rem 1.1rem;
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.3s ease;
}
.chatbot-input-area input:focus {
  border-color: var(--color-gold);
}
.chatbot-input-area input::placeholder {
  color: var(--color-gray-mid);
}
.chatbot-send {
  background: var(--color-gold);
  color: var(--color-navy-dark);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.chatbot-send:hover {
  background: var(--color-gold-light);
  transform: scale(1.05);
}
.chatbot-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ── Mobile ────────────────────────────────── */
@media (max-width: 480px) {
  #chatbot-toggle {
    right: 16px;
    bottom: 20px;
    width: 52px;
    height: 52px;
  }
  .chatbot-messages { padding: var(--space-md); }
  .chatbot-header { padding: var(--space-md); }
  .chatbot-input-area { padding: var(--space-md); }
}
