/* ==========================================================================
   REUSABLE STATIC CHATBOT WIDGET - STYLES
   Uses the same CSS variables (--primary, --gold, --cream, etc.) declared
   in style.css so it automatically matches each project's theme.
   ========================================================================== */

.chatbot-widget {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 1050;
  font-family: var(--font-body, "Poppins", sans-serif);
}

/* ==================== TOGGLE BUTTON ==================== */
.chatbot-toggle {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--primary, #801e2a);
  color: #fff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, background 0.25s ease;
}

.chatbot-toggle:hover {
  transform: translateY(-3px);
  background: var(--primary-dark, #651722);
}

.chatbot-icon-close {
  display: none;
}

.chatbot-toggle.active .chatbot-icon-open {
  display: none;
}

.chatbot-toggle.active .chatbot-icon-close {
  display: block;
}

/* ==================== CHAT WINDOW ==================== */
.chatbot-window {
  position: absolute;
  bottom: 74px;
  left: 0;
  width: 340px;
  max-width: calc(100vw - 40px);
  height: 460px;
  max-height: 70vh;
  background: #fff;
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom left;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.chatbot-widget.open .chatbot-window {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ==================== HEADER ==================== */
.chatbot-header {
  background: linear-gradient(135deg, var(--primary, #801e2a), var(--primary-dark, #651722));
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chatbot-header h4 {
  font-family: var(--font-body, "Poppins", sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.chatbot-status {
  font-size: 0.7rem;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot-status i {
  font-size: 0.5rem;
  color: #4ade80;
}

.chatbot-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chatbot-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.85;
  padding: 4px;
}

.chatbot-close:hover {
  opacity: 1;
}

/* ==================== BODY / MESSAGES ==================== */
.chatbot-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  background: var(--cream, #fcf8f8);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chatbot-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.chatbot-msg-user {
  justify-content: flex-end;
}

.chatbot-avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary, #801e2a);
  color: #fff;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chatbot-bubble {
  background: #fff;
  color: var(--text, #3d3033);
  padding: 10px 14px;
  border-radius: 14px 14px 14px 2px;
  font-size: 0.85rem;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  max-width: 220px;
  word-wrap: break-word;
}

.chatbot-bubble a {
  color: var(--primary, #801e2a);
  font-weight: 600;
}

.chatbot-msg-user .chatbot-bubble {
  background: var(--primary, #801e2a);
  color: #fff;
  border-radius: 14px 14px 2px 14px;
}

.chatbot-contact-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 2px;
}

.chatbot-contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ==================== TYPING INDICATOR ==================== */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}

.chatbot-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-light, #7b6b6f);
  display: inline-block;
  animation: chatbotTyping 1s infinite ease-in-out;
}

.chatbot-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.chatbot-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chatbotTyping {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* ==================== QUICK REPLY OPTIONS ==================== */
.chatbot-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  padding-left: 34px;
}

.chatbot-option-btn {
  background: #fff;
  border: 1.5px solid var(--gold, #c8a24d);
  color: var(--primary-dark, #651722);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition, all 0.3s ease);
  text-align: left;
}

.chatbot-option-btn:hover {
  background: var(--gold, #c8a24d);
  color: #fff;
  transform: translateX(2px);
}

.chatbot-option-btn i {
  width: 16px;
  text-align: center;
}

/* ==================== LEAD FORM ==================== */
.chatbot-form-row {
  align-items: flex-start;
}

.chatbot-lead-form {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 240px;
}

.chatbot-input {
  border: 1px solid #e2d9da;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.chatbot-input:focus {
  border-color: var(--gold, #c8a24d);
}

.chatbot-form-error {
  color: #c0392b;
  font-size: 0.72rem;
  min-height: 0;
}

.chatbot-send-btn {
  background: var(--primary, #801e2a);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.chatbot-send-btn:hover {
  background: var(--primary-dark, #651722);
}

.chatbot-btn-loader {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: chatbotSpin 0.6s linear infinite;
}

.chatbot-lead-form.submitting .chatbot-btn-text {
  display: none;
}

.chatbot-lead-form.submitting .chatbot-btn-loader {
  display: block;
}

@keyframes chatbotSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ==================== SCROLLBAR ==================== */
.chatbot-body::-webkit-scrollbar {
  width: 5px;
}

.chatbot-body::-webkit-scrollbar-thumb {
  background: rgba(128, 30, 42, 0.25);
  border-radius: 10px;
}

/* ==================== MOBILE ==================== */
@media (max-width: 576px) {
  .chatbot-widget {
    left: 12px;
    bottom: 86px;
  }

  .chatbot-window {
    width: calc(100vw - 24px);
    height: 65vh;
    bottom: 70px;
  }
}
