#bw-chatbot {
  position: fixed;
  bottom: 80px;
  right: 10px;
  width: 420px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
  font-family: sans-serif;
  display: none;
  flex-direction: column;
  z-index: 9999;
}

#bw-chatbot.open {
  display: flex;
}

#bw-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #222;
  color: #fff;
  padding: 10px;
  font-weight: bold;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

#bw-chat-messages {
  padding: 12px;
  height: 520px;
  overflow-y: auto;
  background: #f9f9f9;
}

#bw-chat-input {
  border: none;
  padding: 10px;
  border-top: 1px solid #ccc;
  outline: none;
}

.bw-chat-msg {
  font-size: 14px; /* oder 12px, wenn es noch kleiner sein soll */
  margin: 6px 0;
  padding: 6px 10px;
  border-radius: 8px;
  max-width: 100%;
}

.bw-chat-msg.user {
  background: #d1e7dd;
  align-self: flex-end;
}

.bw-chat-msg.bot {
  background: #f0f0f0;
}

/* ======= Typing-Indikator (3 Punkte) ======= */
.bw-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px !important;
  min-height: 0;
}

.bw-typing-indicator .bw-dot {
  width: 7px;
  height: 7px;
  background: #999;
  border-radius: 50%;
  display: inline-block;
  animation: bwTypingBounce 1.4s infinite ease-in-out both;
}

.bw-typing-indicator .bw-dot:nth-child(1) {
  animation-delay: 0s;
}

.bw-typing-indicator .bw-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.bw-typing-indicator .bw-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bwTypingBounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ======= Kompakte Abstände für Bot-Antworten ======= */
.bw-chat-msg.bot ol,
.bw-chat-msg.bot ul {
  margin: 0 !important;
  padding-left: 18px !important;
}

.bw-chat-msg.bot li {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.35 !important;
  font-size: 13px;
}

.bw-chat-msg.bot li + li {
  margin-top: 1px !important;
}

.bw-chat-msg.bot p {
  margin: 1px 0 !important;
  line-height: 1.35;
}

.bw-chat-msg.bot br + br {
  display: none;
}

.bw-chat-msg.bot {
  line-height: 1.35;
}

/* ======= Formatierung für Bot-Antworten ======= */

/* Artikel-Titel */
.bw-chat-msg.bot .kb-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 2px;
  line-height: 1.3;
}

/* Kategorie-Label */
.bw-chat-msg.bot .kb-cat {
  display: inline-block;
  font-size: 10px;
  color: #fff;
  background: #5b8def;
  padding: 1px 7px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Abschnitts-Überschriften */
.bw-chat-msg.bot .kb-heading {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin-top: 10px;
  margin-bottom: 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid #ddd;
}

/* Nummerierte Schritte */
.bw-chat-msg.bot ol.kb-steps {
  margin: 6px 0 6px 0;
  padding-left: 20px;
  list-style: decimal;
}
.bw-chat-msg.bot ol.kb-steps li {
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 3px;
  color: #333;
}

/* Aufzählungslisten */
.bw-chat-msg.bot ul.kb-list {
  margin: 6px 0 6px 0;
  padding-left: 16px;
  list-style: disc;
}
.bw-chat-msg.bot ul.kb-list li {
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 2px;
  color: #333;
}

/* Tipp-Boxen */
.bw-chat-msg.bot .kb-tip {
  display: block;
  background: #e8f4fd;
  border-left: 3px solid #5b8def;
  padding: 5px 8px;
  margin: 6px 0;
  font-size: 11px;
  color: #1e3a5f;
  border-radius: 0 4px 4px 0;
  line-height: 1.4;
}

/* Hinweis-Boxen */
.bw-chat-msg.bot .kb-note {
  display: block;
  background: #fff8e1;
  border-left: 3px solid #ffc107;
  padding: 5px 8px;
  margin: 6px 0;
  font-size: 11px;
  color: #5d4e00;
  border-radius: 0 4px 4px 0;
  line-height: 1.4;
}

/* Normaler Absatz */
.bw-chat-msg.bot p.kb-text {
  font-size: 12px;
  line-height: 1.5;
  margin: 4px 0;
  color: #444;
}

/* Trennlinie */
.bw-chat-msg.bot .kb-divider {
  display: block;
  height: 1px;
  background: #ddd;
  margin: 8px 0;
}

/* "Siehe auch"-Link (klickbar) */
.bw-chat-msg.bot .kb-related {
  display: block;
  font-size: 11px;
  color: #666;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #ccc;
}

/* Follow-up Links als klickbare Chips */
.bw-chat-msg.bot .bw-followup-link {
  display: inline;
  color: #1e3a5f;
  text-decoration: none;
  border-bottom: 1px dashed #5b8def;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bw-chat-msg.bot .bw-followup-link:hover {
  color: #5b8def;
  border-bottom-color: #5b8def;
  border-bottom-style: solid;
}

/* Footer-Link */
.bw-chat-msg.bot .kb-footer {
  display: block;
  font-size: 11px;
  color: #888;
  margin-top: 8px;
  padding-top: 5px;
  border-top: 1px solid #e0e0e0;
}
.bw-chat-msg.bot .kb-footer a {
  color: #5b8def;
  font-weight: 600;
}
#bw-chat-open {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #222;
  color: #fff;
  font-size: 18px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  text-align: center;
  line-height: 48px;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

/* Rote X-Bubble wenn Chat geöffnet ist */
#bw-chat-open.close-mode {
  background: #dc3545;
  font-size: 20px;
  transform: scale(1.1);
}
#bw-chatbot {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

#bw-chatbot.open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}
.bw-chat-buttons {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bw-chat-button {
  padding: 8px 12px;
  background: #e0e0e0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
  text-align: left;
}

.bw-chat-button:hover {
  background: #ccc;
}


#bw-chat-footer {
  display: flex;
  border-top: 1px solid #ccc;
}

#bw-chat-input {
  flex: 1;
  border: none;
  padding: 10px;
  outline: none;
}

#bw-chat-reset {
  width: 40px;
  background: #f4f4f4;
  border: none;
  font-size: 18px;
  cursor: pointer;
  border-left: 1px solid #ccc;
}
#bw-chat-reset {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
}
#bw-chat-reset:hover {
  color: #ffcc00;
}
#bw-chatbot a {
  color: #007bff; /* klassisches Blau */
  text-decoration: underline;
}

#bw-chatbot a:hover {
  color: #cc0000; /* kräftiges Rot */
}
#bw-chatbot.minimized #bw-chat-messages,
#bw-chatbot.minimized #bw-chat-footer {
  display: none;
}

#bw-chatbot.minimized {
  display: none !important;
}
/* Minimieren-Button entfernt */
#bw-chat-footer {
  display: flex;
  align-items: center;
  gap: 6px;
}

#bw-chat-footer input {
  flex: 1;
  padding: 6px 8px;
  font-size: 14px;
}

#bw-chat-footer button {
  padding: 6px 12px;
  background: #444;
  color: #fff;
  border: 1px solid #888;
  border-radius: 4px;
  cursor: pointer;
}

#bw-chat-footer button:hover {
  background: #666;
  border-color: #aaa;
}

/* Animierte Bubble für "Dein Chatbot" */
#bw-chat-bubble {
  position: fixed;
  bottom: 75px;
  right: 15px;
  background: #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-family: sans-serif;
  white-space: nowrap;
  z-index: 9997;
  opacity: 0;
  transform: translateY(10px);
  animation: bubbleFloat 3s ease-in-out 3;
  animation-fill-mode: forwards;
  pointer-events: none;
}

#bw-chat-bubble::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #333;
}

@keyframes bubbleFloat {
  0%, 100% {
    opacity: 0;
    transform: translateY(10px);
  }
  10%, 90% {
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* Wackel-Animation deaktiviert */
#bw-chat-open.wiggle {
  animation: none;
}

@keyframes wiggle {
  0%, 100% {
    transform: rotate(0deg);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  }
  25% {
    transform: rotate(-8deg) scale(1.1);
    box-shadow: -2px 6px 12px rgba(0,0,0,0.3);
  }
  75% {
    transform: rotate(8deg) scale(1.1);
    box-shadow: 2px 6px 12px rgba(0,0,0,0.3);
  }
}

.bw-chat-header-buttons {
  display: flex;
  gap: 4px; /* Abstand zwischen den Buttons */
}

#bw-chat-header button {
  background: none;
  border: none;
  font-size: 14px;
  padding: 2px 6px;
  margin-left: 4px;
  cursor: pointer;
  color: #ccc;
}

#bw-chat-header button:hover {
  color: #fff;
}


