/* ------ chatbot ------- */

/* Bouton flottant */
.sym-ai-fab {
  position: fixed; right: 18px; bottom: 18px;
  width: 52px; height: 52px; border-radius: 50%;
  background: #111827; color: #fff; display:flex; align-items:center; justify-content:center;
  font-size: 22px; cursor: pointer; box-shadow: 0 10px 25px rgba(0,0,0,.12); z-index: 9999;
}
.sym-ai-fab:hover { transform: translateY(-1px); }

/* Modal */
.sym-ai-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: flex-end; justify-content: flex-end; padding: 20px; z-index: 10000;
}
.sym-ai-close { background: transparent; color:#fff; border:0; font-size: 22px; line-height: 1; cursor: pointer; }
.sym-ai-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #eee; }
.sym-ai-input { flex: 1; padding: 10px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 14px; }
.sym-ai-send { padding: 10px 12px; background: #2563eb; color: white; border: 0; border-radius: 8px; cursor: pointer; }

.sym-ai-msg { margin: 8px 0; }
.sym-ai-msg.user { text-align: right; }
.sym-ai-bubble { display: inline-block; padding: 8px 10px; border-radius: 10px; }
.sym-ai-msg.user .sym-ai-bubble { background: #2563eb; color: #fff; }
.sym-ai-msg.bot .sym-ai-bubble { background: #f3f4f6; color: #111827; }
.sym-ai-typing { opacity: .7; font-style: italic; }

/* Effet présence (désactivé si prefers-reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
  .sym-ai-fab.attn {
    animation: sym-ai-nudge 800ms ease;
  }
  @keyframes sym-ai-nudge {
    0%   { transform: translateY(0) scale(1); }
    30%  { transform: translateY(-2px) scale(1.04); }
    60%  { transform: translateY(0) scale(1); }
    100% { transform: translateY(-1px) scale(1.02); }
  }
}

.sym-ai-dialog {
  width: clamp(420px, 40vw, 640px);           /* 360 -> 480 */
  max-width: 96vw;        /* un peu plus large si l’écran est petit */
  background: #fff; border-radius: 12px; overflow: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,.2);
  display:flex; flex-direction: column;
  max-height: 88vh;       /* 82 -> 88 pour profiter de la hauteur */
  resize: both;
  min-width: 320px; min-height: 320px;
}

.sym-ai-header { /* inchangé sauf qu’on aligne les boutons à droite */
  background: #111827; color: #fff; padding: 10px 12px;
  display:flex; align-items:center; justify-content: space-between;
  font-weight: 600; font-size: 14px; gap: 8px;
}
.sym-ai-expand {
  background: transparent; color:#fff; border:0; font-size: 18px; line-height: 1;
  cursor: pointer; margin-right: 8px;
}

.sym-ai-messages {
  padding: 12px;
  flex: 1 1 auto;
  min-height: 280px;
  overflow-y: auto;
  font-size: 14px; line-height: 1.45;
}

/* Mode agrandi (toggle) */
.sym-ai-dialog.expanded {
  width: clamp(640px, 60vw, 960px);
  max-width: 96vw;
  max-height: 92vh;
}

@media (max-width: 768px) {
  .sym-ai-dialog.expanded { width: 96vw; }
}

.sym-ai-modal { overscroll-behavior: contain; }

.sym-ai-bubble {
  word-break: break-word;
  overflow-wrap: anywhere;
}
.sym-ai-bubble a { text-decoration: underline; }
.sym-ai-bubble a:hover { text-decoration: none; }

.sym-ai-close, .sym-ai-expand, .sym-ai-send {
  outline: none;
}
.sym-ai-close:focus-visible, .sym-ai-expand:focus-visible, .sym-ai-send:focus-visible, .sym-ai-input:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.sym-ai-dialog {
  animation: sym-ai-pop 0.25s ease-out;
}
@keyframes sym-ai-pop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* --- Teaser près du FAB --- */

.sym-ai-teaser {
  position: fixed; right: 84px; bottom: 28px;  /* à gauche du FAB */
  max-width: 260px;
  z-index: 9999; /* au-dessus du FAB */
}

.sym-ai-teaser-inner {
  background: #111827; color: #fff;
  padding: 10px 12px; border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,.18);
  font-size: 14px; line-height: 1.35;
  position: relative;
}

.sym-ai-teaser-inner::after {
  content: "";
  position: absolute; right: -8px; bottom: 12px;
  border-width: 8px 0 8px 10px;
  border-style: solid;
  border-color: transparent transparent transparent #111827; /* petite flèche */
}

.sym-ai-teaser-close {
  position: absolute; top: 4px; right: 6px;
  background: transparent; border: 0; color: #fff;
  font-size: 16px; cursor: pointer; line-height: 1; opacity: .8;
}
.sym-ai-teaser-close:hover { opacity: 1; }

@media (max-width: 520px) {
  .sym-ai-teaser { right: 18px; bottom: 86px; } /* au-dessus du FAB sur mobile */
  .sym-ai-teaser-inner::after { right: 18px; bottom: -8px; transform: rotate(90deg); border-width:10px 8px 0 8px; border-color:#111827 transparent transparent transparent; }
}

/* Animations discrètes */
@media (prefers-reduced-motion: no-preference) {
  .sym-ai-teaser[data-state="in"] .sym-ai-teaser-inner {
    animation: sym-ai-teaser-in .22s ease-out both;
  }
  @keyframes sym-ai-teaser-in {
    from { opacity: 0; transform: translateY(6px) scale(.98); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
  }
}

/* --- Jarvis recap style --- */

/* --- Jarvis recap style (existante + ajouts typing) --- */

.recap-jarvis-hint {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f4f4f4;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 10px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
  font-size: 0.95rem;
  line-height: 1.4;
  color: #333;
  border: 1px solid rgba(0,0,0,0.05);
}

.recap-jarvis-hint .jarvis-avatar {
  flex-shrink: 0;
  font-size: 1.8rem;
  line-height: 1;
  user-select: none;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15));
}

.recap-jarvis-hint .jarvis-message {
  flex: 1;
  white-space: pre-line; /* respecte les \n */
  min-height: 1.2em; /* évite le "saut" au début */
  color: #222;
  font-size: 0.95rem;
  line-height: 1.45;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  position: relative;
}

/* curseur qui clignote à la fin du texte */
.recap-jarvis-hint .cursor {
  display: inline-block;
  width: 0.6ch;
  border-right: 2px solid #444;
  animation: blink 0.9s steps(1) infinite;
  margin-left: 2px;
  translate: 0 2px;
}

@keyframes blink {
  0%   { border-color: rgba(0,0,0,0.4); }
  50%  { border-color: rgba(0,0,0,0); }
  100% { border-color: rgba(0,0,0,0.4); }
}

/* petit état "en écriture" : léger highlight pulsé */
.recap-jarvis-hint.typing {
  background: #f8f8f8;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  animation: jarvisGlow 1.6s ease-in-out infinite;
}

@keyframes jarvisGlow {
  0%   { box-shadow: 0 4px 12px rgba(0,0,0,0.07); }
  50%  { box-shadow: 0 6px 18px rgba(34,197,94,0.15); } /* léger vert AI pas trop flashy */
  100% { box-shadow: 0 4px 12px rgba(0,0,0,0.07); }
}


.recap-jarvis-hint:hover {
  background: #eaeaea;
}



.recap-jarvis-hint .label {
  font-weight: 600;
  color: #222;
}
