
/* GPT-Input */
#gpt-form {
  position: relative;  /* WICHTIG: Anker für Overlay UND Counter */
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 720px;
}

#gpt-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(2,6,23,.15);
}

#gpt-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
}


/* --- Chat Overlay --- */
#chat-overlay {
  /*background: #fff !important;*/
  color: #111 !important;  
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-width: none;
  display: none;
  z-index: 1500;
  pointer-events: none; /* Klicks durchlassen, wenn nicht aktiv */
  justify-content: center;
  align-items: flex-end;  
  background: transparent;
}
#chat-overlay.active {
  display: flex;
  pointer-events: auto;
}

/* --- Mobile Fullscreen Chat Overlay --- */
@media (prefers-color-scheme: dark) {
  html, body {
    background: #fff !important;
    color: #111 !important;
  }
}

.chat-inner {
  position: relative;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  padding: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 720px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scroll-behavior: smooth;
}

/* Close-Button (gleiches Verhalten wie Tooltip-Links) */
/*
#chat-close {
  appearance: none !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  color: #666;
  position: absolute;
  top: 0.1rem;
  right: 0.5rem;
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}

#chat-close::before {
  content: "×";
  font-size: 1.8rem;
  color: var(--fg);
  display: inline-block;
  transition: color 0.2s ease, transform 0.15s ease;
}

#chat-close:hover::before {
  color: var(--accent);
  transform: scale(1.15);
}
*/

/* Chat Box */
#chat-box {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Chat Entries */
.chat-entry {
  max-width: 80%;
  padding: 0.65rem 0.9rem;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  word-wrap: break-word;
}

/* User rechts (dunkel) */
.chat-entry.user {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}
.chat-entry.user strong { color: rgba(255,255,255,0.8); }

/* Bot links (hell) */
.chat-entry.bot {
  margin-right: auto;
  background: #f3f4f6;
  color: #111;
  border-bottom-left-radius: 0.25rem;
}
.chat-entry.bot strong { color: var(--muted); }


/* Typing Indicator */
.typing {
  display: flex;
  gap: 4px;
  padding: 0.2rem 0;
}
.typing span {
  width: 6px;
  height: 6px;
  background: #555;
  border-radius: 50%;
  display: inline-block;
  animation: bounce 1.4s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

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

/* Toggler */
#chat-toggle{
  position: static;         /* bleibt normal im Flow */
  display: inline-flex;     /* zentrieren */
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;               /* überschreibt #gpt-form button Padding */
  line-height: 1;           /* kein Zeilenversatz */
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: .5rem;       /* Abstand zum Submit */
}
#chat-toggle:hover{ background:#000; }

