#reaction-menu { display: none !important; }

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', 'Poppins', sans-serif; }
body { background: #0a0a0a; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; }
#app { width: 100%; max-width: 500px; height: 100vh; background: #111; box-shadow: 0 0 30px rgba(255,0,0,0.1); display: flex; flex-direction: column; overflow: hidden; border-left: 1px solid #300; border-right: 1px solid #300; }
.screen { display: none; flex-direction: column; height: 100%; }
.screen.active { display: flex; }

/* Login */
.auth-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 20px; animation: fadeSlideUp 0.5s ease; }
@keyframes fadeSlideUp { 0% { opacity: 0; transform: translateY(30px); } 100% { opacity: 1; transform: translateY(0); } }
.logo { text-align: center; margin-bottom: 30px; cursor: pointer; }
.bm { font-size: 64px; font-weight: 900; color: #ff0000; text-shadow: 0 0 20px #ff000080; letter-spacing: 8px; }
.message-logo { font-size: 24px; color: #fff; letter-spacing: 6px; display: block; margin-top: -10px; }
.auth-form { width: 100%; display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; }
input, textarea { background: #1a1a1a; border: 1px solid #333; color: white; padding: 15px; border-radius: 8px; font-size: 16px; outline: none; transition: border 0.3s, box-shadow 0.3s; }
input:focus, textarea:focus { border-color: #ff0000; box-shadow: 0 0 10px #ff000040; }
.btn-red { background: #ff0000; color: white; border: none; padding: 15px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: all 0.3s ease; font-size: 16px; }
.btn-red:hover { background: #cc0000; box-shadow: 0 0 20px #ff0000; transform: translateY(-2px); }
.btn-red:active { transform: scale(0.96); }
.debug-info { color: #ddd; margin-top: 10px; font-size: 14px; text-align: center; }
.certified-info { margin-top: 30px; color: #666; font-size: 12px; display: flex; align-items: center; gap: 8px; }

/* Loader */
#loader-container { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; margin-top: 20px; }
.loader-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
.bm-loader { font-size: 64px; font-weight: 900; color: #ff0000; text-shadow: 0 0 20px #ff000080; letter-spacing: 8px; animation: pulseBM 1.5s ease-in-out infinite; }
@keyframes pulseBM { 0%,100% { opacity: 1; transform: scale(1); text-shadow: 0 0 20px #ff000080; } 50% { opacity: 0.6; transform: scale(1.1); text-shadow: 0 0 40px #ff0000cc; } }
.loader-text { font-size: 20px; color: #fff; letter-spacing: 6px; margin-top: 10px; animation: fadeText 1.5s ease-in-out infinite; }
@keyframes fadeText { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }
.progress-bar { width: 80%; height: 6px; background: #1a1a1a; border-radius: 3px; overflow: hidden; box-shadow: 0 0 10px rgba(255,0,0,0.3); }
.progress-fill { width: 0%; height: 100%; background: #ff0000; border-radius: 3px; animation: fillProgress 2s ease-in-out infinite; }
@keyframes fillProgress { 0% { width: 0%; } 50% { width: 70%; } 100% { width: 100%; } }

/* Toast */
.toast {
  position: fixed;
  bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #222; color: #fff; padding: 12px 24px;
  border-radius: 30px; font-size: 15px;
  box-shadow: 0 4px 20px rgba(255,0,0,0.4);
  z-index: 9999; opacity: 0; transition: opacity 0.3s;
  pointer-events: none; text-align: center;
  max-width: 90%;
}
.toast.show { opacity: 1; }

/* Header */
header { background: #0d0d0d; padding: 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #ff000030; }
.header-left { display: flex; align-items: center; gap: 10px; }
.header-left i, .header-left span { color: #ff0000; font-weight: bold; font-size: 18px; }
.header-right { display: flex; align-items: center; gap: 10px; color: #ddd; font-size: 14px; }
.badge { margin-left: 4px; font-size: 12px; }
.badge.ceo { color: #22c55e; } .badge.directeur { color: #3b82f6; }
.icon-btn { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; transition: all 0.3s; padding: 5px; border-radius: 50%; }
.icon-btn:hover { color: #ff0000; background: rgba(255,0,0,0.1); transform: scale(1.1); }

/* Messages */
#messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  
  /* Fond avec ton logo */
  background-color: #0a0a0a;
  background-image: url('logo-bm.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 60%;
  background-attachment: fixed;
  
  /* Leger voile pour lisibilité */
  box-shadow: inset 0 0 200px rgba(0,0,0,0.7);
}

.date-separator { text-align: center; color: #888; font-size: 13px; margin: 10px 0; }
.message-bubble { max-width: 80%; padding: 10px 14px; border-radius: 18px; word-wrap: break-word; background: #1e1e1e; color: #ddd; align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: 0 2px 5px #00000050; position: relative; animation: messageIn 0.3s ease; }
.message-bubble.own {
  background: #4a1010;   /* ← plus clair que #2a0000 */
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  border: 1px solid #ff000040;
}
@keyframes messageIn { 0% { opacity: 0; transform: translateY(20px) scale(0.95); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.message-header { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 13px; }
.sender-name { font-weight: bold; color: #1d4ed8; }
.message-badge { font-size: 12px; margin-left: 2px; }
.message-badge.ceo { color: #22c55e; } .message-badge.directeur { color: #3b82f6; }
.message-time { margin-left: auto; font-size: 11px; color: #888; }
.message-content { font-size: 15px; line-height: 1.4; color: white; }
.reply-preview { background: #1a1a1a; border-left: 3px solid #ff0000; padding: 8px; margin-bottom: 5px; border-radius: 4px; font-size: 13px; color: #aaa; }
.reactions-container { display: flex; justify-content: flex-start; margin-top: 6px; }
.message-bubble.own .reactions-container { justify-content: flex-end; }
.reaction-badge { display: inline-flex; align-items: center; background: #2a2a2a; border-radius: 20px; padding: 2px 8px; font-size: 14px; gap: 4px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: all 0.3s; animation: popIn 0.3s ease; }
@keyframes popIn { 0% { transform: scale(0); opacity: 0; } 70% { transform: scale(1.2); } 100% { transform: scale(1); opacity: 1; } }
.reaction-badge.active { background: #1a3a5c; }
.reaction-menu { position: absolute; background: #222; border-radius: 20px; padding: 4px 8px; display: none; gap: 4px; z-index: 50; box-shadow: 0 4px 20px rgba(0,0,0,0.6); }
.reaction-menu button { background: none; border: none; color: white; font-size: 20px; padding: 2px 6px; cursor: pointer; transition: all 0.2s; }
.reaction-menu button:hover { transform: scale(1.5) rotate(-10deg); }

/* Footer */
footer { background: #0d0d0d; padding: 10px 15px; display: flex; align-items: center; gap: 10px; border-top: 1px solid #ff000030; }
#message-input { flex: 1; padding: 12px; background: #1a1a1a; border: 1px solid #333; border-radius: 20px; color: white; }

/* Settings */
.settings-container { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
.settings-card { background: #151515; border-radius: 16px; padding: 20px; border: 1px solid #ff000030; }
.settings-card h3 { color: #ff0000; margin-bottom: 15px; }
.settings-card p, .settings-card span, .member-item span { color: #ffffff; }
.member-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #333; align-items: center; }
.member-item:last-child { border-bottom: none; }
.member-item i.fa-circle { font-size: 10px; margin-right: 8px; vertical-align: middle; }
.share-bar { background: #1a1a1a; border-radius: 10px; height: 20px; overflow: hidden; display: flex; margin-top: 10px; }
.share-ceo { background: #ff0000; height: 100%; }
.share-dir { background: #3b82f6; height: 100%; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); justify-content: center; align-items: center; z-index: 1000; animation: modalFadeIn 0.3s ease; }
@keyframes modalFadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }
.modal-content { background: #151515; padding: 20px; border-radius: 16px; min-width: 280px; border: 1px solid #ff000040; animation: modalPop 0.3s ease; }
@keyframes modalPop { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.modal-content button { display: block; width: 100%; background: #222; border: none; color: white; padding: 14px; margin: 8px 0; border-radius: 8px; cursor: pointer; text-align: left; font-size: 16px; transition: all 0.3s; }
.modal-content button:hover { background: #ff0000; transform: translateX(5px); }
.btn-outline { background: transparent !important; border: 1px solid #444 !important; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #ff0000; border-radius: 10px; }


/* ... (début du fichier inchangé jusqu'à la fin) */

/* Bandeau message épinglé */
.pinned-banner {
  background: #1a0000;
  border-bottom: 1px solid #ff000040;
  padding: 8px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ddd;
  font-size: 14px;
}
.pinned-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pinned-content i {
  color: #ff0000;
}
#pinned-text {
  overflow: hidden;
  text-overflow: ellipsis;
}
#unpin-btn {
  color: #aaa;
}
#unpin-btn:hover {
  color: #ff0000;
}

/* Point de statut dans les messages */
.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* Badge message non lu */
.unread-badge {
  background: #ff0000;
  color: white;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 12px;
  margin-left: 5px;
}

/* Bouton épingler (pin) */
.pin-btn {
  position: absolute;
  top: 5px;
  right: 60px; /* À côté des autres boutons */
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
}
.message-bubble:hover .pin-btn {
  display: flex;
}
.pin-btn:hover {
  background: #ff0000;
}