/* Platinum Customz, chatbot-widget. Donker, rood accent, geen libraries.
   Gebruikt de themavariabelen uit style.css (--red, --black, --steel, --line, --text, --muted). */

.cb { position: fixed; right: 18px; bottom: 18px; z-index: 90; font-family: var(--body, system-ui, sans-serif); color: var(--text, #ededef); }
.cb * { box-sizing: border-box; }
.cb .vis-verborgen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- knop ---- */
.cb-knop {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12);
  background: var(--red, #E01B24); color: #fff; text-decoration: none; cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 0 rgba(var(--red-rgb, 224,27,36), .45);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.cb-knop:hover { transform: translateY(-2px); }
.cb-knop:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cb-knop svg { display: block; }
.cb-badge {
  position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid var(--red, #E01B24);
}
.cb-badge::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.7); animation: cb-pulse 2.2s ease-out infinite;
}
.cb.open .cb-knop { background: var(--steel, #141419); }
.cb.open .cb-badge, .cb.gezien .cb-badge { display: none; }
@keyframes cb-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }

/* ---- paneel ---- */
.cb-paneel {
  position: absolute; right: 0; bottom: 72px; width: 360px; max-width: calc(100vw - 36px);
  height: 560px; max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--night, #0C0C0F); border: 1px solid var(--line, rgba(255,255,255,.1));
  border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.6);
  transform-origin: bottom right; animation: cb-in .22s ease both;
}
.cb-paneel[hidden] { display: none; }
@keyframes cb-in { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

.cb-kop {
  display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px;
  background: var(--steel, #141419); border-bottom: 1px solid var(--line, rgba(255,255,255,.1));
}
.cb-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; display: flex; align-items: center; justify-content: center; background: var(--black, #060607); border: 1px solid var(--line, rgba(255,255,255,.1)); }
.cb-avatar img, .cb-avatar picture { width: 100%; height: 100%; object-fit: cover; display: block; }
.cb-stip { width: 14px; height: 14px; border-radius: 50%; background: var(--red, #E01B24); box-shadow: 0 0 0 4px rgba(var(--red-rgb, 224,27,36), .25); }
.cb-kop-tekst { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.cb-naam { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.cb-status { font-size: 12px; color: var(--muted, #9A9AA2); display: flex; align-items: center; gap: 6px; }
.cb-status i { width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; display: inline-block; }
.cb-sluit { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--muted, #9A9AA2); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cb-sluit:hover { color: #fff; background: rgba(255,255,255,.07); }

.cb-berichten { flex: 1; overflow-y: auto; padding: 16px 14px 6px; display: flex; flex-direction: column; gap: 10px; }
.cb-bericht { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; animation: cb-in .18s ease both; }
.cb-bericht p { margin: 0 0 .5em; }
.cb-bericht p:last-child, .cb-bericht ul:last-child, .cb-bericht ol:last-child { margin-bottom: 0; }
.cb-bericht ul, .cb-bericht ol { margin: .3em 0; padding-left: 1.2em; }
.cb-bericht h3, .cb-bericht h4 { font-size: 14.5px; margin: .2em 0; }
.cb-bericht a { color: #fff; text-decoration: underline; text-decoration-color: rgba(var(--red-rgb, 224,27,36), .8); text-underline-offset: 2px; }
.cb-bot { align-self: flex-start; background: var(--steel, #141419); border: 1px solid var(--line, rgba(255,255,255,.1)); border-bottom-left-radius: 5px; }
.cb-ik { align-self: flex-end; background: var(--red, #E01B24); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; overflow-wrap: anywhere; }

.cb-acties { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 86%; }
.cb-actie {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid rgba(var(--red-rgb, 224,27,36), .6); color: #fff; background: rgba(var(--red-rgb, 224,27,36), .14);
}
.cb-actie:hover { background: var(--red, #E01B24); }
.cb-actie-stil { border-color: var(--line, rgba(255,255,255,.1)); background: transparent; color: var(--text, #ededef); }
.cb-actie-stil:hover { background: rgba(255,255,255,.08); }

.cb-typing { display: inline-flex; gap: 5px; align-items: center; padding: 13px 15px; }
.cb-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted, #9A9AA2); animation: cb-dot 1.1s ease-in-out infinite; }
.cb-typing i:nth-child(2) { animation-delay: .15s; }
.cb-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cb-dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.cb-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px 10px; }
.cb-chips:empty { display: none; }
.cb-chip {
  padding: 7px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; text-align: left;
  border: 1px solid var(--line, rgba(255,255,255,.1)); background: transparent; color: var(--text, #ededef); font-family: inherit;
}
.cb-chip:hover { border-color: var(--red, #E01B24); color: #fff; }

.cb-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line, rgba(255,255,255,.1)); background: var(--steel, #141419); }
.cb-invoer {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 12px; font: inherit; font-size: 15px;
  border: 1px solid var(--line, rgba(255,255,255,.1)); background: var(--black, #060607); color: var(--text, #ededef);
}
.cb-invoer::placeholder { color: var(--muted, #9A9AA2); }
.cb-invoer:focus { outline: none; border-color: var(--red, #E01B24); }
.cb-verstuur { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--red, #E01B24); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.cb-verstuur:hover { filter: brightness(1.1); }
.cb-verstuur:disabled { opacity: .5; cursor: default; }

.cb-fout { font-size: 12.5px; color: #ff8a90; padding: 0 14px 8px; }

/* ---- telefoon: volledig scherm ---- */
@media (max-width: 600px) {
  .cb { right: 14px; bottom: 14px; }
  .cb-knop { width: 54px; height: 54px; }
  .cb-paneel {
    position: fixed; inset: 0; width: auto; max-width: none; height: auto; max-height: none;
    border-radius: 0; border: 0; animation-name: cb-in-mobiel;
  }
  .cb-kop { padding-top: max(14px, env(safe-area-inset-top)); }
  .cb-form { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .cb.open .cb-knop { visibility: hidden; }
  @keyframes cb-in-mobiel { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
}

@media (prefers-reduced-motion: reduce) {
  .cb-paneel, .cb-bericht, .cb-badge::after, .cb-typing i { animation: none; }
  .cb-knop, .cb-knop:hover { transition: none; transform: none; }
}

/* Op telefoons staat onderin de actiebalk (bellen, appen, afspraak); de chatknop erboven. */
@media (max-width: 760px) {
  .cb { bottom: calc(70px + env(safe-area-inset-bottom)); }
}
