/* ═══════════════════════════════════════════════════════
   Widget Chatbot IvoirPass
   ═══════════════════════════════════════════════════════ */

[x-cloak] { display: none !important; }

/* ── Bulle flottante ─────────────────────────────────── */
.chatbot-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F47920, #E85D04);
  color: white;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(244, 121, 32, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 9998;
}
.chatbot-bubble:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(244, 121, 32, 0.5);
}
.chatbot-bubble--open {
  background: #1B7A3E;
  box-shadow: 0 4px 20px rgba(27, 122, 62, 0.4);
}
.chatbot-bubble__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  background: #dc3545;
  border: 2px solid white;
  border-radius: 50%;
  animation: chatbot-pulse 1.5s infinite;
}
@keyframes chatbot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.2); opacity: 0.7; }
}

/* ── Panneau ─────────────────────────────────────────── */
.chatbot-panel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 120px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.chatbot-panel--open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ── Header ──────────────────────────────────────────── */
.chatbot-header {
  background: linear-gradient(135deg, #1B7A3E, #145c2e);
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chatbot-header__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.chatbot-header__title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}
.chatbot-header__status {
  font-size: 0.75rem;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 5px;
}
.chatbot-header__dot {
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
}
.chatbot-header__btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.chatbot-header__btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ── Zone de messages ────────────────────────────────── */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chatbot-msg {
  display: flex;
  max-width: 85%;
}
.chatbot-msg--user {
  align-self: flex-end;
  justify-content: flex-end;
}
.chatbot-msg--bot {
  align-self: flex-start;
}
.chatbot-msg__bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.chatbot-msg--user .chatbot-msg__bubble {
  background: #F47920;
  color: white;
  border-bottom-right-radius: 4px;
}
.chatbot-msg--bot .chatbot-msg__bubble {
  background: white;
  color: #212529;
  border: 1px solid #e9ecef;
  border-bottom-left-radius: 4px;
}

/* Indicateur typing */
.chatbot-msg__bubble--typing {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
}
.chatbot-msg__bubble--typing span {
  width: 6px;
  height: 6px;
  background: #adb5bd;
  border-radius: 50%;
  animation: chatbot-typing 1.4s infinite ease-in-out;
}
.chatbot-msg__bubble--typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-msg__bubble--typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatbot-typing {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* ── Bouton WhatsApp ─────────────────────────────────── */
.chatbot-whatsapp {
  background: #fff3e0;
  border: 1px solid #ffe0b2;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.chatbot-whatsapp__text {
  font-size: 0.82rem;
  color: #6c757d;
  margin: 0 0 8px 0;
}
.chatbot-whatsapp__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25D366;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: transform 0.15s;
}
.chatbot-whatsapp__btn:hover {
  transform: scale(1.03);
  color: white;
}

/* ── Input ───────────────────────────────────────────── */
.chatbot-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  background: white;
  border-top: 1px solid #e9ecef;
  flex-shrink: 0;
}
.chatbot-input textarea {
  flex: 1;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  resize: none;
  max-height: 100px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.chatbot-input textarea:focus {
  border-color: #F47920;
}
.chatbot-input__send {
  background: #F47920;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s;
  flex-shrink: 0;
}
.chatbot-input__send:hover:not(:disabled) {
  background: #E85D04;
}
.chatbot-input__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Sur mobile : panneau flottant compact, pas plein écran */
  .chatbot-panel {
    right: 12px;
    left: 12px;
    bottom: 88px;
    width: auto;
    max-width: 420px;
    height: 68vh;
    max-height: 560px;
    border-radius: 16px;
    margin: 0 auto;
  }
  .chatbot-panel--open {
    transform: translateY(0);
  }

  .chatbot-bubble {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
    font-size: 1.45rem;
  }

  /* Messages un peu plus compacts sur mobile */
  .chatbot-msg {
    max-width: 90%;
  }
  .chatbot-msg__bubble {
    font-size: 0.88rem;
    padding: 9px 13px;
  }
}
