body {
  margin: 0;
  font-family: 'Poppins', Arial, sans-serif;
}

/* Launcher + Intro Bubble */
.chat-launcher-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  z-index: 9999;
}

.chat-launcher {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
  background: url("https://raw.githubusercontent.com/mjhtimmerman/HaalTheorie/main/Trengo%20Widget.png") center/cover no-repeat;
}

.chat-launcher:hover {
  transform: scale(1.05);
}

.chat-intro-bubble {
  background: #0078ff;
  color: #fff;
  padding: 10px 25px 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.3;
  max-width: 240px;
  font-weight: 500;
  animation: fadeIn 0.3s ease-out;
  position: relative;
  border-radius: 14px 14px 0 14px; /* rechtsonder recht */
}

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

/* Chat Window */
.chat-window {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 360px;
  height: 520px;
  background: #f9f9f9;
  border-radius: 16px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  z-index: 10000;
}

.chat-header {
  background: #5a2a78;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-logo {
  height: 22px;
  object-fit: contain;
}

.chat-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

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

.bot-message-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.bot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.message.bot {
  align-self: flex-start;
  background: #e5e5ea;
  color: #000;
  padding: 10px 14px;
  border-radius: 14px 14px 14px 0;
  max-width: 75%;
  font-size: 14px;
  line-height: 1.4;
}

.message.user {
  align-self: flex-end;
  background: #0078ff;
  color: #fff;
  padding: 10px 14px;
  border-radius: 14px 14px 0 14px;
  max-width: 75%;
  font-size: 14px;
  line-height: 1.4;
}

/* Input Area */
.chat-input {
  padding: 10px;
  background: #fff;
  border-top: 1px solid #ddd;
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input textarea {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 14px;
  resize: none;
  outline: none;
  font-family: 'Poppins', Arial, sans-serif;
}

.chat-input button {
  background: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

.chat-input button:hover {
  background: #28a745;
}

/* ---------- Typing Indicator ---------- */
.typing-indicator {
  align-self: flex-start;
  background: #e5e5ea;
  color: #000;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  max-width: 75%;
  display: none;
  animation: fadeInTyping 0.2s ease-in-out;
}

@keyframes fadeInTyping {
  from {opacity: 0; transform: scale(0.95);}
  to {opacity: 1; transform: scale(1);}
}

.typing-indicator .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  background: #555;
  border-radius: 50%;
  opacity: 0.3;
  animation: blink 1.4s infinite;
}

.typing-indicator .dot:nth-child(1) { animation-delay: 0s; }
.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%   { opacity: 0.3; transform: translateY(0px); }
  25%  { opacity: 1; transform: translateY(-2px); }
  50%  { opacity: 0.3; transform: translateY(0px); }
  100% { opacity: 0.3; transform: translateY(0px); }
}
.chat-intro-bubble {
  position: relative;
}

.chat-intro-bubble .close-intro {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.8;
  line-height: 1;
}

.chat-intro-bubble .close-intro:hover {
  opacity: 1;
}

