/**
 * Lya FAB — Styles
 * Phase D1 — v1.0.0
 * Couleurs AP : primaire #1e3a5f, secondaire #a52a2a, hover #8b0000
 */

/* ── Timer (chrono) — reduit pendant la reflexion ────────────────── */
.mwai-timeless-theme .mwai-input button .mwai-timer {
  font-size: 11px !important;
}

/* ── Dots animation (3 points) — taille reduite ─────────────────── */
div[style*="bouncing-loader"] {
  width: 6px !important;
  height: 6px !important;
  margin: 3px 0 0 3px !important;
}

@keyframes bouncing-loader {
  to {
    opacity: 0.6;
    transform: translateY(-6px);
  }
}

/* ── Masquer l'icone natif AI Engine (remplace par le FAB custom) ── */
.mwai-icon,
.mwai-trigger.mwai-open-button {
  display: none !important;
}

/* ── Container FAB ─────────────────────────────────────────────────── */
#lya-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999990; /* sous les modales Spectra (999999) */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  /* Dimensions fixes pour eviter CLS */
  width: auto;
  pointer-events: none;
}

/* ── Boutons communs ───────────────────────────────────────────────── */
.lya-fab-btn {
  pointer-events: auto;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.lya-fab-btn:hover {
  transform: scale(1.05);
}

.lya-fab-btn:active {
  transform: scale(0.97);
}

/* ── Bouton Hero (Lya) ─────────────────────────────────────────────── */
.lya-fab-hero {
  background: #ffffff;
  color: #1e3a5f;
  border-radius: 28px;
  padding: 12px 20px 12px 14px;
  gap: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.3px;
}

.lya-fab-hero:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
  background: #fefefe;
  color:#212121
}

.lya-fab-avatar {
  flex-shrink: 0;
  border-radius: 30%;
}

.lya-fab-label {
  white-space: nowrap;
}

/* ── Transition smooth pour masquage FAB ─────────────────────────────── */
#lya-fab-chat {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ── Bouton Satellite (Telephone) ──────────────────────────────────── */
.lya-fab-satellite {
  background: #a52a2a;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  box-shadow: 0 3px 10px rgba(165, 42, 42, 0.3);
}

.lya-fab-satellite:hover {
  background: #8b0000;
  box-shadow: 0 4px 14px rgba(139, 0, 0, 0.4);
}

.lya-fab-phone-icon {
  flex-shrink: 0;
}

/* ── Tooltip numero (desktop) ──────────────────────────────────────── */
.lya-phone-tooltip {
  position: absolute;
  right: 52px;
  bottom: 8px;
  background: #1e3a5f;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  animation: lyaTooltipIn 0.2s ease-out;
  z-index: 999991;
}

.lya-phone-tooltip-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

@keyframes lyaTooltipIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Responsive Mobile ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  #lya-fab {
    bottom: 16px;
    right: 16px;
    gap: 10px;
  }

  .lya-fab-hero {
    padding: 10px 16px 10px 12px;
    font-size: 14px;
    border-radius: 24px;
  }

  .lya-fab-hero .lya-fab-avatar {
    width: 24px;
    height: 24px;
  }

  .lya-fab-satellite {
    width: 40px;
    height: 40px;
  }

  .lya-fab-satellite .lya-fab-phone-icon {
    width: 18px;
    height: 18px;
  }
}

/* ── Animation d'entree ────────────────────────────────────────────── */
#lya-fab {
  animation: lyaFabIn 0.3s ease-out;
}

@keyframes lyaFabIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Masquer le bouton natif AI Engine (remplace par FAB custom) ───── */
.mwai-icon,
.mwai-icon-text,
.mwai-trigger.mwai-open-button {
  display: none !important;
}

/* ── Override Timeless — couleurs AP unies (pas de gradient) ──────── */
.mwai-timeless-theme {
  --mwai-backgroundHeaderColor: #1e3a5f !important;
  --mwai-backgroundUserColor: #1e3a5f !important;
  --mwai-bubbleColor: #1e3a5f !important;
  --mwai-accentColor: #1e3a5f !important;
  --mwai-iconTextBackgroundColor: #1e3a5f !important;
}

.mwai-chat .mwai-header {
  background: #1e3a5f !important;
}

.mwai-chat .mwai-input-submit {
  background: #1e3a5f !important;
}

.mwai-chat .mwai-reply .mwai-name {
  color: #1e3a5f !important;
  font-weight: 600;
}

/* ── Bouton telephone — rouge AP ──────────────────────────────────── */
.lya-fab-satellite {
  background: #c41e3a;
  box-shadow: 0 3px 10px rgba(196, 30, 58, 0.3);
}
.lya-fab-satellite:hover {
  background: #a01830;
  box-shadow: 0 4px 14px rgba(160, 24, 48, 0.4);
}

/* ── Compliance footer — typo reduite ─────────────────────────────── */
.mwai-timeless-theme .mwai-compliance {
  font-size: 10px !important;
  line-height: 1.3 !important;
}

/* ── Avatar IA — logo iA a la place de la tete de robot ────────────── */
.mwai-chat .mwai-header .mwai-avatar img,
.mwai-chat .mwai-reply.mwai-ai .mwai-avatar img {
  content: url('/wp-content/themes/astra-child/img/lya-chatbot.png');
  background: #ffffff;
  border-radius: 50%;
  object-fit: contain;
  padding: 2px;
}

/* ── Mobile — header visible avec couleur AP ──────────────────────── */
@media (max-width: 760px) {
  .mwai-timeless-theme.mwai-window .mwai-header {
    display: flex !important;
    background: #1e3a5f !important;
  }
}
