/* LeapSquare AI Chatbot – above WhatsApp icon */

.ls-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
}

/* Chat panel – above the action buttons */
.ls-chat-panel {
  position: absolute;
  bottom: 100%;
  right: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 420px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.ls-chat-panel-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ls-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--color-primary, #0f2440);
  color: #fff;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.ls-chat-title {
  font-size: 15px;
  font-weight: 600;
}

.ls-chat-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
}

.ls-chat-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.ls-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  min-height: 180px;
  max-height: 280px;
}

.ls-chat-msg {
  margin-bottom: 10px;
  display: flex;
  justify-content: flex-start;
}

.ls-chat-msg-user {
  justify-content: flex-end;
}

.ls-chat-msg-inner {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.ls-chat-msg-bot .ls-chat-msg-inner {
  background: var(--color-bg-alt, #f1f5f9);
  color: var(--color-primary, #0f172a);
  border-bottom-left-radius: 4px;
}

.ls-chat-msg-user .ls-chat-msg-inner {
  background: var(--color-primary, #0f2440);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ls-chat-msg-inner strong {
  font-weight: 600;
}

.ls-chat-footer {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--color-border, #e2e8f0);
  background: #fff;
  border-radius: 0 0 12px 12px;
  flex-shrink: 0;
}

.ls-chat-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.ls-chat-input:focus {
  outline: none;
  border-color: var(--color-accent, #0d9488);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15);
}

.ls-chat-send {
  padding: 10px 16px;
  background: var(--color-accent, #0d9488);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.ls-chat-send:hover {
  background: #0f766e;
}

/* Action buttons: chat trigger + WhatsApp (stacked, chat on top) */
.ls-chat-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ls-chat-trigger {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary, #0f2440);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 35, 64, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.ls-chat-trigger:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(15, 35, 64, 0.4);
}

.ls-chat-trigger i {
  pointer-events: none;
}

/* WhatsApp button – same style as before, below chat */
.ls-whatsapp-float {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.ls-whatsapp-float:hover {
  transform: scale(1.08);
  color: #fff;
}

.ls-whatsapp-float img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

@media (max-width: 480px) {
  .ls-chat-widget {
    bottom: 16px;
    right: 16px;
  }
  .ls-chat-panel {
    width: calc(100vw - 32px);
    right: 0;
  }
}
