/* Chatbot Toggle Button */
.chatbot-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: var(--primary); /* coral */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(224, 122, 95, 0.4);
  z-index: 1000;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: chatbot-pulse 3s ease-in-out infinite;
}
.chatbot-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(224, 122, 95, 0.5); }
.chatbot-toggle svg { width: 28px; height: 28px; fill: white; }
.chatbot-toggle.hidden { display: none; }

@keyframes chatbot-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(224, 122, 95, 0.4); }
  50% { box-shadow: 0 4px 24px rgba(224, 122, 95, 0.6); }
}

/* Chatbot Panel */
.chatbot-panel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  max-height: 520px;
  background: var(--bg-white);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(61, 64, 91, 0.15);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}
.chatbot-panel.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Header */
.chatbot-header {
  background: var(--primary);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.chatbot-header__title { font-family: var(--font-heading); font-weight: 700; font-size: 1rem; }
.chatbot-header__close { background: none; border: none; color: white; font-size: 24px; cursor: pointer; padding: 0 4px; line-height: 1; }

/* Messages Area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: 320px;
}

/* Message Bubbles */
.chatbot-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.chatbot-msg--bot { background: var(--bg-cream); color: var(--text-dark); align-self: flex-start; border-bottom-left-radius: 4px; }
.chatbot-msg--user { background: var(--primary); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }

/* Typing Indicator */
.chatbot-typing { display: flex; gap: 4px; padding: 10px 14px; align-self: flex-start; }
.chatbot-typing span { width: 8px; height: 8px; background: var(--border); border-radius: 50%; animation: typing-bounce 1.2s ease-in-out infinite; }
.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Quick Reply Options */
.chatbot-options { padding: 8px 16px 12px; display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.chatbot-option { background: white; border: 1.5px solid var(--primary); color: var(--primary); padding: 8px 14px; border-radius: 20px; font-size: 13px; cursor: pointer; transition: all 0.15s ease; font-family: var(--font-body); }
.chatbot-option:hover { background: var(--primary); color: white; }

/* Input Area */
.chatbot-input { display: flex; padding: 12px 16px; border-top: 1px solid var(--border); gap: 8px; flex-shrink: 0; }
.chatbot-input input { flex: 1; border: 1px solid var(--border); border-radius: 20px; padding: 8px 16px; font-size: 14px; font-family: var(--font-body); outline: none; }
.chatbot-input input:focus { border-color: var(--primary); }
.chatbot-input button { background: var(--primary); color: white; border: none; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: background 0.15s; }
.chatbot-input button:hover { background: var(--primary-hover); }

/* Mobile: full screen */
@media (max-width: 768px) {
  .chatbot-panel {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    max-height: 100%;
    border-radius: 0;
    bottom: 0;
  }
  .chatbot-panel.open + .chatbot-toggle { display: none; }
  .chatbot-messages { max-height: none; flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-toggle { animation: none; }
  .chatbot-panel { transition: none; }
  .chatbot-typing span { animation: none; }
}
