/* ==========================================================================
   BOUTON MESSAGERIE (identique à .notif-cloche__bouton, classes séparées)
   ========================================================================== */

.msg-cloche {
    position: relative;
}

.msg-cloche__bouton {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--couleur-anthracite);
    font-size: 1.05rem;
    flex-shrink: 0;
    transition: background-color 0.15s ease;
}

.msg-cloche__bouton:hover {
    background-color: rgba(38, 53, 60, 0.06);
}

[data-theme="sombre"] .msg-cloche__bouton {
    color: #f0ebe6;
}

.msg-cloche__badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background-color: var(--couleur-corail);
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--couleur-beige);
}

[data-theme="sombre"] .msg-cloche__badge {
    border-color: #171b1e;
}

.msg-cloche__badge--visible {
    display: flex;
}

/* ==========================================================================
   PANNEAU DÉROULANT
   ========================================================================== */

.msg-cloche__panneau {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    max-width: 90vw;
    background-color: #ffffff;
    border-radius: var(--rayon-carte);
    box-shadow: 0 16px 40px rgba(38, 53, 60, 0.18);
    overflow: hidden;
    z-index: 200;
}

[data-theme="sombre"] .msg-cloche__panneau {
    background-color: #232a2f;
}

.msg-cloche--ouvert .msg-cloche__panneau {
    display: block;
    animation: msg-panneau-apparition 0.15s ease;
}

@keyframes msg-panneau-apparition {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-panneau__entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(38, 53, 60, 0.08);
}

[data-theme="sombre"] .msg-panneau__entete {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.msg-panneau__titre {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--couleur-anthracite);
    text-decoration: none;
    transition: color 0.15s ease;
}

.msg-panneau__titre:hover {
    color: var(--couleur-corail);
}

[data-theme="sombre"] .msg-panneau__titre {
    color: #f0ebe6;
}

.msg-panneau__liste {
    max-height: 400px;
    overflow-y: auto;
}

.msg-panneau__vide {
    text-align: center;
    padding: 36px 20px;
    font-size: 0.85rem;
    color: rgba(38, 53, 60, 0.45);
}

[data-theme="sombre"] .msg-panneau__vide {
    color: rgba(240, 235, 230, 0.45);
}

/* ==========================================================================
   ITEM CONVERSATION
   ========================================================================== */

.msg-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.msg-item:hover {
    background-color: rgba(38, 53, 60, 0.03);
}

[data-theme="sombre"] .msg-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.msg-item--non-lu {
    background-color: rgba(255, 103, 106, 0.05);
}

[data-theme="sombre"] .msg-item--non-lu {
    background-color: rgba(255, 103, 106, 0.08);
}

.msg-item__avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--couleur-corail);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.msg-item__point-en-ligne {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #01907c;
    border: 2px solid #ffffff;
}

[data-theme="sombre"] .msg-item__point-en-ligne {
    border-color: #232a2f;
}

.msg-item__contenu {
    flex: 1;
    min-width: 0;
}

.msg-item__nom {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--couleur-anthracite);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="sombre"] .msg-item__nom {
    color: #f0ebe6;
}

.msg-item__apercu {
    font-size: 0.78rem;
    color: rgba(38, 53, 60, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="sombre"] .msg-item__apercu {
    color: rgba(240, 235, 230, 0.55);
}

.msg-item--non-lu .msg-item__apercu {
    color: var(--couleur-anthracite);
    font-weight: 600;
}

[data-theme="sombre"] .msg-item--non-lu .msg-item__apercu {
    color: #f0ebe6;
}

.msg-item__droite {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.msg-item__date {
    font-size: 0.7rem;
    color: rgba(38, 53, 60, 0.4);
}

[data-theme="sombre"] .msg-item__date {
    color: rgba(240, 235, 230, 0.4);
}

.msg-item__badge-non-lu {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background-color: var(--couleur-corail);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msg-cloche--mobile {
    display: none;
}

.msg-cloche--mobile .msg-cloche__panneau {
    right: -60px;
    width: min(340px, calc(100vw - 32px));
}

@media (max-width: 768px) {
    .msg-cloche--mobile {
        display: flex;
        align-items: center;
        margin-left: 8px;
    }
}

@media (max-width: 576px) {
    .msg-cloche__panneau {
        position: fixed;
        top: 64px;
        right: 8px;
        left: 8px;
        width: auto;
    }
}