/* ============================================================
   chatbot.css — LessWAIste Chatbot Widget
   Floating Button + Chat-Fenster, rechts unten
   ============================================================ */

#lw-chatbot-btn {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 9998;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #7398cf;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(115,152,207,0.45);
  transition: background 0.2s ease, transform 0.2s ease;
}

#lw-chatbot-btn:hover {
  background: #5a7fba;
  transform: scale(1.07);
}

#lw-chatbot-btn svg {
  width: 26px;
  height: 26px;
}

/* ---- Chat-Fenster ---- */
#lw-chatbot-window {
  position: fixed;
  bottom: 155px;
  right: 24px;
  z-index: 9999;
  width: 340px;
  max-height: 500px;
  background: #fefefe;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.13);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

/* Header */
#lw-chatbot-header {
  background: #7398cf;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

#lw-chatbot-header span {
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.01em;
}

#lw-chatbot-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  opacity: 0.8;
  padding: 0;
  line-height: 1;
  font-size: 20px;
  transition: opacity 0.15s;
}

#lw-chatbot-close:hover {
  opacity: 1;
}

/* Nachrichten-Bereich */
#lw-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.lw-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 10px;
  line-height: 1.45;
  font-size: 13.5px;
  font-weight: 400;
  word-break: break-word;
  white-space: pre-wrap;
}

.lw-msg.lw-user {
  align-self: flex-end;
  background: #7398cf;
  color: #fff;
  border-bottom-right-radius: 3px;
}

.lw-msg.lw-bot {
  align-self: flex-start;
  background: #f0f3f8;
  color: #333;
  border-bottom-left-radius: 3px;
}

.lw-msg.lw-error {
  align-self: flex-start;
  background: #fdecea;
  color: #b71c1c;
  border-bottom-left-radius: 3px;
}

/* Typing-Indikator */
.lw-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 10px 14px;
  background: #f0f3f8;
  border-radius: 10px;
  border-bottom-left-radius: 3px;
}

.lw-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7398cf;
  animation: lw-bounce 1.2s infinite ease-in-out;
}

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

@keyframes lw-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40%            { transform: translateY(-6px); opacity: 1; }
}

/* Input-Bereich */
#lw-chatbot-input-area {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
  background: #fefefe;
}

#lw-chatbot-input {
  flex: 1;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  padding: 7px 11px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  resize: none;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.4;
  max-height: 90px;
  overflow-y: auto;
  color: #333;
  background: #fff;
}

#lw-chatbot-input:focus {
  border-color: #7398cf;
}

#lw-chatbot-input::placeholder {
  color: #aaa;
}

#lw-chatbot-send {
  background: #7398cf;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
  transition: background 0.15s;
}

#lw-chatbot-send:hover {
  background: #5a7fba;
}

#lw-chatbot-send:disabled {
  background: #ccc;
  cursor: default;
}

#lw-chatbot-send svg {
  width: 17px;
  height: 17px;
  fill: #fff;
}

/* Dark Mode Support */
body.dark-mode #lw-chatbot-window {
  background: #1e2530;
}

body.dark-mode .lw-msg.lw-bot {
  background: #2a3444;
  color: #e0e0e0;
}

body.dark-mode .lw-typing {
  background: #2a3444;
}

body.dark-mode #lw-chatbot-input-area {
  background: #1e2530;
  border-top-color: rgba(255,255,255,0.08);
}

body.dark-mode #lw-chatbot-input {
  background: #2a3444;
  border-color: #3a4555;
  color: #e0e0e0;
}

body.dark-mode #lw-chatbot-input::placeholder {
  color: #666;
}

/* Feedback-Zeile unter Bot-Nachrichten */
.lw-msg-wrapper {
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  max-width: 82%;
}

.lw-feedback {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 3px;
  padding-left: 3px;
}

.lw-fb-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 4px;
  opacity: 0.35;
  transition: opacity 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  line-height: 1;
}

.lw-fb-btn:hover {
  opacity: 0.7;
  background: rgba(115,152,207,0.12);
}

.lw-fb-btn svg {
  width: 13px;
  height: 13px;
  fill: #7398cf;
}

.lw-fb-btn.lw-fb-active {
  opacity: 1;
}

.lw-fb-btn.lw-fb-inactive {
  opacity: 0.15;
  cursor: default;
  pointer-events: none;
}

.lw-fb-thanks {
  font-size: 11px;
  color: #7398cf;
  margin-left: 4px;
  font-style: italic;
}

body.dark-mode .lw-fb-thanks {
  color: #8aabdb;
}

/* Mobile */
@media (max-width: 420px) {
  #lw-chatbot-window {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 150px;
  }
  #lw-chatbot-btn {
    right: 16px;
    bottom: 90px;
  }
}
