/**
 * Ahdarli — ChatLauncher (lanceur du widget : pilule, teaser, badge)
 * css/chat-launcher.css
 *
 * --cl-accent : couleur du client (orange PNK), --cl-accent-text : même
 * teinte assombrie pour du texte sur fond blanc (contraste AA).
 *
 * Author: massaoud@dzprod.net
 * Date: 2026-10-31
 */
.cl-root {
  --cl-accent: #FF6B00;
  --cl-accent-text: #B84D00;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: 'Open Sans', sans-serif;
  pointer-events: none;
}
.cl-root > * { pointer-events: auto; }

/* ── Lanceur : rond (défaut) ou pilule (.cl-expanded) ── */
.cl-launcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  min-width: 56px;
  padding: 4px;
  border: none;
  border-radius: 28px;
  background: var(--cl-accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.cl-launcher:hover { transform: scale(1.04); }
.cl-launcher:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.cl-expanded { padding-right: 18px; }
.cl-open { justify-content: center; font-size: 22px; }

.cl-avatar-wrap { position: relative; display: block; width: 48px; height: 48px; flex: 0 0 48px; }
.cl-avatar { display: block; width: 48px; height: 48px; border-radius: 50%; background: #fff; object-fit: cover; }
.cl-avatar-icon { display: flex; align-items: center; justify-content: center; color: var(--cl-accent); font-size: 20px; }
.cl-online {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2EB82E;
  border: 2px solid var(--cl-accent);
}

.cl-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; white-space: nowrap; }
.cl-label-main { font-size: 15px; font-weight: 700; }
.cl-label-sub { font-size: 12px; }

.cl-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #D93025;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

/* ── Teaser ── */
.cl-teaser {
  position: relative;
  max-width: 270px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  animation: cl-pop 0.25s ease-out;
}
.cl-teaser::after {
  content: '';
  position: absolute;
  right: 22px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
}
.cl-teaser-body {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  padding: 12px 34px 12px 14px;
  border: none;
  border-radius: 14px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  color: #222;
  cursor: pointer;
}
.cl-teaser-from { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 700; color: var(--cl-accent-text); }
.cl-teaser-close {
  position: absolute;
  z-index: 2;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #888;
  font-size: 13px;
  cursor: pointer;
}
.cl-teaser-close:hover { background: #f2f2f2; color: #333; }

@keyframes cl-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 480px) {
  .cl-root { right: 16px; bottom: 16px; }
  .cl-label-sub { display: none; }
  .cl-teaser { max-width: calc(100vw - 32px); }
}

@media (prefers-reduced-motion: reduce) {
  .cl-teaser { animation: none; }
  .cl-launcher { transition: none; }
  .cl-launcher:hover { transform: none; }
}
