/* LACU Loopbaancoach — zwevende widget. Alles hangt onder #lacu-coach-root
   om nooit te botsen met theme-stijlen. */

#lacu-coach-root {
  --lc-brand: #1f7891;
  --lc-brand-deep: #22627c;
  --lc-brand-deeper: #0e4a5f;
  --lc-ink: #0c121d;
  --lc-muted: #5a6b78;
  --lc-surface: #ffffff;
  --lc-wash: #eef4f6;
  --lc-line: #d7e5e8;
  --lc-user-bubble: #1f7891;
  --lc-user-ink: #ffffff;
  --lc-shadow: 0 18px 50px -12px rgba(12, 66, 87, 0.34);
  --lc-focus: #0e4a5f;
  --lc-font-display: "Nunito", system-ui, sans-serif;
  --lc-font-body: "Mulish", system-ui, sans-serif;

  all: initial;
  font-family: var(--lc-font-body);
  color: var(--lc-ink);
  position: fixed;
  z-index: 2147483000;
  inset: auto 20px 20px auto;
}

@media (prefers-color-scheme: dark) {
  #lacu-coach-root {
    --lc-brand: #4fa8c0;
    --lc-brand-deep: #1d4d5e;
    --lc-brand-deeper: #12333f;
    --lc-ink: #eaf2f4;
    --lc-muted: #9db3bc;
    --lc-surface: #14232a;
    --lc-wash: #1b2d35;
    --lc-line: #2b4048;
    --lc-user-bubble: #3e8fa6;
    --lc-user-ink: #08151a;
    --lc-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.55);
    --lc-focus: #8fd3e5;
  }
}

#lacu-coach-root *, #lacu-coach-root *::before, #lacu-coach-root *::after {
  box-sizing: border-box;
  font-family: inherit;
}

#lacu-coach-root .lc-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Zwevende knop */
#lacu-coach-root .lc-fab {
  width: 60px; height: 60px;
  border: 0; border-radius: 50%;
  background: var(--lc-brand-deep) center/34px no-repeat;
  box-shadow: var(--lc-shadow);
  cursor: pointer;
  display: block;
  padding: 0;
}
#lacu-coach-root .lc-fab img { width: 34px; height: 34px; display: block; margin: 13px auto; }
#lacu-coach-root .lc-fab:focus-visible { outline: 2px solid var(--lc-focus); outline-offset: 3px; }
#lacu-coach-root.lc-open .lc-fab { display: none; }

/* Paneel */
#lacu-coach-root .lc-panel {
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 40px));
  height: min(600px, calc(100vh - 100px));
  background: var(--lc-surface);
  border: 1px solid var(--lc-line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--lc-shadow);
}
#lacu-coach-root.lc-open .lc-panel { display: flex; }

#lacu-coach-root .lc-head {
  position: relative;
  flex: none;
  padding: 20px 20px 16px;
  text-align: center;
  color: #fff;
  background: linear-gradient(160deg, var(--lc-brand-deep), var(--lc-brand-deeper));
}
#lacu-coach-root .lc-emblem {
  width: 48px; height: 48px;
  margin: 0 auto 8px;
  border-radius: 13px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
#lacu-coach-root .lc-emblem img { width: 28px; height: 28px; }
#lacu-coach-root .lc-head h2 { margin: 0; font-family: var(--lc-font-display); font-weight: 800; font-size: 1.1rem; }
#lacu-coach-root .lc-head p { margin: 4px 0 0; font-size: 0.78rem; color: rgba(255, 255, 255, 0.82); }
#lacu-coach-root .lc-close {
  position: absolute; top: 12px; right: 12px;
  width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 15px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
#lacu-coach-root .lc-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

#lacu-coach-root .lc-thread {
  flex: 1; overflow-y: auto; padding: 18px 14px 8px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--lc-surface); scroll-behavior: smooth;
}
#lacu-coach-root .lc-row { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
#lacu-coach-root .lc-row.lc-bot { align-self: flex-start; max-width: 90%; }
#lacu-coach-root .lc-row.lc-user { align-self: flex-end; max-width: 85%; flex-direction: row-reverse; }
#lacu-coach-root .lc-avatar {
  flex: none; width: 22px; height: 22px; border-radius: 7px;
  background: var(--lc-wash); border: 1px solid var(--lc-line);
  display: flex; align-items: center; justify-content: center;
}
#lacu-coach-root .lc-avatar img { width: 13px; height: 13px; }
#lacu-coach-root .lc-bubble { padding: 9px 12px; border-radius: 14px; font-size: 0.88rem; white-space: pre-wrap; line-height: 1.5; }
#lacu-coach-root .lc-bot .lc-bubble { background: var(--lc-wash); color: var(--lc-ink); border-bottom-left-radius: 4px; }
#lacu-coach-root .lc-user .lc-bubble { background: var(--lc-user-bubble); color: var(--lc-user-ink); border-bottom-right-radius: 4px; }
#lacu-coach-root .lc-bubble a { color: var(--lc-brand); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
#lacu-coach-root .lc-bubble a:hover { color: var(--lc-brand-deep); }
#lacu-coach-root .lc-bubble a:focus-visible { outline: 2px solid var(--lc-focus); outline-offset: 2px; }

#lacu-coach-root .lc-typing { display: flex; gap: 4px; padding: 11px 12px; }
#lacu-coach-root .lc-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--lc-muted);
  animation: lc-blink 1.2s infinite ease-in-out;
}
#lacu-coach-root .lc-typing span:nth-child(2) { animation-delay: 0.2s; }
#lacu-coach-root .lc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes lc-blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

#lacu-coach-root .lc-input { flex: none; display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--lc-line); background: var(--lc-surface); }
#lacu-coach-root .lc-input input {
  flex: 1; font-family: var(--lc-font-body); font-size: 0.88rem; color: var(--lc-ink);
  background: var(--lc-wash); border: 1px solid var(--lc-line); border-radius: 999px; padding: 9px 14px;
}
#lacu-coach-root .lc-input input::placeholder { color: var(--lc-muted); }
#lacu-coach-root .lc-input input:focus-visible { outline: 2px solid var(--lc-focus); outline-offset: 1px; border-color: var(--lc-brand); }
#lacu-coach-root .lc-input button {
  flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--lc-brand); color: #fff; cursor: pointer; display: grid; place-items: center;
}
#lacu-coach-root .lc-input button:hover { background: var(--lc-brand-deep); }
#lacu-coach-root .lc-input button:focus-visible { outline: 2px solid var(--lc-focus); outline-offset: 2px; }
#lacu-coach-root .lc-input button:disabled { opacity: 0.5; cursor: default; }

#lacu-coach-root .lc-foot {
  flex: none; margin: 0; padding: 7px 12px 9px; text-align: center;
  font-size: 0.66rem; color: var(--lc-muted); background: var(--lc-surface); border-top: 1px solid var(--lc-line);
}

@media (prefers-reduced-motion: reduce) {
  #lacu-coach-root * { animation-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 480px) {
  #lacu-coach-root { inset: auto 12px 12px auto; }
  #lacu-coach-root .lc-panel { width: calc(100vw - 24px); height: calc(100vh - 90px); }
}
