/* ═════════════════════════════════════════════════════════
   EuroEntity – Chatbot styles
   ═════════════════════════════════════════════════════════ */

:root {
  --eb-primary: #1E3A8A;
  --eb-secondary: #14B8A6;
  --eb-gradient: linear-gradient(135deg, #1E3A8A 0%, #14B8A6 100%);
}

/* ─── Launcher button (bouton flottant) ─── */
#eb-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: var(--eb-gradient);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px -8px rgba(30, 58, 138, 0.5), 0 4px 10px rgba(15, 23, 42, 0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  padding: 0;
}
#eb-launcher:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 16px 36px -8px rgba(30, 58, 138, 0.6), 0 6px 14px rgba(15, 23, 42, 0.2);
}
#eb-launcher:active { transform: scale(0.96); }

#eb-launcher svg {
  width: 26px;
  height: 26px;
  position: absolute;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#eb-launcher .eb-icon-chat { opacity: 1; transform: rotate(0); }
#eb-launcher .eb-icon-close { opacity: 0; transform: rotate(-90deg); }
#eb-launcher.active .eb-icon-chat { opacity: 0; transform: rotate(90deg); }
#eb-launcher.active .eb-icon-close { opacity: 1; transform: rotate(0); }

/* Pulse pour attirer l'attention */
.eb-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--eb-secondary);
  opacity: 0;
  pointer-events: none;
}
#eb-launcher.attention .eb-pulse {
  animation: eb-pulse 2s ease-out infinite;
}
@keyframes eb-pulse {
  0% { opacity: 0.5; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.6); }
}
#eb-launcher.active.attention .eb-pulse { animation: none; opacity: 0; }

/* ─── Widget (la fenêtre du chat) ─── */
#eb-widget {
  position: fixed;
  bottom: 100px;
  right: 24px;
  z-index: 9997;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 130px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px -16px rgba(15, 23, 42, 0.3), 0 8px 16px rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
#eb-widget.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ─── Header ─── */
.eb-header {
  background: var(--eb-gradient);
  color: #fff;
  padding: 18px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.eb-header-info { display: flex; align-items: center; gap: 12px; }
.eb-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.25);
}
.eb-avatar svg { width: 24px; height: 24px; color: #fff; }
.eb-name { font-size: 15px; font-weight: 600; line-height: 1.2; margin-bottom: 3px; }
.eb-status { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: 0.9; }
.eb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: eb-dot-pulse 2s ease-out infinite;
}
@keyframes eb-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  100% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}
#eb-close {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
#eb-close:hover { background: rgba(255, 255, 255, 0.22); }
#eb-close svg { width: 16px; height: 16px; }

/* ─── Messages ─── */
.eb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  background: #f8fafc;
  scroll-behavior: smooth;
}
.eb-messages::-webkit-scrollbar { width: 4px; }
.eb-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.eb-msg {
  margin-bottom: 10px;
  display: flex;
  animation: eb-msg-in 0.3s ease;
}
@keyframes eb-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.eb-msg.bot { justify-content: flex-start; }
.eb-msg.user { justify-content: flex-end; }
.eb-bubble {
  max-width: 80%;
  padding: 11px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.eb-msg.bot .eb-bubble {
  background: #fff;
  color: #0f172a;
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  border: 1px solid #e2e8f0;
}
.eb-msg.user .eb-bubble {
  background: var(--eb-gradient);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.eb-bubble b { font-weight: 600; }
.eb-msg.bot .eb-bubble b { color: var(--eb-primary); }

/* Typing indicator */
.eb-typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 0;
}
.eb-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: eb-typing 1.4s ease-in-out infinite;
}
.eb-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.eb-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes eb-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* Quick action buttons */
.eb-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 12px;
  padding-left: 4px;
  animation: eb-msg-in 0.4s ease 0.1s both;
}
.eb-quick-btn {
  background: #fff;
  border: 1px solid var(--eb-secondary);
  color: var(--eb-primary);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  font-family: inherit;
  align-self: flex-start;
  max-width: 100%;
}
.eb-quick-btn:hover {
  background: var(--eb-secondary);
  color: #fff;
  transform: translateX(2px);
}

/* ─── Input ─── */
.eb-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  flex-shrink: 0;
}
#eb-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  color: #0f172a;
}
#eb-input:focus {
  border-color: var(--eb-secondary);
  background: #fff;
}
#eb-send {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--eb-gradient);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#eb-send:hover { transform: scale(1.06); box-shadow: 0 4px 10px rgba(30, 58, 138, 0.3); }
#eb-send svg { width: 16px; height: 16px; }

/* ─── Mobile ─── */
@media (max-width: 720px) {
  #eb-launcher {
    bottom: 18px;
    right: 18px;
    width: 56px;
    height: 56px;
  }
  #eb-launcher svg { width: 24px; height: 24px; }

  #eb-widget {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .eb-header { padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
  .eb-avatar { width: 38px; height: 38px; }
  .eb-name { font-size: 14px; }
  .eb-status { font-size: 11px; }
  
  .eb-messages { padding: 14px 12px; }
  .eb-bubble { font-size: 14px; padding: 10px 13px; max-width: 85%; }
  
  .eb-input-wrap {
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  #eb-input { font-size: 16px; /* éviter zoom iOS */ }
  
  .eb-quick-btn { font-size: 13px; padding: 9px 13px; }
}

/* Dark mode pas implémenté volontairement — le chat reste light */
