/* =============================================
   WIDGET CONFIG – pas hier je eigen stijl aan
   ============================================= */
:root {
  --wa-green:       #25D366;
  --wa-dark-green:  #128C7E;
  --wa-header-bg:   #075E54;
  --wa-bubble-in:   #ffffff;
  --wa-bubble-out:  #dcf8c6;
  --wa-bg:          #ece5dd;
  --wa-text:        #111;
  --wa-meta:        #888;
  --wa-radius:      18px;
  --wa-shadow:      0 8px 40px rgba(0,0,0,.22);
  --font:           'Nunito', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: #1a1a2e;
  min-height: 100vh;
}

/* =============================================
   LAUNCHER BUTTON
   ============================================= */
#wa-launcher {
  position: fixed;
  bottom: 28px;
  left: 28px; /* Staat netjes links */
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--wa-green);
  box-shadow: 0 4px 20px rgba(37,211,102,.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  border: none;
  transition: transform .2s, box-shadow .2s;
}
#wa-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(37,211,102,.65);
}
#wa-launcher svg { width: 32px; height: 32px; fill: #fff; }

#wa-launcher::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid var(--wa-green);
  animation: pulse 2.2s ease-out infinite;
  opacity: 0;
}
@keyframes pulse {
  0%   { opacity: .7; transform: scale(.9); }
  100% { opacity: 0;  transform: scale(1.5); }
}

#wa-badge {
  position: absolute;
  top: -4px; left: -4px; /* Aangepast van right naar left voor de notificatie-badge */
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #f00;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* =============================================
   CHAT WINDOW
   ============================================= */
#wa-window {
  position: fixed;
  bottom: 100px;
  left: 28px; /* FIX: Veranderd van 'right' naar 'left' zodat het venster links opent */
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 600px;
  max-height: calc(100vh - 140px);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--wa-shadow);
  display: flex;
  flex-direction: column;
  z-index: 9998;
  font-family: var(--font);
  transform: scale(.92) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s;
}
#wa-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ── */
#wa-header {
  background: var(--wa-header-bg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  flex-shrink: 0;
}
#wa-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--wa-green);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  position: relative;
}
#wa-avatar::after {
  content: '';
  position: absolute;
  bottom: 1px; right: 1px;
  width: 11px; height: 11px;
  background: var(--wa-green);
  border-radius: 50%;
  border: 2px solid var(--wa-header-bg);
}
#wa-header-info { flex: 1; min-width: 0; }
#wa-header-name { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#wa-header-status { font-size: 12px; opacity: .85; margin-top: 1px; }
#wa-close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.75); font-size: 22px; line-height: 1;
  padding: 4px; border-radius: 50%;
  transition: background .15s, color .15s;
  display: flex; align-items: center; justify-content: center;
}
#wa-close:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── Mode toggle ── */
#wa-mode-bar {
  background: var(--wa-dark-green);
  display: flex;
  flex-shrink: 0;
}
.wa-mode-btn {
  flex: 1;
  border: none;
  background: none;
  color: rgba(255,255,255,.65);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 4px;
  cursor: pointer;
  transition: background .15s, color .15s;
  letter-spacing: .02em;
}
.wa-mode-btn.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.wa-mode-btn:first-child { border-right: 1px solid rgba(255,255,255,.15); }

/* ── Messages area ── */
#wa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  background: var(--wa-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ccircle cx='40' cy='40' r='1.5' fill='%23c5b8ad' fill-opacity='.25'/%3E%3C/svg%3E");
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}
#wa-messages::-webkit-scrollbar { width: 4px; }
#wa-messages::-webkit-scrollbar-thumb { background: #b5a89e; border-radius: 4px; }

/* bubbles */
.wa-bubble {
  max-width: 82%;
  padding: 9px 13px 6px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--wa-text);
  position: relative;
  animation: bubbleIn .2s ease-out;
  word-break: break-word;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.wa-bubble.incoming {
  background: var(--wa-bubble-in);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.wa-bubble.outgoing {
  background: var(--wa-bubble-out);
  align-self: flex-end;
  border-bottom-right-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.wa-bubble-time {
  display: block;
  font-size: 10px;
  color: var(--wa-meta);
  text-align: right;
  margin-top: 3px;
}
.wa-bubble.outgoing .wa-bubble-time::after {
  content: ' ✓✓';
  color: #53bdeb;
}

/* typing indicator */
.wa-typing {
  background: var(--wa-bubble-in);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  border-radius: 12px 12px 12px 3px;
  padding: 12px 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  display: flex; gap: 5px; align-items: center;
}
.wa-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #aaa;
  animation: typingDot 1.2s infinite;
}
.wa-typing span:nth-child(2) { animation-delay: .2s; }
.wa-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typingDot {
  0%,60%,100% { transform: translateY(0); opacity: .5; }
  30%          { transform: translateY(-5px); opacity: 1; }
}

/* ── Quick-choice buttons ── */
#wa-choices {
  background: var(--wa-bg);
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex-shrink: 0;
}
.wa-choice-btn {
  background: #fff;
  border: 1.5px solid var(--wa-green);
  color: var(--wa-dark-green);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 24px;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
  display: flex; align-items: center; gap: 8px;
}
.wa-choice-btn:hover { background: var(--wa-green); color: #fff; }

.wa-reset-btn {
  justify-content: center;
  background: var(--wa-green);
  color: #fff;
  border: none;
}
.wa-reset-btn:hover { background: var(--wa-dark-green); }

/* ── Input bar ── */
#wa-input-bar {
  background: #f0f0f0;
  padding: 10px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
#wa-input {
  flex: 1;
  border: none;
  border-radius: 24px;
  padding: 10px 16px;
  font-family: var(--font);
  font-size: 14px;
  background: #fff;
  color: #111;
  outline: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
#wa-input::placeholder { color: #aaa; }
#wa-send {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--wa-green);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .15s;
}
#wa-send:hover { background: var(--wa-dark-green); transform: scale(1.05); }
#wa-send svg { width: 20px; height: 20px; fill: #fff; }

.wa-cta-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--wa-green);
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 20px;
  text-decoration: none;
  margin-top: 6px;
  transition: background .15s;
}
.wa-cta-btn:hover { background: var(--wa-dark-green); }

#wa-brand {
  background: #f0f0f0;
  text-align: center;
  font-size: 10.5px;
  color: #bbb;
  padding: 5px;
  flex-shrink: 0;
  letter-spacing: .02em;
}

/* Mobile responsive */
@media (max-width: 420px) {
  #wa-window { 
    bottom: 88px; 
    left: 12px;   /* FIX: Op mobiel ook strak vanaf de linkerkant uitlijnen */
    right: 12px;  
    width: auto; 
    height: auto;
    max-height: calc(100vh - 110px); 
  }
  #wa-launcher { bottom: 20px; left: 16px; } /* FIX: Knop op mobiel ook naar links */
}