:root {
  --purple: #8B4CFC;
  --user: #4A90E2;
  --accent: #8B4CFC;
  --bg: #FAF8F6;
  --text: #333;
  --white: #fff;
  --color-ui-gold: #fcd34d;
  --color-ui-lightpurple: #a78bfa;
}

#chatbot {
  font-family: 'Inter', sans-serif;
    position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
}


#chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

#chat-window {
  position: absolute;
  bottom: 70px; /* direkt über dem Button */
  right: 0;
  width: 320px;
  height: 440px;
  background: var(--bg);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  overflow: hidden;
  display: none;
  flex-direction: column;
}


    #chat-window.visible {
      display: flex;
    }


.hidden {
  display: none;
}




#chat-messages {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
  background: var(--bg);
  height: 100%;
}

/* Bot Bubble */
.chat-bubble {
  position: relative;
  align-self: flex-start;
  background: var(--purple);
  color: white;
  border-radius: 18px;
  padding: 0.7rem 1rem;
  margin: 0.5rem 0;
  max-width: 80%;
  word-wrap: break-word;
}

.chat-bubble p {
  line-height: 1.1;
}

/* Bot Bubble Tail – unten links */
.chat-bubble::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: -6px;
  width: 12px;
  height: 12px;
  background: var(--purple);
  border-bottom-right-radius: 12px;
  transform: rotate(45deg);
  z-index: -1;
}

/* User Bubble */
.user-bubble {
  position: relative;
  align-self: flex-end;
  background: var(--user);
  color: white;
  border-radius: 18px;
  padding: 0.7rem 1rem;
  margin: 0.5rem 0;
  max-width: 80%;
  word-wrap: break-word;
}

/* User Bubble Tail – unten rechts */
.user-bubble::after {
  content: "";
  position: absolute;
  bottom: 6px;
  right: -6px;
  width: 12px;
  height: 12px;
  background: var(--user);
  border-bottom-left-radius: 12px;
  transform: rotate(45deg);
  z-index: -1;
}

/* Antwort-Buttons unter Bubbles */
.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chat-options button {
  background: var(--purple);
  color: white;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.3s;
}

.chat-options button:hover {
  background: #a78bfa;
}

/* Ergebnis-Farbbalken */
.result-bar {
  margin-top: 0.8rem;
  padding-bottom: 0.5rem;
}

/* Hinweisbox */
.chat-disclaimer {
  font-size: 0.75rem;
  color: #f9f9f9;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: 3px solid var(--color-ui-gold);
  border-radius: 4px;
}

/* Links klickbar & schöner */
a {
  color: var(--color-ui-lightpurple);
  text-decoration: none;
}
#chatbot a:hover {
  font-weight: bold;
  text-decoration: underline;
  color: var(--color-ui-lightpurple);
}

#chat-window { display: none; }
#chat-window.is-open { display: flex; }