/* ============================================
   FACETS 58 — Floating Chat Widget
   On-brand: Teal + Cream + Cormorant/Poppins
   ============================================ */

/* --- Chat Bubble (collapsed state) --- */
.chatbot-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #7ECECE;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(126, 206, 206, 0.4);
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  border: none;
  outline: none;
}

.chatbot-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(126, 206, 206, 0.5);
}

.chatbot-bubble svg {
  width: 28px;
  height: 28px;
  transition: transform 0.3s ease;
}

.chatbot-bubble.open svg {
  transform: rotate(90deg);
}

/* Unread indicator */
.chatbot-bubble__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #C9A97A;
  border: 2px solid #FAF7F2;
  display: none;
}

.chatbot-bubble__badge.show {
  display: block;
  animation: pulse 2s infinite;
}

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


/* --- Greeting Tooltip --- */
.chatbot-greeting {
  position: fixed;
  bottom: 92px;
  right: 24px;
  background: #FFFFFF;
  color: #2D2622;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(45, 38, 34, 0.12);
  z-index: 9997;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  max-width: 220px;
  line-height: 1.4;
  cursor: pointer;
}

.chatbot-greeting::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 24px;
  width: 12px;
  height: 12px;
  background: #FFFFFF;
  transform: rotate(45deg);
  box-shadow: 2px 2px 4px rgba(45, 38, 34, 0.06);
}

.chatbot-greeting.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.chatbot-greeting__close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #E8E0D8;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #6B5E56;
  line-height: 1;
  transition: background 0.2s;
}

.chatbot-greeting__close:hover {
  background: #7ECECE;
  color: #fff;
}


/* --- Chat Panel (expanded state) --- */
.chatbot-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  height: 520px;
  background: #FAF7F2;
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(45, 38, 34, 0.18);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}


/* --- Panel Header --- */
.chatbot-header {
  background: #2C2420;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chatbot-header__info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-header__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #7ECECE;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
}

.chatbot-header__text h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #FAF7F2;
  line-height: 1.2;
  margin: 0;
  letter-spacing: 0.02em;
}

.chatbot-header__text span {
  font-family: 'Poppins', sans-serif;
  font-size: 0.6875rem;
  color: #7ECECE;
  font-weight: 500;
}

.chatbot-header__close {
  background: none;
  border: none;
  color: #9B8E84;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-header__close:hover {
  color: #FAF7F2;
}

.chatbot-header__close svg {
  width: 18px;
  height: 18px;
}


/* --- Messages Area --- */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chatbot-messages::-webkit-scrollbar {
  width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #E8E0D8;
  border-radius: 4px;
}

/* Message bubbles */
.chatbot-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8125rem;
  line-height: 1.6;
  animation: chatFadeIn 0.3s ease;
}

@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chatbot-msg--bot {
  align-self: flex-start;
  background: #FFFFFF;
  color: #2D2622;
  border: 1px solid #E8E0D8;
  border-bottom-left-radius: 4px;
}

.chatbot-msg--user {
  align-self: flex-end;
  background: #7ECECE;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.chatbot-typing {
  align-self: flex-start;
  padding: 10px 14px;
  background: #FFFFFF;
  border: 1px solid #E8E0D8;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.chatbot-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9B8E84;
  animation: typingBounce 1.4s infinite;
}

.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}


/* --- Input Area --- */
.chatbot-input {
  padding: 12px 16px;
  background: #FFFFFF;
  border-top: 1px solid #E8E0D8;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.chatbot-input input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #E8E0D8;
  border-radius: 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8125rem;
  outline: none;
  background: #FAF7F2;
  color: #2D2622;
  transition: border-color 0.2s;
}

.chatbot-input input:focus {
  border-color: #7ECECE;
}

.chatbot-input input::placeholder {
  color: #9B8E84;
}

.chatbot-input button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #7ECECE;
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.chatbot-input button:hover {
  background: #5BB8B8;
  transform: scale(1.05);
}

.chatbot-input button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.chatbot-input button svg {
  width: 18px;
  height: 18px;
}


/* --- Powered By --- */
.chatbot-powered {
  text-align: center;
  padding: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.625rem;
  color: #9B8E84;
  background: #FFFFFF;
  border-top: 1px solid #F0EAE3;
}


/* --- Mobile Responsive --- */
@media (max-width: 480px) {
  .chatbot-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .chatbot-bubble {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .chatbot-panel,
  .chatbot-bubble,
  .chatbot-msg,
  .chatbot-bubble svg {
    transition: none;
    animation: none;
  }
}
