/* ============================================================
   Sofretma Assistant — Chatbot styles
   SOFRETMA TRANSIT | W2K-Digital
   ============================================================ */

/* Bulle flottante d'ouverture */
#chatbot-bulle {
  position: fixed;
  bottom: 100px;
  left: 28px;
  z-index: 9000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #C9922B;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(201,146,43,.5);
  transition: all .3s ease;
  animation: chatbot-pulse 3s ease-in-out infinite;
  border: none;
}

#chatbot-bulle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(201,146,43,.6);
}

#chatbot-bulle svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

@keyframes chatbot-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(201,146,43,.5); }
  50%       { box-shadow: 0 4px 35px rgba(201,146,43,.8); }
}

/* Pastille notification */
#chatbot-bulle::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  background: #ff4444;
  border-radius: 50%;
  border: 2px solid #fff;
}

/* Panneau chatbot */
#chatbot-panneau {
  position: fixed;
  bottom: 168px;
  left: 28px;
  width: 320px;
  max-height: 480px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 50px rgba(0,0,0,.2);
  z-index: 8999;
  display: flex;
  flex-direction: column;
  transform: scale(.95) translateY(10px);
  opacity: 0;
  visibility: hidden;
  transition: all .3s ease;
  overflow: hidden;
}

#chatbot-panneau.ouvert {
  transform: scale(1) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* En-tête chatbot */
.chatbot__header {
  background: linear-gradient(135deg, #1a6b3a, #0d4a27);
  color: #fff;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chatbot__header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #C9922B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.chatbot__nom {
  font-weight: 700;
  font-size: .95rem;
}

.chatbot__statut {
  font-size: .75rem;
  opacity: .8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot__statut::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4cde80;
  display: inline-block;
}

.chatbot__fermer {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  padding: 4px;
  transition: color .3s ease;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot__fermer:hover { color: #fff; }

/* Zone messages */
.chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}

.msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: .88rem;
  line-height: 1.5;
  animation: msg-arrive .2s ease;
}

@keyframes msg-arrive {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg--bot {
  background: #f0f0f0;
  color: #2D2D2D;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg--user {
  background: #1a6b3a;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Boutons de catégories */
.chatbot__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.cat-btn {
  padding: 6px 12px;
  border-radius: 50px;
  border: 1.5px solid #C9922B;
  background: transparent;
  color: #C9922B;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  min-height: 32px;
  font-family: 'Inter', sans-serif;
}

.cat-btn:hover, .cat-btn.actif {
  background: #C9922B;
  color: #fff;
}

/* Zone saisie */
.chatbot__saisie {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.chatbot__input {
  flex: 1;
  border: 1.5px solid #ddd;
  border-radius: 50px;
  padding: 8px 14px;
  font-size: .88rem;
  font-family: 'Inter', sans-serif;
  color: #2D2D2D;
  transition: border-color .3s ease;
  outline: none;
}

.chatbot__input:focus { border-color: #1a6b3a; }

.chatbot__envoyer {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1a6b3a;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background .3s ease;
  flex-shrink: 0;
}

.chatbot__envoyer:hover { background: #0d4a27; }

/* Responsive */
@media (max-width: 480px) {
  #chatbot-panneau {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 140px;
  }

  #chatbot-bulle {
    bottom: 80px;
    left: 16px;
  }
}
