/* Leo (02-11): de AI-assistent rechtsonder, in de huisstijl van deze site (kleuren, letters en hoeken uit
   site.css). Staat op de plek van de WhatsApp-knop (die gaat weg zodra Leo aan staat) en, op een telefoon,
   boven de balk onderaan. Het script is
   js/leo.js; de markup staat in resources/views/site/partials/leo.blade.php. */

.mk-leo{
  --leo-rechts: 20px;
  --leo-onder: 22px;            /* de plek van de WhatsApp-knop die Leo vervangt */
  position: relative;
  z-index: 85;                  /* boven de balk onderaan (70) */
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
@media (max-width: 940px){
  .mk-leo{ --leo-rechts: 16px; --leo-onder: 86px; }    /* boven de balk onderaan (71px) */
}

.mk-leo-knop{
  position: fixed;
  right: var(--leo-rechts);
  bottom: var(--leo-onder);
  display: grid; place-items: center;
  width: 58px; height: 58px; padding: 0;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: #fff; font: inherit;
  box-shadow: 0 6px 20px rgba(35, 38, 43, .22);
  transition: transform .2s ease, box-shadow .2s ease, background-color .16s ease;
}
.mk-leo-knop:hover{ background: var(--ink-deep); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(35, 38, 43, .28); }
.mk-leo-knop > svg{ width: 30px; height: 30px; }
.mk-leo-knop .mk-leo-stip{ fill: var(--ink); }
@media (max-width: 940px){
  .mk-leo-knop{ width: 52px; height: 52px; }
  .mk-leo-knop > svg{ width: 27px; height: 27px; }
}
/* Altijd zichtbaar dat het een AI is (AI Act). */
.mk-leo-ai{
  position: absolute; top: -4px; right: -5px;
  padding: 1px 6px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font: 800 .62rem/1.4 var(--f-head); letter-spacing: .04em;
  box-shadow: 0 2px 8px -2px rgba(35, 38, 43, .35);
}
.mk-leo-knop:focus-visible,
.mk-leo-venster :focus-visible{ outline: 3px solid var(--accent-text); outline-offset: 2px; }
.mk-leo-open .mk-leo-knop{ visibility: hidden; }

.mk-leo-venster{
  position: fixed;
  right: var(--leo-rechts);
  bottom: var(--leo-onder);
  display: flex; flex-direction: column;
  width: min(24rem, calc(100vw - 2 * var(--leo-rechts)));
  height: min(34rem, calc(100dvh - var(--leo-onder) - 16px));
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-m), 0 24px 60px -18px rgba(35, 38, 43, .35);
}
.mk-leo-venster[hidden]{ display: none; }
@media (max-width: 940px){
  /* Open: boven de balk onderaan, bijna het hele scherm. */
  .mk-leo-venster{ bottom: 83px; height: min(34rem, calc(100dvh - 83px - 12px)); }
}

.mk-leo-kop{
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px 12px 16px;
  background: var(--ink); color: #fff;
}
.mk-leo-icoon{
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
}
.mk-leo-icoon svg{ width: 18px; height: 18px; }
.mk-leo-titel{ flex: 1; min-width: 0; margin: 0; line-height: 1.25; }
.mk-leo-titel strong{ display: block; font: 700 1rem/1.2 var(--f-head); }
.mk-leo-titel span{ font-size: .78rem; color: rgba(255, 255, 255, .82); }
.mk-leo-titel a{ color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.mk-leo-kopknop{
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: #fff; font: inherit;
}
.mk-leo-kopknop:hover{ background: rgba(255, 255, 255, .14); }
.mk-leo-kopknop svg{ width: 18px; height: 18px; }
.mk-leo-kop :focus-visible{ outline-color: #fff; }

.mk-leo-berichten{
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 9px;
  padding: 16px;
  background: #fff;
}
.mk-leo-bericht{
  max-width: 86%; margin: 0; padding: 9px 13px;
  border-radius: 14px; white-space: pre-line; overflow-wrap: anywhere;
}
.mk-leo-van-leo{
  align-self: flex-start;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-bottom-left-radius: 4px;
}
.mk-leo-van-ik{
  align-self: flex-end;
  background: var(--accent); color: var(--on-accent);
  border-bottom-right-radius: 4px;
}
.mk-leo-bericht a{ color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.mk-leo-van-leo a{ color: var(--accent-text); }

.mk-leo-denkt{ display: inline-flex; gap: 4px; align-items: center; }
.mk-leo-denkt i{ width: 7px; height: 7px; border-radius: 99px; background: currentColor; opacity: .45; }
@media (prefers-reduced-motion: no-preference){
  .mk-leo-denkt i{ animation: mk-leo-denkt 1s infinite ease-in-out; }
  .mk-leo-denkt i:nth-child(2){ animation-delay: .15s; }
  .mk-leo-denkt i:nth-child(3){ animation-delay: .3s; }
  .mk-leo-venster:not([hidden]){ animation: mk-leo-in .18s ease-out; }
}
@keyframes mk-leo-denkt{ 50%{ opacity: 1; transform: translateY(-2px); } }
@keyframes mk-leo-in{ from{ opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce){
  .mk-leo-knop, .mk-leo-knop:hover{ transition: none; transform: none; }
}

.mk-leo-vorm{
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line); background: var(--paper);
}
.mk-leo-vorm textarea{
  flex: 1; min-height: 42px; max-height: 112px; resize: none;
  padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: #fff; color: var(--ink); font: inherit;
}
.mk-leo-vorm textarea::placeholder{ color: var(--muted); }
.mk-leo-stuur{
  display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; padding: 0;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: var(--on-accent);
}
.mk-leo-stuur:hover{ background: var(--accent-deep); }
.mk-leo-stuur:disabled{ opacity: .55; cursor: default; }
.mk-leo-stuur svg{ width: 18px; height: 18px; }
.mk-leo-voet{ margin: 0; padding: 0 16px 10px; font-size: .72rem; line-height: 1.4; color: var(--body); background: var(--paper); }

.mk-leo-sr{
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media print{ .mk-leo{ display: none; } }
