/* ============================================
   FENUA CHAT - CHAT PRIVÃ‰ SPLIT-VIEW - CORRECTED
   Layout moderne 30% conversations / 70% messages
   InspirÃ© CodePen elad2412 + design Fenua
   ============================================ */

/* === CONTAINER PRINCIPAL === */
.page-chat-private {
    height: calc(100vh - 140px);
    padding: 0;
    overflow: hidden;
}

.chat-split-container {
    display: flex;
    height: 100%;
    gap: 1px;
    background: rgba(0, 188, 212, 0.1);
}

/* ============================================
   PANEL GAUCHE : CONVERSATIONS (30%)
   ============================================ */

.conversations-panel {
    width: 30%;
    min-width: 280px;
    background: var(--bg-card-dark);
    display: flex;
    flex-direction: column;
    border-radius: 12px 0 0 12px;
}

/* Header Liste */
.conversations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(0, 188, 212, 0.2);
}

.conversations-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 0;
}

.conversations-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* BOUTONS VERT - STYLE ORIGINAL RESTAURÃ‰ */
.new-conversation-btn,
.new-group-btn {
    background: #80c800 !important;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.new-group-btn {
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%) !important;
}

.new-conversation-btn svg,
.new-group-btn svg,
.new-conversation-btn img,
.new-group-btn img {
    fill: white;
    width: 18px;
    height: 18px;
}

.new-conversation-btn:hover,
.new-group-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(128, 200, 0, 0.4);
}

/* Bouton texte btn-primary (pour conversations-empty) */
button.btn-primary,
.btn-primary {
    background: #80c800 !important;
    border: none;
    border-radius: var(--radius, 8px);
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    display: inline-block;
    text-align: center;
}

button.btn-primary:hover,
.btn-primary:hover {
    background: #6ba300 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(128, 200, 0, 0.4);
}

.new-conversation-btn svg,
.new-group-btn svg,
.new-conversation-btn img,
.new-group-btn img {
    fill: white;
    width: 18px;
    height: 18px;
}

.new-conversation-btn:hover,
.new-group-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.4);
}

/* Search Bar */
.conversations-search {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(0, 188, 212, 0.1);
}

.conversations-search svg {
    color: var(--text-light);
    flex-shrink: 0;
}

.conversations-search input {
    flex: 1;
    background: rgba(0, 188, 212, 0.05);
    border: 1px solid rgba(0, 188, 212, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.conversations-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 188, 212, 0.1);
}

/* Liste Conversations */
.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.conversations-list::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-thumb {
    background: rgba(0, 188, 212, 0.3);
    border-radius: 10px;
}

/* Conversation Item */
.conversation-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
    cursor: pointer;
    transition: background 0.2s ease, border-left-color 0.2s ease; /* CORRECTION: Pas "all", seulement background et border */
    border-left: 3px solid transparent;
    position: relative;
}

.conversation-item:hover {
    background: rgba(0, 188, 212, 0.08);
}

.conversation-item.active {
    background: rgba(0, 188, 212, 0.15);
    border-left-color: var(--primary-color);
}

.conversation-item.unread {
    background: rgba(0, 188, 212, 0.05);
}

/* CORRECTION: Conversation bloquÃ©e - grisÃ©e */
.conversation-item.blocked {
    opacity: 0.4;
    filter: grayscale(100%);
}

.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    position: relative;
    overflow: visible !important; /* CORRECTION: Permet à la pastille de dépasser */
}

/* Pastille status DÉSACTIVÉE sur avatar - On utilise ::before sur .conversation-item */
.conversation-avatar::after {
    display: none !important; /* CORRECTION: Désactivé, on utilise le parent */
}

/* CORRECTION: Pastille online DÉSACTIVÉE - on utilise ::before sur .conversation-item */
.conversation-avatar.online::after {
    display: none !important; /* CORRECTION: Désactivé, on utilise le parent */
}

@keyframes pulse-online {
    0%, 100% {
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 16px rgba(16, 185, 129, 1);
        transform: scale(1.1);
    }
}

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

.conversation-info-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.conversation-pseudo {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--text-light);
}

.conversation-last-message {
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-item.unread .conversation-last-message {
    color: var(--text-dark);
    font-weight: 500;
}

.conversation-unread-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* Ã‰tat vide conversations */
.conversations-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
}

.conversations-empty svg {
    color: var(--text-light);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.conversations-empty p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* ============================================
   PANEL DROITE : MESSAGES (70%)
   ============================================ */

.messages-panel {
    flex: 1;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    border-radius: 0 12px 12px 0;
}

/* Ã‰tat vide messages */
.messages-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}

.messages-empty svg {
    color: var(--text-light);
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.messages-empty h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.messages-empty p {
    color: var(--text-light);
}

/* Conversation Active */
.messages-active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header Messages */
.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 188, 212, 0.2);
    background: rgba(0, 188, 212, 0.05);
}

.messages-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-mobile-btn {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.back-mobile-btn:hover {
    opacity: 0.8;
}

.back-mobile-btn svg {
    flex-shrink: 0;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
}

.user-info h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
	height: 12px;
}

/* CORRECTION: Pastille online dans header */
.user-info h3::before {
    content: '';
    display: none;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
    animation: pulse-online 2s infinite;
}

.user-info h3.online::before {
    display: block;
}

.user-status {
    font-size: 0.8rem;
    color: var(--text-light);
}

.user-status.online {
    color: #10b981;
    font-weight: 600;
}

.messages-header-right {
    position: relative;
}

/* Menu 3 Points */
.menu-dots-btn {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.menu-dots-btn:hover {
    background: rgba(0, 188, 212, 0.1);
}

.menu-dots-btn img {
    width: 20px;
    height: 20px;
}

/* Dropdown Menu CORRECTED - Mode nuit */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
}

body.theme-dark .dropdown-menu,
body.dark-mode .dropdown-menu {
    background: #2d2d2d !important; /* Gris foncé */
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff !important; /* Texte blanc */
}

/* CORRECTION: Dropdown items en mode nuit - texte blanc */
body.theme-dark .dropdown-menu .dropdown-item,
body.dark-mode .dropdown-menu .dropdown-item {
    color: #ffffff !important;
}

body.theme-dark .dropdown-menu .dropdown-item:hover,
body.dark-mode .dropdown-menu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-size: 0.9rem;
}

body.theme-dark .dropdown-item,
body.dark-mode .dropdown-item {
    color: white;
}

.dropdown-item:hover {
    background: rgba(0, 188, 212, 0.1);
}

body.theme-dark .dropdown-item:hover,
body.dark-mode .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-item svg {
    color: var(--text-light);
    flex-shrink: 0;
}

body.theme-dark .dropdown-item svg,
body.dark-mode .dropdown-item svg {
    color: rgba(255, 255, 255, 0.7);
}

.dropdown-item.danger {
    color: #dc2626;
}

.dropdown-item.danger:hover {
    background: rgba(220, 38, 38, 0.1);
}

.dropdown-item.danger svg {
    color: #dc2626;
}

/* Block Button Style */
.dropdown-item.block-btn {
    border-bottom: 1px solid rgba(0, 188, 212, 0.1);
}

body.theme-dark .dropdown-item.block-btn,
body.dark-mode .dropdown-item.block-btn {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dropdown-item.block-btn.blocked {
    color: #dc2626;
}

.dropdown-item.block-btn.blocked svg {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    padding: 6px;
    border-radius: 6px;
}

/* Zone Messages */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--bg-light);
}

.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(0, 188, 212, 0.3);
    border-radius: 10px;
}

/* CORRECTION: Message VaIAna NON STICKY - PREMIER MESSAGE */
.message-vaiana {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.15) 0%, rgba(0, 151, 167, 0.15) 100%);
    border: 1px solid rgba(0, 188, 212, 0.3);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    /* PAS DE POSITION STICKY */
}

.vaiana-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

.vaiana-content {
    flex: 1;
    color: var(--text-dark);
}

.vaiana-content strong {
    color: var(--primary-color);
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.25rem;
}

.vaiana-content p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    opacity: 0.9;
}

/* Messages */
#messagesList {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-bubble {
    display: flex;
    gap: 0.75rem;
    max-width: 70%;
    animation: messageSlideIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.92);
        filter: blur(4px);
    }
    70% {
        transform: translateY(-3px) scale(1.03);
        filter: blur(0);
    }
    85% {
        transform: translateY(1px) scale(0.99);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

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

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.message-bubble.sent .message-content {
    align-items: flex-end;
}

.message-bubble.received .message-content {
    align-items: flex-start;
}

.message-text {
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-bubble.sent .message-text {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.received .message-text {
    background: rgba(0, 188, 212, 0.1);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-light);
    padding: 0 0.5rem;
}

/* Input Message */
.messages-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card-dark);
    border-top: 1px solid rgba(0, 188, 212, 0.2);
    position: relative;
}

.emoji-btn {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-light);
    flex-shrink: 0;
}

.emoji-btn:hover {
    background: rgba(0, 188, 212, 0.1);
    color: var(--primary-color);
}

#messageInput {
    flex: 1;
    background: rgba(0, 188, 212, 0.05);
    border: 1px solid rgba(0, 188, 212, 0.2);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: all 0.3s ease;
}

#messageInput:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 188, 212, 0.1);
}

.send-btn {
    background: var(--primary-color);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

.send-btn svg {
    fill: white;
    width: 18px;
    height: 18px;
}

/* CORRECTION: Modal smiley qui dÃ©borde - scroll interne INLINE */
#emojiPickerPanel {
    position: absolute;
    bottom: 70px;
    left: 10px;
    background: white;
    border: 1px solid rgba(0, 188, 212, 0.2);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 10100;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 340px;
    max-height: 300px;
    overflow-y: auto;
}

body.theme-dark #emojiPickerPanel,
body.dark-mode #emojiPickerPanel {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.2);
}

#emojiPickerPanel::-webkit-scrollbar {
    width: 6px;
}

#emojiPickerPanel::-webkit-scrollbar-thumb {
    background: rgba(0, 188, 212, 0.3);
    border-radius: 10px;
}

#emojiPickerPanel button {
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
}

#emojiPickerPanel button:hover {
    background: rgba(0, 188, 212, 0.1);
}

/* ============================================
   RESPONSIVE MOBILE
   ============================================ */

@media (max-width: 768px) {
    .chat-split-container {
        position: relative;
    }
    
    .conversations-panel {
        width: 100%;
        min-width: 100%;
        border-radius: 12px;
    }
    
    .messages-panel {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 12px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 100;
    }
    
    .messages-panel.mobile-active {
        transform: translateX(0);
    }
    
    .back-mobile-btn {
        display: flex;
    }
    
    .message-bubble {
        max-width: 85%;
    }
}

@media (min-width: 1024px) {
    .conversations-panel {
        width: 25%;
        min-width: 320px;
        max-width: 400px;
    }
}

/* ============================================
   DARK/LIGHT THEME ADJUSTMENTS
   ============================================ */

body.theme-light .conversations-panel,
body.theme-light .messages-panel,
body.theme-light .messages-header {
    background: #ffffff;
}

body.theme-light .messages-container {
    background: #f5f5f5;
}

body.theme-light .conversation-item:hover {
    background: rgba(0, 188, 212, 0.05);
}

body.theme-light .conversation-item.active {
    background: rgba(0, 188, 212, 0.1);
}

body.theme-light .message-bubble.received .message-text {
    background: #ffffff;
    border: 1px solid rgba(0, 188, 212, 0.2);
}

body.theme-light #messageInput {
    background: #ffffff;
}

/* CORRECTION: Message bloquÃ© cÃ´tÃ© utilisateur bloquÃ© */
.message-blocked-notice {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 4px solid #dc2626;
    padding: 1rem 1.5rem;
    margin: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

body.theme-dark .message-blocked-notice {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2) 0%, rgba(220, 38, 38, 0.15) 100%);
}

/* CORRECTION: Input bloquÃ© */
.messages-input-wrapper.blocked {
    opacity: 0.5;
    pointer-events: none;
}

/* Messages - Classes correctes */
.message {
    display: flex;
    gap: 0.75rem;
    max-width: 70%;
    margin-bottom: 1rem;
    animation: messageSlideIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.message.message-other {
    align-self: flex-start;
}

.message .message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.message .message-bubble {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 100%;
}

.message.message-mine .message-bubble {
    align-items: flex-end;
}

.message.message-other .message-bubble {
    align-items: flex-start;
}

.message .message-bubble p {
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    margin: 0;
}

.message.message-mine .message-bubble p {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-bottom-right-radius: 4px;
}

.message.message-other .message-bubble p {
    background: rgba(0, 188, 212, 0.1);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
}

.message .message-time {
    font-size: 0.75rem;
    color: var(--text-light);
    padding: 0 0.5rem;
}

/* ============================================
   ðŸ”¥ CORRECTIONS CRITIQUES v4.8.1
   ============================================ */

/* FIX: Messages longs qui dÃ©bordent */
.message-bubble p,
.message-text,
.message-content {
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: pre-wrap !important;
    max-width: 100% !important;
    hyphens: auto;
}

/* FIX: Menu dots visible */
#menuDotsBtn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

#menuDotsBtn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#menuDotsBtn svg {
    width: 20px;
    height: 20px;
}

/* FIX: Dropdown menu */
#menuDropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 8px;
    z-index: 9999 !important;
    animation: dropdownAppear 0.2s ease-out;
}

#menuDropdown.active {
    display: block !important;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
    color: var(--text);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(0, 188, 212, 0.1);
}

.dropdown-item.danger:hover {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.dropdown-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Mode nuit dropdown */
body.dark-mode #menuDropdown,
body.theme-dark #menuDropdown {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* FIX: Animations messages SMOOTH SANS BOX-SHADOW */
@keyframes messageSlideSexy {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-3px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animation glow SMOOTH - background au lieu de box-shadow */
@keyframes messageGlowSexy {
    0%, 100% {
        background: transparent;
    }
    25% {
        background: rgba(0, 188, 212, 0.08);
    }
    50% {
        background: rgba(0, 188, 212, 0.12);
    }
    75% {
        background: rgba(0, 188, 212, 0.08);
    }
}

@keyframes messagePulseSexy {
    0% { transform: scale(1); }
    20% { transform: scale(1.02); }
    40% { transform: scale(0.99); }
    60% { transform: scale(1.01); }
    80% { transform: scale(0.995); }
    100% { transform: scale(1); }
}

/* Animation PING pour message reÃ§u */
@keyframes messagePing {
    0% {
        transform: scale(1);
        background: rgba(0, 188, 212, 0.15);
    }
    50% {
        transform: scale(1.03);
        background: rgba(0, 188, 212, 0.25);
    }
    100% {
        transform: scale(1);
        background: transparent;
    }
}

.message.new-message {
    animation: messageSlideSexy 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.message.just-received {
    animation: 
        messagePing 0.6s ease-out,
        messagePulseSexy 0.8s ease-out;
}

.message.just-received .message-bubble {
    animation: messageGlowSexy 1s ease-out;
}

.message:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* FIX: Messages container smooth scroll */
.messages-container {
    scroll-behavior: smooth;
}

/* FIX: Header messages position pour dropdown */
.messages-header {
    position: relative !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.messages-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.messages-header-actions {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-left: auto !important;
    flex-shrink: 0;
}
/* ============================================
   CORRECTIONS DROPDOWN MODE NUIT + BLOCAGE
   @version 2.0
   @date 2025-11-28
   ============================================ */

/* DROPDOWN MENU - MODE NUIT */
body.theme-dark .dropdown-menu {
    background: #1e1e1e;
    border-color: #333;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

body.theme-dark .dropdown-item {
    color: #e0e0e0;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.theme-dark .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.theme-dark .dropdown-item.danger {
    color: #ef5350;
}

body.theme-dark .dropdown-item.danger:hover {
    background: rgba(239, 83, 80, 0.15);
}

/* MENU DOTS MODE NUIT - COULEUR BLANCHE */
body.theme-dark .menu-dots-btn,
body.dark-mode .menu-dots-btn,
body.theme-dark #menuDotsBtn,
body.dark-mode #menuDotsBtn {
    color: #ffffff !important; /* CORRECTION: Blanc au lieu de gris */
}

body.theme-dark .menu-dots-btn svg,
body.dark-mode .menu-dots-btn svg,
body.theme-dark #menuDotsBtn svg,
body.dark-mode #menuDotsBtn svg {
    color: #ffffff !important; /* CORRECTION: Blanc au lieu de gris */
    fill: #ffffff !important; /* CORRECTION: Force le fill blanc */
}

body.theme-dark .menu-dots-btn:hover,
body.dark-mode .menu-dots-btn:hover,
body.theme-dark #menuDotsBtn:hover,
body.dark-mode #menuDotsBtn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
}

body.theme-dark .menu-dots-btn:hover svg,
body.dark-mode .menu-dots-btn:hover svg,
body.theme-dark #menuDotsBtn:hover svg,
body.dark-mode #menuDotsBtn:hover svg {
    color: #ffffff !important;
    fill: #ffffff !important;
}

/* MESSAGE BLOCAGE STYLE VAIANA */
.message-blocked-notice {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 4px solid #dc2626;
    padding: 1rem 1.5rem;
    margin: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: fadeInScale 0.3s ease;
}

body.theme-dark .message-blocked-notice {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2) 0%, rgba(185, 28, 28, 0.2) 100%);
    border-left-color: #ef5350;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* MODAL SIGNALEMENT - MODE NUIT */
body.theme-dark .report-modal {
    background: #1e1e1e !important;
    color: #e0e0e0 !important;
}

body.theme-dark .report-modal h3 {
    color: #ef5350 !important;
}

body.theme-dark .report-modal p {
    color: #b0b0b0 !important;
}

body.theme-dark .report-modal label {
    color: #e0e0e0 !important;
}

body.theme-dark .report-modal select,
body.theme-dark .report-modal textarea {
    background: #2a2a2a !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}

body.theme-dark .btn-cancel {
    background: #2a2a2a !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}

body.theme-dark .btn-cancel:hover {
    background: #333 !important;
}

body.theme-dark .btn-close-modal {
    color: #999 !important;
}

body.theme-dark .btn-close-modal:hover {
    color: #e0e0e0 !important;
}

/* CONVERSATION BLOQUÃ‰E - VISUAL */
.conversation-item.blocked {
    opacity: 0.5;
    filter: grayscale(100%);
    pointer-events: auto;
}

.conversation-item.blocked:hover {
    opacity: 0.6;
}

/* INPUT DÃ‰SACTIVÃ‰ QUAND BLOQUÃ‰ */
.messages-input-wrapper.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ICÃ”NE CADENAS - RESPONSIVE */
.dropdown-item svg {
    width: 18px;
    height: 18px;
}

/* TOAST ERREUR SERVEUR */
body.theme-dark .toast-error {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* AMÃ‰LIORATION MODAL OVERLAY */
.modal-overlay {
    backdrop-filter: blur(4px);
}

body.theme-dark .modal-overlay {
    background: rgba(0, 0, 0, 0.8) !important;
}
/**
 * ANIMATIONS MESSAGES - FENUA CHAT
 * Animation slide-in inspirÃ©e de https://codepen.io/Alca/pen/oyOyVb
 */

/* Animation slide-in pour nouveaux messages */
@keyframes slideInMessage {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateY(-2px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Appliquer l'animation aux nouveaux messages */
.message.message-new {
    animation: slideInMessage 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animation plus rapide pour messages propres */
.message.message-mine.message-new {
    animation: slideInMessage 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Effet de pulsation lÃ©gÃ¨re sur rÃ©ception */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 188, 212, 0);
    }
    50% {
        box-shadow: 0 0 20px 0 rgba(0, 188, 212, 0.3);
    }
}

.message-other.message-new .message-bubble {
    animation: pulseGlow 1s ease-in-out;
}

/* Animation de typing indicator */
@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00bcd4;
    animation: typingDot 1.4s infinite;
}

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

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

/* Smooth scroll pour nouveaux messages */
#messagesContainer {
    scroll-behavior: smooth;
}

/* Animation conversation item au hover */
.conversation-item {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.conversation-item:hover {
    transform: translateX(5px);
    background: rgba(0, 188, 212, 0.05);
}

/* Animation badge unread */
@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.unread-badge {
    animation: badgePulse 2s infinite;
}

/* Animation conversation-preview fade-in */
.conversation-preview {
    transition: opacity 0.3s ease;
}

.conversation-item:hover .conversation-preview {
    opacity: 0.8;
}
/**
 * FENUA CHAT - ANIMATIONS MESSAGES v2.0
 * Animations fluides pour nouveaux messages sans refresh visible
 * 
 * @version 2.0.0
 * @date 2025-12-10
 */

/* Animation fade-in slide-up pour nouveaux messages */
@keyframes message-fade-in {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateY(-2px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Nouveau message - apparition fluide */
.message-item.new-message {
    animation: message-fade-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animation pulse pour message juste reÃ§u */
@keyframes message-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 188, 212, 0);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(0, 188, 212, 0.1);
    }
}

.message-item.just-received {
    animation: message-pulse 0.8s ease-out;
}

/* Optimisation: Pas de transition pendant scroll */
.chatbox.scrolling .message-item {
    transition: none !important;
}

/* Indicateur "En train d'Ã©crire" */
@keyframes typing-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(0, 188, 212, 0.08);
    border-radius: 12px;
    font-size: 14px;
    color: #00bcd4;
    margin: 4px 0;
    animation: message-fade-in 0.3s ease-out;
}

.typing-indicator .dots::after {
    content: '.';
    animation: typing-dots 1.4s infinite;
}

/* Smooth scroll dans chatbox */
.chatbox {
    scroll-behavior: smooth;
}

/* Performance: GPU acceleration */
.message-item {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* DÃ©sactiver animations si prÃ©fÃ©rence utilisateur */
@media (prefers-reduced-motion: reduce) {
    .message-item.new-message,
    .message-item.just-received {
        animation: none !important;
    }
    
    .chatbox {
        scroll-behavior: auto;
    }
}
/* ============================================
   FENUA CHAT - NOUVEAU MESSAGE
   Page recherche utilisateurs
   ============================================ */

.page-new-message {
    height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* === HEADER === */
.new-message-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1rem;
    background: var(--bg-card-dark);
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid rgba(0, 188, 212, 0.2);
}

.new-message-header .back-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.new-message-header .back-btn:hover {
    background: rgba(0, 188, 212, 0.1);
}

.new-message-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 0;
}

/* === SEARCH CONTAINER === */
.search-users-container {
    padding: 1.5rem 1rem;
    background: var(--bg-card-dark);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 188, 212, 0.05);
    border: 2px solid rgba(0, 188, 212, 0.2);
    border-radius: 12px;
    padding: 0 1rem;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-color);
    background: rgba(0, 188, 212, 0.1);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

.search-input-wrapper svg {
    color: var(--text-light);
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.search-input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    padding: 1rem 0;
    color: var(--text-dark);
    font-size: 1rem;
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: var(--text-light);
}

.clear-btn {
    background: rgba(0, 188, 212, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.clear-btn:hover {
    background: rgba(0, 188, 212, 0.2);
    transform: scale(1.1);
}

.clear-btn svg {
    color: var(--text-light);
    margin: 0;
}

/* Helper Text */
.search-helper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 188, 212, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: 8px;
}

.search-helper svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.search-helper span {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* === RESULTS CONTAINER === */
.search-results {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-light);
    padding: 1.5rem 1rem;
}

.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(0, 188, 212, 0.3);
    border-radius: 10px;
}

/* Ã‰tat vide */
.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
}

.search-empty svg {
    color: var(--text-light);
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.search-empty h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.search-empty p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Loading */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0, 188, 212, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.search-loading p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Aucun rÃ©sultat */
.search-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
}

.search-no-results svg {
    color: var(--text-light);
    opacity: 0.5;
    margin-bottom: 1.5rem;
}

.search-no-results h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.search-no-results p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* === RESULTS LIST === */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* User Card */
.user-result-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg-card-dark);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.user-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 188, 212, 0.3);
}

.user-result-card.has-conversation {
    background: rgba(0, 188, 212, 0.05);
}

.user-result-card.is-blocked {
    opacity: 0.5;
    cursor: not-allowed;
}

.user-result-card.is-blocked:hover {
    transform: none;
    box-shadow: none;
}

/* Avatar */
.user-result-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.3rem;
    flex-shrink: 0;
    position: relative;
    margin-right: 1rem;
}

.user-result-avatar.online::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 3px solid var(--bg-card-dark);
    border-radius: 50%;
}

/* Info */
.user-result-info {
    flex: 1;
    min-width: 0;
}

.user-result-pseudo {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.user-result-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.user-result-id,
.user-result-mobile {
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.user-result-id svg,
.user-result-mobile svg {
    width: 14px;
    height: 14px;
}

/* Badges */
.user-result-badges {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.badge svg {
    width: 14px;
    height: 14px;
}

.badge-conversation {
    background: rgba(0, 188, 212, 0.1);
    color: var(--primary-color);
}

.badge-blocked {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.badge-online {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .new-message-header {
        padding: 1rem;
    }
    
    .search-users-container {
        padding: 1rem;
    }
    
    .search-results {
        padding: 1rem;
    }
    
    .user-result-avatar {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }
    
    .user-result-pseudo {
        font-size: 1rem;
    }
    
    .user-result-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* === DARK/LIGHT THEME === */
body.theme-light .new-message-header,
body.theme-light .search-users-container,
body.theme-light .user-result-card {
    background: #ffffff;
}

body.theme-light .search-results {
    background: #f5f5f5;
}

body.theme-light .search-input-wrapper {
    background: #f5f5f5;
}

body.theme-light .search-input-wrapper:focus-within {
    background: #ffffff;
}
/* ============================================
   CORRECTIF THÃˆME NUIT - CHAT PRIVÃ‰
   Tous les Ã©lÃ©ments gris passent en mode nuit
   @version 1.0
   @date 2025-12-11
   ============================================ */

/* === CONVERSATIONS PANEL === */
body.theme-dark .conversations-panel,
body.dark-mode .conversations-panel {
    background: #1a1a1a !important;
}

body.theme-dark .conversations-header,
body.dark-mode .conversations-header {
    background: #1a1a1a !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

body.theme-dark .conversations-header h2,
body.dark-mode .conversations-header h2 {
    color: #ffffff !important;
}

body.theme-dark .conversations-search,
body.dark-mode .conversations-search {
    background: #1a1a1a !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

body.theme-dark .conversations-search input,
body.dark-mode .conversations-search input {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

body.theme-dark .conversations-search input::placeholder,
body.dark-mode .conversations-search input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

body.theme-dark .conversations-search svg,
body.dark-mode .conversations-search svg {
    color: rgba(255, 255, 255, 0.5) !important;
}

body.theme-dark .conversation-item,
body.dark-mode .conversation-item {
    color: #ffffff !important;
}

body.theme-dark .conversation-item:hover,
body.dark-mode .conversation-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

body.theme-dark .conversation-item.active,
body.dark-mode .conversation-item.active {
    background: rgba(0, 188, 212, 0.2) !important;
}

body.theme-dark .conversation-pseudo,
body.dark-mode .conversation-pseudo {
    color: #ffffff !important;
    font-weight: 700 !important; /* CORRECTION: Plus gras pour meilleure visibilité */
}

body.theme-dark .conversation-last-message,
body.dark-mode .conversation-last-message {
    color: rgba(255, 255, 255, 0.6) !important;
}

body.theme-dark .conversation-time,
body.dark-mode .conversation-time {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* CORRECTION: Puce border mode nuit sur ::before */
body.theme-dark .conversation-item::before,
body.dark-mode .conversation-item::before {
    border-color: #2d2d2d !important; /* Bordure adaptée au fond gris foncé */
}

/* CORRECTION: Puce online bien visible en mode nuit - 10PX sur ::before */
body.theme-dark .conversation-item.online::before,
body.dark-mode .conversation-item.online::before {
    background: #10b981 !important;
    border-color: #2d2d2d !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 1) !important; /* CORRECTION: Glow fort */
    width: 10px !important; /* CORRECTION: Taille cohérente */
    height: 10px !important; /* CORRECTION: Taille cohérente */
}

/* CORRECTION: Supprimer effet survol sur pseudo */
.conversation-pseudo {
    transition: none !important;
}

.conversation-item {
    transition: background 0.2s ease !important; /* Seulement le background, pas les enfants */
}

body.theme-dark .conversation-item:hover .conversation-pseudo,
body.dark-mode .conversation-item:hover .conversation-pseudo {
    color: #ffffff !important; /* Reste blanc même au survol */
    opacity: 1 !important;
}


/* === MESSAGES PANEL === */
body.theme-dark .messages-panel,
body.dark-mode .messages-panel {
    background: #1e1e1e !important;
}

body.theme-dark .messages-header,
body.dark-mode .messages-header {
    background: rgba(0, 188, 212, 0.1) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

body.theme-dark .user-info h3,
body.dark-mode .user-info h3 {
    color: #ffffff !important;
}

body.theme-dark .user-status,
body.dark-mode .user-status {
    color: rgba(255, 255, 255, 0.6) !important;
}

body.theme-dark .messages-container,
body.dark-mode .messages-container {
    background: #0f0f0f !important;
}

body.theme-dark .message-vaiana,
body.dark-mode .message-vaiana {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.2) 0%, rgba(0, 151, 167, 0.2) 100%) !important;
    border-color: rgba(0, 188, 212, 0.4) !important;
}

body.theme-dark .vaiana-content,
body.dark-mode .vaiana-content {
    color: #ffffff !important;
}

body.theme-dark .vaiana-content p,
body.dark-mode .vaiana-content p {
    color: rgba(255, 255, 255, 0.9) !important;
}

body.theme-dark .message-bubble.received .message-text,
body.dark-mode .message-bubble.received .message-text,
body.theme-dark .message.message-other .message-bubble p,
body.dark-mode .message.message-other .message-bubble p {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

body.theme-dark .message-time,
body.dark-mode .message-time {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* === INPUT ZONE === */
body.theme-dark .messages-input-wrapper,
body.dark-mode .messages-input-wrapper {
    background: #1a1a1a !important;
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

body.theme-dark #messageInput,
body.dark-mode #messageInput {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

body.theme-dark #messageInput::placeholder,
body.dark-mode #messageInput::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

body.theme-dark .emoji-btn,
body.dark-mode .emoji-btn {
    color: rgba(255, 255, 255, 0.6) !important;
}

body.theme-dark .emoji-btn:hover,
body.dark-mode .emoji-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #00bcd4 !important;
}

/* === MESSAGES EMPTY === */
body.theme-dark .messages-empty,
body.dark-mode .messages-empty {
    background: #1e1e1e !important;
}

body.theme-dark .messages-empty h3,
body.dark-mode .messages-empty h3 {
    color: #ffffff !important;
}

body.theme-dark .messages-empty p,
body.dark-mode .messages-empty p {
    color: rgba(255, 255, 255, 0.6) !important;
}

body.theme-dark .messages-empty svg,
body.dark-mode .messages-empty svg {
    color: rgba(255, 255, 255, 0.3) !important;
}

/* === BACK BUTTON MOBILE === */
body.theme-dark .back-mobile-btn,
body.dark-mode .back-mobile-btn {
    color: #00bcd4 !important;
}

/* === CONVERSATIONS EMPTY === */
body.theme-dark .conversations-empty,
body.dark-mode .conversations-empty {
    color: rgba(255, 255, 255, 0.6) !important;
}

body.theme-dark .conversations-empty svg,
body.dark-mode .conversations-empty svg {
    color: rgba(255, 255, 255, 0.3) !important;
}
/**
 * FENUA CHAT - CORRECTIFS CRITIQUES v3.1
 * 
 * CORRECTIONS:
 * 1. Messages longs qui dÃ©passent â†’ word-break
 * 2. Menu dots disparu â†’ RestaurÃ©
 * 3. Animations sexy pour nouveaux messages
 */

/* ===== CORRECTION 1: MESSAGES LONGS ===== */

.message-content {
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    white-space: pre-wrap !important;
    hyphens: auto;
}

.message-item {
    max-width: 70% !important;
}

.message-item.sent {
    margin-left: auto;
    margin-right: 0;
}

.message-item.received {
    margin-left: 0;
    margin-right: auto;
}

/* ===== CORRECTION 2: MENU DOTS VISIBLE ===== */

#menuDotsBtn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

#menuDotsBtn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#menuDotsBtn svg {
    width: 20px;
    height: 20px;
    color: currentColor;
}

/* Header doit contenir le menu */
.messages-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    gap: 12px;
}

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

.messages-header-actions {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

/* ===== CORRECTION 3: ANIMATIONS SEXY ===== */

/* Animation slide-in amÃ©liorÃ©e */
@keyframes message-slide-sexy {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
        filter: blur(4px);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.02);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Glow effet pour message reÃ§u */
@keyframes message-glow-sexy {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 188, 212, 0);
    }
    25% {
        box-shadow: 0 0 20px 8px rgba(0, 188, 212, 0.3);
    }
    50% {
        box-shadow: 0 0 30px 12px rgba(0, 188, 212, 0.2);
    }
    75% {
        box-shadow: 0 0 20px 8px rgba(0, 188, 212, 0.1);
    }
}

/* Pulse subtil pour nouveau message */
@keyframes message-pulse-sexy {
    0% {
        transform: scale(1);
    }
    20% {
        transform: scale(1.03);
    }
    40% {
        transform: scale(0.98);
    }
    60% {
        transform: scale(1.01);
    }
    80% {
        transform: scale(0.99);
    }
    100% {
        transform: scale(1);
    }
}

/* Appliquer animations */
.message-item.new-message {
    animation: message-slide-sexy 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.message-item.just-received {
    animation: 
        message-glow-sexy 1.2s ease-out,
        message-pulse-sexy 0.8s ease-out;
}

/* Son visuel lors rÃ©ception */
.message-item.just-received::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(0, 188, 212, 0.2) 0%, transparent 70%);
    animation: ripple-sexy 0.8s ease-out;
    pointer-events: none;
    z-index: -1;
}

@keyframes ripple-sexy {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* AmÃ©lioration visuelle messages */
.message-item {
    position: relative;
    transition: transform 0.2s ease;
}

.message-item:hover {
    transform: translateY(-2px);
}

/* Smooth entrance pour chatbox */
.chatbox {
    scroll-behavior: smooth;
}

/* Highlight temporaire */
.message-item.highlight {
    background: rgba(0, 188, 212, 0.1) !important;
    transition: background 0.3s ease;
}

/* ===== CORRECTIONS DROPDOWN MENU ===== */

#menuDropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 8px;
    z-index: 1000;
    animation: dropdown-appear 0.2s ease-out;
}

#menuDropdown.active {
    display: block !important;
}

@keyframes dropdown-appear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
    color: var(--text);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(0, 188, 212, 0.1);
}

.dropdown-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Mode nuit */
body.dark-mode #menuDropdown {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .dropdown-item {
    color: #e0e0e0;
}

body.dark-mode .dropdown-item:hover {
    background: rgba(0, 188, 212, 0.15);
}
/**
 * FENUA CHAT v5.0 - ANIMATIONS Ã‰PURÃ‰ES + STATUT CLIGNOTANT
 * CSS optimisÃ© pour fluiditÃ© maximale
 * @date 2025-12-10
 */

/* ========================================
   1. STATUT EN LIGNE CLIGNOTANT
   ======================================== */

@keyframes statusBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.status-blink {
    animation: statusBlink 1.5s ease-in-out infinite !important;
    color: #10b981 !important;
    font-weight: 600 !important;
}

.status-static {
    animation: none !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
}

/* Pastille verte aussi clignotante */
.conversation-avatar.online::after {
    animation: statusBlink 1.5s ease-in-out infinite !important;
}

/* ========================================
   2. ANIMATIONS MESSAGES Ã‰PURÃ‰ES
   ======================================== */

/* Animation fade simple (plus de box-shadow lourd) */
@keyframes messageFadeSimple {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-item.new-message {
    animation: messageFadeSimple 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Ping lÃ©ger instantanÃ© */
@keyframes messagePingLight {
    0%, 100% {
        background: transparent;
    }
    50% {
        background: rgba(0, 188, 212, 0.08);
    }
}

.message-ping {
    animation: messagePingLight 0.4s ease-out !important;
}

/* Supprimer anciennes animations lourdes */
@keyframes messageGlowSexy,
@keyframes message-glow-sexy,
@keyframes message-slide-sexy,
@keyframes message-pulse-sexy {
    /* DÃ©sactivÃ©es */
}

/* ========================================
   3. MENU DOTS POSITION FIXE
   ======================================== */

.menu-dots-btn,
#menuDotsBtn {
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-left: 0 !important;
    z-index: 100 !important;
}

.dropdown-menu,
#dropdownMenu {
    position: absolute !important;
    right: 0 !important;
    top: calc(100% + 5px) !important;
    left: auto !important;
    z-index: 1000 !important;
}

/* Header doit Ãªtre relative pour positionnement */
.messages-header {
    position: relative !important;
}

/* ========================================
   4. CONVERSATIONS Ã‰PURÃ‰ES
   ======================================== */

.conversation-item {
    transition: background 0.2s ease, transform 0.1s ease !important;
}

.conversation-item:hover {
    background: rgba(0, 188, 212, 0.05) !important;
    transform: translateX(2px) !important;
}

.conversation-item:active {
    transform: scale(0.99) !important;
}

/* Animation ping conversation */
@keyframes conversationPingLight {
    0%, 100% {
        background: transparent;
    }
    50% {
        background: rgba(0, 188, 212, 0.12);
    }
}

.conversation-ping {
    animation: conversationPingLight 0.5s ease-out !important;
}

/* ========================================
   5. BADGE NOTIFICATIONS ANIMÃ‰
   ======================================== */

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.notification-badge {
    animation: badgePulse 1s ease-in-out infinite !important;
}

/* Cloche animÃ©e */
@keyframes bellRing {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30% {
        transform: rotate(15deg);
    }
    20%, 40% {
        transform: rotate(-15deg);
    }
    50% {
        transform: rotate(10deg);
    }
    60% {
        transform: rotate(-10deg);
    }
    70% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-5deg);
    }
    90% {
        transform: rotate(0deg);
    }
}

.notification-bell-container.has-notifications .notification-bell-icon {
    animation: bellRing 2s ease-in-out infinite !important;
}

/* ========================================
   6. TOAST AMÃ‰LIORÃ‰S
   ======================================== */

.toast-notification {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.toast-notification.toast-clickable {
    cursor: pointer !important;
    border-left: 4px solid #00bcd4 !important;
}

.toast-notification.toast-clickable:hover {
    transform: translateX(-5px) !important;
    box-shadow: 0 4px 20px rgba(0, 188, 212, 0.3) !important;
}

/* ========================================
   7. OPTIMISATIONS PERFORMANCE
   ======================================== */

/* GPU acceleration */
.message-item,
.conversation-item,
.toast-notification {
    will-change: transform, opacity !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
}

/* Smooth scroll */
#messagesContainer {
    scroll-behavior: smooth !important;
}

/* RÃ©duire repaints */
.message-item img,
.conversation-avatar {
    content-visibility: auto !important;
}

/* ========================================
   8. RESPONSIVE OPTIMISÃ‰
   ======================================== */

@media (max-width: 768px) {
    .menu-dots-btn,
    #menuDotsBtn {
        right: 10px !important;
    }
    
    .dropdown-menu,
    #dropdownMenu {
        right: -10px !important;
        min-width: 200px !important;
    }
}

/* ========================================
   9. DARK MODE COMPATIBLE
   ======================================== */

body.dark-theme .status-blink {
    color: #10b981 !important;
}

body.dark-theme .status-static {
    color: #9ca3af !important;
}

/* ========================================
   10. ACCESSIBILITÃ‰
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .status-blink {
        animation: none !important;
    }
}

/* ========================================
   11. DEBUG HELPERS
   ======================================== */

.debug-patch-v5 {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    z-index: 99999;
    pointer-events: none;
    animation: badgePulse 2s ease-in-out infinite;
}
/**
 * FENUA CHAT v5.0 - ANIMATIONS SAFE (NO LAYOUT OVERRIDE)
 * UNIQUEMENT animations pures - AUCUN impact sur structure CSS
 * @date 2025-12-11
 */

/* ========================================
   STATUT EN LIGNE CLIGNOTANT UNIQUEMENT
   ======================================== */

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Classe appliquÃ©e par JS uniquement */
.messages-header-status.status-blink {
    animation: statusBlink 1.5s ease-in-out infinite;
}

/* Pas de clignotement si hors ligne */
.messages-header-status.status-static {
    animation: none;
}

/* ========================================
   PING LÃ‰GER MESSAGES (optionnel)
   ======================================== */

@keyframes messagePingLight {
    0%, 100% { 
        background-color: transparent; 
    }
    50% { 
        background-color: rgba(0, 188, 212, 0.05); 
    }
}

/* Classe appliquÃ©e par JS sur nouveau message */
.message-ping {
    animation: messagePingLight 0.4s ease-out;
}

/* ========================================
   BADGE NOTIFICATIONS PULSE (optionnel)
   ======================================== */

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-badge {
    animation: badgePulse 1.5s ease-in-out infinite;
}

/* ========================================
   ACCESSIBILITÃ‰
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .status-blink,
    .message-ping,
    .notification-badge {
        animation: none !important;
    }
}

/* ========================================
   DARK MODE
   ======================================== */

body.dark-theme .message-ping {
    /* Couleur adaptÃ©e dark mode */
}

/* FIN - AUCUN AUTRE CSS */
/**
 * FENUA CHAT v5.0 - CORRECTIFS MINIMAUX ULTRA-SAFE
 * UNIQUEMENT corrections bugs - AUCUN override layout
 * @date 2025-12-11
 */

/* ========================================
   FIX 1: MESSAGES AFFICHENT "a" â†’ Contenu visible
   ======================================== */

.message-content {
    display: block !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: pre-wrap !important;
    max-width: 100% !important;
}

/* S'assurer que le texte est visible */
.message-bubble {
    display: block !important;
}

.message-item {
    display: block !important;
}

/* ========================================
   FIX 2: INFOBULLES CONVERSATIONS JOLIES
   ======================================== */

.conversation-item {
    position: relative !important;
    /* CORRECTION: Pas d'overflow pour permettre à la pastille de dépasser */
}

/* PASTILLE STATUS sur ::before - PAR-DESSUS l'avatar ! */
.conversation-item::before {
    content: '';
    position: absolute;
    left: 48px; /* CORRECTION: 16px padding + 48px avatar - 10px = coin bas-droit */
    top: 48px; /* CORRECTION: 16px padding + 48px avatar - 10px = coin bas-droit */
    width: 10px;
    height: 10px;
    background: #6b7280; /* Gris par défaut (hors ligne) */
    border: 2px solid #1a1a1a;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1000 !important; /* CORRECTION: Très élevé pour être PAR-DESSUS */
    pointer-events: none; /* CORRECTION: Ne bloque pas les clics */
}

/* Pastille VERTE pour utilisateurs ONLINE */
.conversation-item.online::before {
    background: #10b981 !important; /* Vert */
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
    animation: pulse-online 2s infinite;
}
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

.conversation-item:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ANCIENNE INFOBULLE SUPPRIMÉE - ::before utilisé pour pastille online */

/* ========================================
   FIX 3: STATUT CLIGNOTANT (JS appliquÃ©)
   ======================================== */

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.messages-header-status.status-blink {
    animation: statusBlink 1.5s ease-in-out infinite !important;
    color: #10b981 !important;
}

.messages-header-status.status-static {
    animation: none !important;
    color: #6b7280 !important;
}

/* ========================================
   FIN - AUCUN AUTRE CSS
   ======================================== */
/**
 * FENUA CHAT v5.0 - CORRECTIF CSS CHAT.HTML
 * Correction conflits CSS causÃ©s par animations-epurees
 * @date 2025-12-11
 */

/* ========================================
   FIX 1: MENU DOTS POSITION
   ======================================== */

.messages-header {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 1rem !important;
}

.messages-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    flex: 1 !important;
}

.messages-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    position: relative !important;
}

.menu-dots-btn,
#menuDotsBtn {
    position: relative !important;
    right: 15px !important;
    top: auto !important;
    transform: none !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
}

.menu-dots-btn:hover,
#menuDotsBtn:hover {
    background: rgba(0, 188, 212, 0.1) !important;
}

.dropdown-menu,
#dropdownMenu {
    position: absolute !important;
    right: 0 !important;
    top: calc(100% + 10px) !important;
    left: auto !important;
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    min-width: 220px !important;
    z-index: 1000 !important;
    padding: 0.5rem 0 !important;
}

/* CORRECTION MODE NUIT - Fond gris foncé + texte blanc */
body.theme-dark .dropdown-menu,
body.dark-mode .dropdown-menu,
body.theme-dark #dropdownMenu,
body.dark-mode #dropdownMenu {
    background: #2d2d2d !important; /* CORRECTION: Gris foncé */
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important; /* CORRECTION: Texte blanc */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6) !important;
}

/* Items du dropdown en mode nuit */
body.theme-dark .dropdown-menu .dropdown-item,
body.dark-mode .dropdown-menu .dropdown-item,
body.theme-dark #dropdownMenu .dropdown-item,
body.dark-mode #dropdownMenu .dropdown-item {
    color: #ffffff !important;
}

body.theme-dark .dropdown-menu .dropdown-item:hover,
body.dark-mode .dropdown-menu .dropdown-item:hover,
body.theme-dark #dropdownMenu .dropdown-item:hover,
body.dark-mode #dropdownMenu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* ========================================
   FIX 2: MESSAGE CONTENT VISIBLE
   ======================================== */

.message-content {
    display: block !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: pre-wrap !important;
    max-width: 100% !important;
    padding: 0.75rem !important;
}

.message-bubble {
    display: block !important;
    max-width: 70% !important;
    border-radius: 12px !important;
    position: relative !important;
}

.message-item {
    display: flex !important;
    margin-bottom: 0.5rem !important;
    animation: none !important; /* DÃ©sactiver animations si conflit */
}

.message-item.sent {
    justify-content: flex-end !important;
}

.message-item.sent .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

.message-item.received {
    justify-content: flex-start !important;
}

.message-item.received .message-bubble {
    background: #f1f5f9 !important;
    color: #1f2937 !important;
}

body.dark-theme .message-item.received .message-bubble {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

/* ========================================
   FIX 3: CONVERSATIONS LIST
   ======================================== */

.conversation-item {
    display: flex !important;
    align-items: center !important;
    padding: 0.75rem 1rem !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    gap: 0.75rem !important;
}

.conversation-avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    color: white !important;
    position: relative !important;
    flex-shrink: 0 !important;
    overflow: visible !important; /* CORRECTION: Pastille online visible par-dessus */
}

.conversation-info {
    flex: 1 !important;
    min-width: 0 !important;
}

.conversation-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 0.25rem !important;
}

.conversation-header h4 {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    color: #1f2937 !important;
}

body.dark-theme .conversation-header h4,
body.theme-dark .conversation-header h4,
body.dark-mode .conversation-header h4 {
    color: #ffffff !important; /* CORRECTION: Blanc pur en mode nuit */
    font-weight: 700 !important; /* Plus gras pour meilleure visibilité */
}

/* ========================================
   FIX 4: CHAT SPLIT CONTAINER
   ======================================== */

.chat-split-container {
    display: flex !important;
    height: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
}

.conversations-panel {
    width: 350px !important;
    min-width: 300px !important;
    max-width: 400px !important;
    border-right: 1px solid #e5e7eb !important;
    display: flex !important;
    flex-direction: column !important;
    background: white !important;
}

body.dark-theme .conversations-panel {
    background: #0f172a !important;
    border-right-color: #1e293b !important;
}

.messages-panel {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    background: white !important;
}

body.dark-theme .messages-panel {
    background: #0f172a !important;
}

/* ========================================
   FIX 5: MESSAGES CONTAINER
   ======================================== */

#messagesContainer {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 1rem !important;
    display: flex !important;
    flex-direction: column !important;
}

.messages-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

/* ========================================
   FIX 6: INPUT MESSAGE
   ======================================== */

.messages-input-wrapper {
    display: flex !important;
    align-items: flex-end !important;
    gap: 0.5rem !important;
    padding: 1rem !important;
    border-top: 1px solid #e5e7eb !important;
}

body.dark-theme .messages-input-wrapper {
    border-top-color: #1e293b !important;
}

#messageInput {
    flex: 1 !important;
    min-height: 40px !important;
    max-height: 120px !important;
    padding: 0.75rem !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    resize: none !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
}

body.dark-theme #messageInput {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* ========================================
   FIX 7: STATUS ANIMATION CORRECTE
   ======================================== */

.messages-header-status {
    font-size: 0.85rem !important;
    margin-top: 0.25rem !important;
}

.messages-header-status.status-blink {
    color: #10b981 !important;
    animation: statusBlink 1.5s ease-in-out infinite !important;
}

.messages-header-status.status-static {
    color: #6b7280 !important;
    animation: none !important;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ========================================
   FIX 8: RESPONSIVE MOBILE
   ======================================== */

@media (max-width: 768px) {
    .chat-split-container {
        position: relative !important;
    }
    
    .conversations-panel {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: none !important;
        z-index: 10 !important;
        transition: transform 0.3s !important;
    }
    
    .messages-panel {
        width: 100% !important;
    }
    
    .messages-panel:not(.mobile-active) {
        display: none !important;
    }
}

/* ========================================
   FIX 9: DÃ‰SACTIVER ANIMATIONS CONFLICTUELLES
   ======================================== */

/* Override animations lourdes qui cassent le layout */
.message-item.new-message {
    animation: messageFadeSimple 0.3s ease-out !important;
}

@keyframes messageFadeSimple {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pas d'animation ping par dÃ©faut */
.message-ping {
    animation: none !important;
}

/* ========================================
   FIX 10: Z-INDEX LAYERS
   ======================================== */

.dropdown-menu {
    z-index: 1000 !important;
}

.emoji-picker {
    z-index: 999 !important;
}

.modal {
    z-index: 9999 !important;
}

.toast-notification {
    z-index: 10000 !important;
}

/* ========================================
   FIX 11: SCROLLBAR
   ======================================== */

#messagesContainer::-webkit-scrollbar {
    width: 6px !important;
}

#messagesContainer::-webkit-scrollbar-track {
    background: transparent !important;
}

#messagesContainer::-webkit-scrollbar-thumb {
    background: rgba(0, 188, 212, 0.3) !important;
    border-radius: 3px !important;
}

#messagesContainer::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 188, 212, 0.5) !important;
}
