/* elo.css — vraag-robot Elo (widget).
   Eigen CSS i.p.v. Tailwind-classes: de JS injecteert bericht-bubbels dynamisch,
   die classes zou de Tailwind-purge niet zien. Kleuren verwijzen naar de
   centrale tokens in main.css (:root) — geen eigen hex herhalen (P2.4). */

:root {
  --elo-primair: var(--kleur-primair);
  --elo-primair-hover: var(--kleur-primair-hover);
  --elo-zacht: var(--kleur-primair-zacht);
  --elo-rand: var(--kleur-primair-rand);
  --elo-tekst: var(--kleur-tekst);
  --elo-grijs: var(--kleur-grijs);
}

/* === Launcher-knop === */
.elo-launcher {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--elo-primair);
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.95rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.elo-launcher:hover { background: var(--elo-primair-hover); }
.elo-launcher:focus-visible { outline: 3px solid var(--elo-rand); outline-offset: 2px; }
.elo-launcher[hidden] { display: none; }

/* === Paneel === */
.elo-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1001;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 70vh;
  max-height: 640px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 1rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.elo-panel[hidden] { display: none; }

.elo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--elo-zacht);
  border-bottom: 1px solid var(--elo-rand);
}
.elo-header h2 {
  font-family: Poppins, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--elo-tekst);
}
.elo-sluit {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--elo-grijs);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
}
.elo-sluit:hover { background: rgba(0, 0, 0, 0.05); }
.elo-sluit:focus-visible { outline: 2px solid var(--elo-primair); }

/* === Berichtenstroom === */
.elo-stroom {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.elo-bubble {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  border-radius: 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.elo-bubble-bot {
  align-self: flex-start;
  background: #F3F4F6;
  color: var(--elo-tekst);
  border-bottom-left-radius: 0.25rem;
}
.elo-bubble-user {
  align-self: flex-end;
  background: var(--elo-primair);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}
.elo-typint { color: var(--elo-grijs); font-style: italic; font-size: 0.88rem; }

/* === Chips (snelstart + vervolg) === */
.elo-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.25rem; }
.elo-chip {
  background: #fff;
  border: 1px solid var(--elo-rand);
  color: var(--elo-primair-hover);
  border-radius: 9999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  min-height: 36px;
}
.elo-chip:hover { background: var(--elo-zacht); }
.elo-chip:focus-visible { outline: 2px solid var(--elo-primair); }

/* === CTA + bronnen === */
.elo-cta {
  display: inline-block;
  background: var(--elo-primair);
  color: #fff;
  text-decoration: none;
  border-radius: 0.5rem;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}
.elo-cta:hover { background: var(--elo-primair-hover); }
.elo-bronnen { margin-top: 0.4rem; font-size: 0.82rem; }
.elo-bronnen a { color: #2563EB; text-decoration: underline; text-underline-offset: 2px; display: block; }

/* === Feedback-duimen === */
.elo-feedback { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.3rem; }
.elo-duim {
  background: none;
  border: 1px solid #E5E7EB;
  border-radius: 0.5rem;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  min-height: 32px;
}
.elo-duim:hover { background: #F3F4F6; }
.elo-feedback-redenen { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.elo-dank { color: var(--elo-grijs); font-size: 0.8rem; }

/* === Invoerbalk === */
.elo-invoer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #E5E7EB;
  background: #fff;
}
.elo-invoer textarea {
  flex: 1;
  resize: none;
  border: 1px solid #D1D5DB;
  border-radius: 0.5rem;
  padding: 0.5rem 0.6rem;
  font-family: inherit;
  font-size: 0.9rem;
  max-height: 80px;
}
.elo-invoer textarea:focus { outline: none; border-color: var(--elo-primair); box-shadow: 0 0 0 2px var(--elo-rand); }
.elo-verstuur {
  background: var(--elo-primair);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0 0.9rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 44px;
}
.elo-verstuur:hover { background: var(--elo-primair-hover); }
.elo-verstuur:disabled { opacity: 0.5; cursor: not-allowed; }

.elo-disclaimer { padding: 0 0.75rem 0.6rem; font-size: 0.72rem; color: var(--elo-grijs); text-align: center; }

/* === Mobiel: schermvullend === */
@media (max-width: 640px) {
  .elo-panel {
    right: 0; bottom: 0; left: 0; top: 0;
    width: 100%; max-width: 100%;
    height: 100dvh; max-height: 100dvh;
    border-radius: 0;
  }
}

/* === Respecteer prefers-reduced-motion === */
@media (prefers-reduced-motion: reduce) {
  .elo-launcher { transition: none; }
}
