/* ============================================================
   SportPulse – Messages Page CSS (mobile-first)
   ============================================================ */

/* ─── Page layout ─────────────────────────────────────────────── */
.messages-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-0);
  overflow: hidden;
}

.messages-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  padding-top: 57px; /* topbar height */
}

/* ─── Left sidebar (shared nav) ──────────────────────────────── */
.msg-sidebar {
  display: none;
  width: 250px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-subtle);
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
}

.msg-sidebar-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.msg-sidebar-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid rgba(249, 115, 22, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.msg-sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.msg-sidebar-name {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}

.msg-sidebar-handle {
  font-size: 12px;
  color: var(--text-4);
  margin-bottom: 8px;
}

.msg-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.msg-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  text-decoration: none;
  transition: all var(--transition);
}

.msg-sidebar-nav a:hover {
  color: var(--text-1);
  background: var(--bg-card);
}

.msg-sidebar-nav a.active {
  color: var(--primary);
  background: var(--primary-glow);
}

.msg-sidebar-nav .nav-icon { font-size: 16px; width: 20px; text-align: center; }

/* ─── Conversation list ───────────────────────────────────────── */
.conv-list-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  overflow: hidden;
}

.conv-list-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.conv-list-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.conv-list-title {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
}

.new-conv-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition);
}

.new-conv-btn:hover {
  background: var(--primary-light);
  transform: scale(1.05);
}

.conv-search {
  position: relative;
  display: flex;
  align-items: center;
}

.conv-search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-1);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.conv-search input:focus { border-color: var(--border-focus); }
.conv-search input::placeholder { color: var(--text-4); }

.conv-search .search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-4);
  font-size: 14px;
  pointer-events: none;
}

/* Conversation tabs */
.conv-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.conv-tab {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  color: var(--text-3);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.conv-tab.active {
  background: var(--primary-glow);
  color: var(--primary);
  border-color: rgba(249,115,22,0.2);
}

.conv-tab:hover:not(.active) {
  color: var(--text-1);
  background: var(--bg-card);
}

/* Badge compteur sur l'onglet Demandes */
.conv-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.demandes-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--primary, #f97316);
  color: #fff;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  animation: badge-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badge-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Conversation items */
.conv-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.conv-list::-webkit-scrollbar { width: 4px; }
.conv-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.conv-item:hover { background: var(--bg-card); }

.conv-item.active {
  background: var(--bg-card);
  border-left: 2px solid var(--primary);
}

.conv-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.conv-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  overflow: hidden;
}

.conv-avatar img { width: 100%; height: 100%; object-fit: cover; }

.online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--bg-0);
}

.conv-info {
  flex: 1;
  min-width: 0;
}

.conv-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.conv-name {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.conv-time {
  font-size: 11px;
  color: var(--text-4);
  flex-shrink: 0;
}

.conv-last-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.conv-last-msg {
  font-size: 12px;
  color: var(--text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.conv-last-msg.unread { color: var(--text-2); font-weight: 500; }

.unread-badge {
  background: var(--primary);
  color: white;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.group-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  background: var(--accent-glow);
  color: var(--accent-light);
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 600;
  margin-left: 4px;
}

/* ─── Chat panel ──────────────────────────────────────────────── */
.chat-panel {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-1);
}

.chat-panel.active { display: flex; }

/* Chat header */
.chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  flex-shrink: 0;
}

.chat-back-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-2);
  transition: all var(--transition);
  flex-shrink: 0;
}

.chat-back-btn:hover { background: var(--bg-card-hover); }

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.chat-header-avatar img { width: 100%; height: 100%; object-fit: cover; }

.chat-header-info {
  flex: 1;
  min-width: 0;
}

.chat-header-name {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}

.chat-header-status {
  font-size: 12px;
  color: var(--success);
}

.chat-header-status.offline { color: var(--text-4); }

.chat-header-actions {
  display: flex;
  gap: 6px;
}

.chat-action-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: all var(--transition);
}

.chat-action-btn:hover {
  color: var(--text-1);
  background: var(--bg-card-hover);
}

/* Messages area */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.messages-area::-webkit-scrollbar { width: 4px; }
.messages-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Date separator */
.date-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-separator::before,
.date-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* Message bubbles */
.message-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 75%;
}

.message-wrap.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-wrap.received {
  align-self: flex-start;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }

.msg-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
  position: relative;
  cursor: pointer;
}

.message-wrap.received .msg-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-1);
  border-bottom-left-radius: 4px;
}

.message-wrap.sent .msg-bubble {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: 10px;
  color: var(--text-3);
  padding: 0 4px;
}

.message-wrap.sent .msg-time { text-align: right; }

/* Message reactions */
.msg-reactions {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.msg-reaction {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.msg-reaction:hover { background: var(--bg-card-hover); }

.msg-reaction-count {
  font-size: 10px;
  color: var(--text-3);
}

/* Message hover actions */
.msg-hover-actions {
  display: none;
  gap: 4px;
  position: absolute;
  top: -32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 8px;
  box-shadow: var(--shadow-card);
  z-index: 10;
}

.message-wrap.received .msg-bubble:hover .msg-hover-actions,
.message-wrap.sent .msg-bubble:hover .msg-hover-actions {
  display: flex;
}

.message-wrap.received .msg-hover-actions { right: 0; }
.message-wrap.sent .msg-hover-actions { left: 0; }

.msg-hover-btn {
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  padding: 2px;
  border-radius: var(--radius-sm);
  transition: transform var(--transition);
}

.msg-hover-btn:hover { transform: scale(1.2); }

/* Reply preview */
.reply-preview {
  background: var(--bg-2);
  border-left: 3px solid var(--primary);
  padding: 6px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 4px;
  cursor: pointer;
}

/* Typing indicator */
.typing-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.typing-indicator.visible { display: flex; }

.typing-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.typing-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 18px 18px 18px 4px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--text-4);
  border-radius: 50%;
  animation: typing-bounce 1.2s ease infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ─── Message input bar ───────────────────────────────────────── */
.chat-input-bar {
  padding: 10px 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  flex-shrink: 0;
}

.chat-attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}

.chat-attach-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-1);
}

.chat-input-wrap {
  flex: 1;
  position: relative;
}

.chat-input {
  width: 100%;
  padding: 10px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-1);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  max-height: 100px;
  overflow-y: auto;
  resize: none;
}

.chat-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.chat-input::placeholder { color: var(--text-4); }

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}

.chat-send-btn:hover {
  background: var(--primary-light);
  transform: scale(1.05);
}

.chat-send-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ─── Attach menu ─────────────────────────────────────────────── */
.attach-btn-wrap {
  position: relative;
  flex-shrink: 0;
}

.attach-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.attach-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}

.attach-menu-item:hover {
  background: var(--bg-2);
  color: var(--text-1);
}

.attach-menu-icon { font-size: 18px; }

/* ─── Image message ───────────────────────────────────────────── */
.msg-bubble-image {
  padding: 4px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.msg-image {
  max-width: 260px;
  max-height: 300px;
  width: 100%;
  border-radius: var(--radius-lg);
  display: block;
  cursor: zoom-in;
  object-fit: cover;
}

/* ─── Image viewer overlay ────────────────────────────────────── */
.img-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.img-viewer-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  cursor: default;
}

.img-viewer-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.img-viewer-close:hover { background: rgba(255,255,255,0.25); }

/* ─── Empty chat state ────────────────────────────────────────── */
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-3);
  padding: 32px;
}

.chat-empty-icon {
  font-size: 52px;
  opacity: 0.6;
}

.chat-empty-title {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-2);
}

.chat-empty-sub {
  font-size: 13px;
  color: var(--text-4);
  text-align: center;
  max-width: 260px;
  line-height: 1.5;
}

/* ─── New conversation modal ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open { display: flex; }

.conv-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}

.conv-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.conv-modal-title {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
}

.conv-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.user-search-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-1);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  margin-bottom: 12px;
  transition: border-color var(--transition);
}

.user-search-input:focus { border-color: var(--border-focus); }
.user-search-input::placeholder { color: var(--text-4); }

.user-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}

.user-result-item:hover { background: var(--bg-2); }

.user-result-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.user-result-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.user-result-handle {
  font-size: 12px;
  color: var(--text-4);
}

.user-result-check {
  margin-left: auto;
  color: var(--success);
  font-size: 18px;
  display: none;
}

.user-result-item.selected .user-result-check { display: block; }
.user-result-item.selected { background: rgba(249,115,22,0.08); }

.conv-modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
}

.selected-users-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  min-height: 0;
}

.selected-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--primary-glow);
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--primary-light);
  font-weight: 600;
}

.selected-user-chip button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}

/* ─── Topbar (messages page) ──────────────────────────────────── */
.msg-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 57px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  background: rgba(8, 8, 8, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

/* Logo link */
.msg-topbar .topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.msg-topbar .logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: white;
}

.msg-topbar .logo-text {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-1);
}

.msg-topbar .logo-text span { color: var(--primary); }

/* Search bar */
.msg-topbar .topbar-search {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.msg-topbar .topbar-search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-1);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.msg-topbar .topbar-search input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.msg-topbar .topbar-search input::placeholder { color: var(--text-4); }

.msg-topbar .topbar-search .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-4);
  font-size: 14px;
  pointer-events: none;
}

/* Search results dropdown */
.msg-topbar .search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
  display: none;
}

.msg-topbar .search-results.open { display: block; }

/* Search result items (partagés avec topbar-search.js) */
.msg-topbar .search-result-item {
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}
.msg-topbar .search-result-item:last-child { border-bottom: none; }
.msg-topbar .search-result-item:hover { background: var(--bg-card-hover); }

.msg-topbar .search-result-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}
.msg-topbar .search-result-meta {
  font-size: 11px;
  color: var(--text-4);
  margin-top: 1px;
}
.msg-topbar .search-result-emoji { font-size: 18px; flex-shrink: 0; }

/* Action buttons */
.msg-topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.msg-topbar .topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.msg-topbar .topbar-btn:hover {
  background: var(--bg-card);
  border-color: rgba(255,255,255,0.12);
}

/* Sur très petits écrans la topbar-search est compressée mais reste visible */
@media (max-width: 360px) {
  .msg-topbar .topbar-search { display: none; }
}

/* ─── Bottom nav (mobile) ─────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 64px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-4);
  font-size: 10px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  transition: color var(--transition);
  min-width: 52px;
}

.bottom-nav-item .nav-icon-big { font-size: 20px; line-height: 1; }
.bottom-nav-item.active { color: var(--primary); }

/* ─── Sidebar stats ──────────────────────────────────────────── */
.sidebar-stats {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  width: 100%;
}

.sidebar-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}


.sidebar-stat small {
  font-size: 10px;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ─── Reply preview bar ───────────────────────────────────────── */
.reply-preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-2);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.reply-preview-content {
  flex: 1;
  min-width: 0;
  border-left: 3px solid var(--primary);
  padding-left: 8px;
}

.reply-preview-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.reply-preview-text {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-preview-cancel {
  background: none;
  border: none;
  color: var(--text-4);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: color var(--transition);
}

.reply-preview-cancel:hover { color: var(--text-1); }

/* Quoted message inside a bubble */
.msg-reply-quote {
  background: rgba(255,255,255,0.1);
  border-left: 3px solid rgba(255,255,255,0.4);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 4px 8px;
  margin-bottom: 6px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.message-wrap.received .msg-reply-quote {
  background: var(--bg-2);
  border-left-color: var(--primary);
}

.msg-reply-quote-sender {
  font-weight: 700;
  font-size: 11px;
  opacity: 0.8;
}

.msg-reply-quote-text {
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Message reaction: my-liked state ───────────────────────── */
.msg-reaction.my-liked {
  background: var(--primary-glow);
  border-color: rgba(249,115,22,0.3);
}

/* ─── Conv header 3-dot dropdown menu ────────────────────────── */
.conv-dropdown-menu {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 500;
  min-width: 200px;
  overflow: hidden;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.conv-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-2);
  transition: background var(--transition);
}

.conv-menu-item:hover { background: var(--bg-card-hover); }

.conv-menu-item-danger { color: var(--error); }
.conv-menu-item-danger:hover { background: rgba(239,68,68,0.08); }

/* ─── Info panel ──────────────────────────────────────────────── */
.chat-info-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  animation: slideInRight 0.2s ease;
  overflow-y: auto;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.chat-info-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.chat-info-close {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.chat-info-close:hover { color: var(--text-1); }

/* ─── Trois points sur conv item ─────────────────────────────── */
.conv-item { position: relative; }

.conv-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-4);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}
.conv-item:hover .conv-menu-btn { display: flex; align-items: center; }
.conv-menu-btn:hover { color: var(--text-1); background: var(--bg-3); }

/* Dropdown conv */
.conv-dropdown-menu {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 10000;
  overflow: hidden;
  min-width: 170px;
  animation: fadeIn 0.12s ease-out;
}
.conv-dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  text-align: left;
  color: var(--text-1);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
}
.conv-dd-item:hover { background: var(--bg-2); }
.conv-dd-danger { color: var(--error); }

/* ─── Menu d'action message (long press) ─────────────────────── */
.msg-action-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  transition: background 0.2s ease;
}
.msg-action-overlay.open { background: rgba(0,0,0,0.45); }

.msg-action-menu {
  width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding-bottom: env(safe-area-inset-bottom, 12px);
  transform: translateY(100%);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
}
.msg-action-overlay.open .msg-action-menu { transform: translateY(0); }

.msg-action-reactions {
  display: flex;
  justify-content: space-around;
  padding: 16px 12px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.msg-action-emoji {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: transform 0.15s ease, background 0.15s ease;
}
.msg-action-emoji:hover, .msg-action-emoji:active {
  transform: scale(1.3);
  background: var(--bg-2);
}
.msg-action-list { padding: 6px 0 8px; }
.msg-action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  text-align: left;
  color: var(--text-1);
  font-size: 15px;
  cursor: pointer;
  transition: background var(--transition);
}
.msg-action-item:hover, .msg-action-item:active { background: var(--bg-2); }
.msg-action-danger { color: var(--error); }
.msg-action-icon { font-size: 18px; width: 24px; text-align: center; }

/* ─── Swipe indicator (flèche) ───────────────────────────────── */
.msg-bubble { transition: none; }
.message-wrap.received .msg-swipe-hint,
.message-wrap.sent .msg-swipe-hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  color: var(--text-4);
}
.message-wrap.received .msg-swipe-hint { left: -28px; }
.message-wrap.sent .msg-swipe-hint    { right: -28px; }

/* ─── Double-tap heart burst animation ───────────────────────── */
@keyframes msgHeartBurst {
  0%   { transform: translate(-50%,-50%) scale(0);   opacity: 1; }
  40%  { transform: translate(-50%,-50%) scale(1.3); opacity: 1; }
  70%  { transform: translate(-50%,-50%) scale(1.1); opacity: 0.9; }
  100% { transform: translate(-50%,-50%) scale(1.5); opacity: 0; }
}

/* ─── Search results : styles utilisateur (topbar-search.js) ─── */
.msg-topbar .search-result-user {
  gap: 10px;
  align-items: center;
}
.msg-topbar .search-result-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
  overflow: hidden;
}
.msg-topbar .search-result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.msg-topbar .search-result-user-info { flex: 1; min-width: 0; }
.msg-topbar .search-result-sub   { font-size: 11px; margin-left: 4px; color: var(--orange); }
.msg-topbar .search-result-sports { font-size: 11px; color: var(--text-4); margin-top: 1px; }
.msg-topbar .search-results-label {
  padding: 6px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.msg-topbar .search-no-result,
.msg-topbar .search-type-hint {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-4);
  text-align: center;
}

.chat-info-title {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}

.chat-info-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

/* DM profile in info panel */
.chat-info-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
}

.chat-info-profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: white;
  overflow: hidden;
  margin-bottom: 4px;
}

.chat-info-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.chat-info-profile-name {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
}

.chat-info-profile-pseudo {
  font-size: 13px;
  color: var(--text-4);
}

/* Group participants in info panel */
.chat-info-section-title {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.chat-info-participants {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-info-participant {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  transition: background var(--transition);
}

.chat-info-participant:hover { background: var(--bg-2); }

.chat-info-participant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  overflow: hidden;
  flex-shrink: 0;
}

.chat-info-participant-avatar img { width: 100%; height: 100%; object-fit: cover; }

.chat-info-participant-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.chat-info-participant-pseudo {
  font-size: 11px;
  color: var(--text-4);
}

/* Need relative positioning on chat-panel for info panel */
.chat-panel { position: relative; }

/* ─── Request banner ──────────────────────────────────────────── */
.request-banner {
  padding: 14px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.request-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  flex: 1;
}

.request-banner-icon { font-size: 18px; }

.request-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-accept-request {
  padding: 7px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-accept-request:hover { background: var(--primary-light); }

.btn-decline-request {
  padding: 7px 18px;
  background: var(--bg-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-decline-request:hover {
  background: rgba(239,68,68,0.12);
  color: var(--error);
  border-color: var(--error);
}

/* ─── Conv item: request state ────────────────────────────────── */
.conv-item-request {
  border-left: 2px solid var(--accent);
}

.request-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  background: rgba(var(--accent-rgb, 251, 191, 36), 0.15);
  color: var(--accent-light, #fbbf24);
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 600;
  margin-left: 4px;
}

/* Badge "En attente" pour l'expéditeur d'une demande */
.request-badge.pending-sent {
  background: rgba(156, 163, 175, 0.15);
  color: var(--text-4, #9ca3af);
}

/* ─── Demandes settings panel ─────────────────────────────────── */
.demandes-settings {
  padding: 10px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.demandes-settings-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.demandes-privacy-select {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-1);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.demandes-privacy-select:focus { border-color: var(--border-focus); }

/* ─── Desktop (1024px+) ───────────────────────────────────────── */
@media (min-width: 1024px) {
  .messages-page {
    padding-bottom: 0;
  }

  .msg-sidebar { display: flex; }

  .conv-list-panel {
    width: 320px;
    flex-shrink: 0;
  }

  .chat-panel {
    display: flex;
  }

  .bottom-nav {
    display: none;
  }

  .chat-back-btn {
    display: none;
  }
}

/* ─── Mobile: show chat panel over conv list ──────────────────── */
@media (max-width: 1023px) {
  .conv-list-panel {
    position: fixed;
    inset: 57px 0 0 0;
    background: var(--bg-1);
    z-index: 10;
    display: flex;
    flex-direction: column;
  }

  .conv-list-panel.hidden { display: none; }

  .chat-panel {
    position: fixed;
    inset: 57px 0 0 0;
    z-index: 20;
    background: var(--bg-1);
    display: none;
  }

  .chat-panel.active { display: flex; }
}

/* ─── Post partagé en MP ──────────────────────────────────────── */
.msg-bubble-post-share {
  padding: 0 !important;
  overflow: hidden;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  max-width: 260px;
}

/* ─── Post card dans les messages privés ────────────────────── */
.msg-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  width: 290px;
  max-width: 100%;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.msg-post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.22); }

.message-wrap.sent .msg-post-card {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.18);
}

/* header auteur */
.msg-post-card-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px 8px;
}

.msg-post-card-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.msg-post-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-post-card-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.msg-post-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-wrap.sent .msg-post-card-name { color: rgba(255,255,255,0.95); }

.msg-post-card-pseudo {
  font-size: 11px;
  color: var(--text-3);
}

.msg-post-card-date {
  font-size: 10px;
  color: var(--text-3);
}

/* sport badge */
.msg-post-card-sport {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #fff;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* contenu */
.msg-post-card-text {
  font-size: 13px;
  color: var(--text-2);
  padding: 0 12px 8px;
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.message-wrap.sent .msg-post-card-text { color: rgba(255,255,255,0.8); }

.msg-post-card-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}

/* footer engagement */
.msg-post-card-footer {
  display: flex;
  gap: 14px;
  padding: 8px 12px 10px;
  font-size: 12px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
}

.message-wrap.sent .msg-post-card-footer {
  border-top-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
}

/* (modal share-mp → voir news.css) */

/* ─── Article card dans les messages privés ─────────────────── */
.msg-article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  width: 290px;
  max-width: 100%;
  transition: box-shadow 0.15s;
  cursor: pointer;
}

.msg-article-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.22); }

.message-wrap.sent .msg-article-card {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.18);
}

/* header source */
.msg-article-source-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px 6px;
  border-bottom: 1px solid var(--border);
}

.message-wrap.sent .msg-article-source-header {
  border-bottom-color: rgba(255,255,255,0.12);
}

.msg-article-source-logo {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}

.msg-article-source-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-wrap.sent .msg-article-source-name { color: rgba(255,255,255,0.7); }

.msg-article-source-date {
  font-size: 10px;
  color: var(--text-3);
  flex-shrink: 0;
}

/* sport badge (couleur dynamique via style="background:…") */
.msg-article-sport-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #fff;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* image hero */
.msg-article-img-wrap {
  position: relative;
  height: 155px;
  overflow: hidden;
}

.msg-article-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.msg-article-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: rgba(0,0,0,0.35);
}

/* engagement (si pas d'image) */
.msg-article-engagement {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-3);
}

/* corps */
.msg-article-body { padding: 9px 12px 12px; }

.msg-article-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.message-wrap.sent .msg-article-title { color: rgba(255,255,255,0.95); }

.msg-article-summary {
  font-size: 12px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.message-wrap.sent .msg-article-summary { color: rgba(255,255,255,0.72); }

/* blurred */
.msg-article-card-blurred .msg-article-img-wrap { height: 115px; }

.msg-article-unlock-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.msg-article-unlock-btn:hover { opacity: 0.88; }

.news-sidebar-message{
  top: 0px;
  height: 100vh;
}