/* Heidtman Dev Chatbot Widget */
#hd-chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1B5E75;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(27, 94, 117, 0.35);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: hd-pulse 3s ease-in-out infinite;
}

#hd-chatbot-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(27, 94, 117, 0.45);
}

#hd-chatbot-toggle svg {
  width: 26px;
  height: 26px;
  fill: #fff;
  transition: opacity 0.2s;
}

#hd-chatbot-toggle .hd-close-icon { display: none; }
#hd-chatbot-toggle.hd-open .hd-chat-icon { display: none; }
#hd-chatbot-toggle.hd-open .hd-close-icon { display: block; }

@keyframes hd-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(27, 94, 117, 0.35); }
  50% { box-shadow: 0 4px 24px rgba(27, 94, 117, 0.55); }
}

/* Proactive greeting bubble */
#hd-chatbot-bubble {
  position: fixed;
  bottom: 90px;
  right: 24px;
  background: #fff;
  color: #1d1d1f;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 9998;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: 260px;
}

#hd-chatbot-bubble.hd-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  cursor: pointer;
}

/* Chat window */
#hd-chatbot-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#hd-chatbot-window.hd-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.hd-chat-header {
  background: #1B5E75;
  color: #fff;
  padding: 16px 20px;
  font-family: 'Cinzel', serif;
  font-weight: 500;
  font-size: 16px;
  flex-shrink: 0;
}

.hd-chat-header span {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.8;
  display: block;
  margin-top: 2px;
}

/* Messages area */
.hd-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hd-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}

.hd-msg-bot {
  align-self: flex-start;
  background: #F5F0E8;
  color: #1d1d1f;
  border-bottom-left-radius: 4px;
}

.hd-msg-user {
  align-self: flex-end;
  background: #1B5E75;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.hd-msg-bot a {
  color: #1B5E75;
  font-weight: 500;
  text-decoration: underline;
}

/* Typing indicator */
.hd-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-self: flex-start;
  background: #F5F0E8;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

.hd-typing-dot {
  width: 7px;
  height: 7px;
  background: #6e6e73;
  border-radius: 50%;
  animation: hd-bounce 1.2s infinite ease-in-out;
}

.hd-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.hd-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes hd-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* Suggested buttons */
.hd-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}

.hd-suggestion-btn {
  background: #fff;
  border: 1.5px solid #1B5E75;
  color: #1B5E75;
  border-radius: 20px;
  padding: 7px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.hd-suggestion-btn:hover {
  background: #1B5E75;
  color: #fff;
}

/* Input area */
.hd-chat-input-area {
  display: flex;
  padding: 12px 16px;
  border-top: 1px solid #d2d2d7;
  flex-shrink: 0;
  gap: 8px;
}

.hd-chat-input-area input {
  flex: 1;
  border: 1px solid #d2d2d7;
  border-radius: 24px;
  padding: 10px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  color: #1d1d1f;
}

.hd-chat-input-area input:focus {
  border-color: #1B5E75;
}

.hd-chat-input-area button {
  background: #1B5E75;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.hd-chat-input-area button:hover {
  background: #174e63;
}

.hd-chat-input-area button svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

/* Mobile responsive */
@media (max-width: 768px) {
  #hd-chatbot-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  #hd-chatbot-toggle {
    bottom: 16px;
    right: 16px;
  }

  #hd-chatbot-bubble {
    bottom: 82px;
    right: 16px;
  }
}
