/* ============================================================
   MESSAGE NOTIFICATION STYLES
   Unread badge on Chat nav tab + In-app toast notification
   ============================================================ */

/* ── Unread Badge on Chat Nav Button ────────────────────────── */

.unread-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    transform: translateX(14px);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    pointer-events: none;
    animation: badge-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

@keyframes badge-pop {
    0% { transform: translateX(14px) scale(0); }
    100% { transform: translateX(14px) scale(1); }
}

/* ── In-App Message Toast Notification ──────────────────────── */

.msg-notification-toast {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    width: calc(100% - 24px);
    max-width: 440px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
    opacity: 0;
    user-select: none;
    -webkit-user-select: none;
}

.msg-notification-toast.msg-notif-show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Avatar */
.msg-notif-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

/* Body text */
.msg-notif-body {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.msg-notif-title {
    margin: 0;
    font-size: 14px;
    color: #fff;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-notif-title strong {
    color: #a78bfa;
}

.msg-notif-preview {
    margin: 2px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Close button */
.msg-notif-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.msg-notif-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ── Unread Badge in Contact List ────────────────────────────── */

.contact-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    margin-top: 4px;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.35);
}

/* ── Desktop alignment ──────────────────────────────────────── */
@media (min-width: 768px) {
    .msg-notification-toast {
        max-width: 400px;
    }
}
