Create a professional and feature-rich social media platform inspired by Facebook, focusing on user profiles, news feeds, posts, comments, and friend interactions. The platform should be built entirely in HTML, CSS, and JavaScript, designed to be intuitive and visually appealing, and should offer essential social networking functionalities without requiring further modification.

Platform Features:
User Profile:

Design a detailed user profile page where users can:
Upload a profile picture and cover photo.
Display personal information such as name, bio, location, and contact details.
Show a timeline of user activity, including posts, shared content, and likes.
Allow users to edit their profile information.
News Feed:

Create a real-time news feed displaying posts from friends, pages, and groups the user follows.
Posts in the news feed should include text, images, videos, and shared links.
Implement an algorithm that orders posts based on user interactions (likes, comments, shares) and recency.
Include infinite scrolling for a seamless experience as users browse through posts.
Post Creation:

Allow users to create posts that can include:
Text content with a character limit.
Attachments like images, videos, or links.
Tagging friends and adding locations to posts.
A privacy setting for posts (e.g., public, friends only, private).
Implement a post button that refreshes the feed to display the newly created post at the top.
Likes, Comments, and Shares:

Add a like button for each post, allowing users to show appreciation.
Implement a comment system where users can comment on posts. Comments should support text, emojis, and the ability to reply to other comments.
Include a share button that lets users share posts to their timeline or with specific friends.
Friend System:

Design a friend request system where users can send, accept, and decline friend requests.
Create a friends list that shows all friends in alphabetical order or by mutual connections.
Allow users to search for friends by name or username, with the option to view their profile and send a friend request.
Notifications:

Implement a notifications system to inform users when:
They receive a friend request.
Someone likes or comments on their post.
They are tagged in a post or comment.
Notifications should appear as a badge icon in the top navigation bar and in a dropdown menu when clicked.
Private Messaging:

Add a real-time messaging feature allowing users to send and receive private messages with friends.
Messages should include text and emojis and show read receipts when the recipient views the message.
Design a messenger popup window that appears at the bottom of the screen for easy access during browsing.
Groups and Pages:

Allow users to create and join groups based on shared interests, hobbies, or communities.
Groups should have group posts, events, and discussion threads.
Add support for business or fan pages where users can follow updates from brands, businesses, or public figures.
Search Bar:

Include a search bar at the top of the platform for users to search for:
Friends.
Posts.
Groups.
Pages.
The search should offer real-time suggestions as the user types.
Notifications and Settings:

Create a notifications page where users can view all past notifications and customize their notification preferences.
Include a settings page for users to manage their account (e.g., password change, privacy settings, language preferences).
Responsive Design:

Ensure the platform is fully responsive, working seamlessly on desktop, tablet, and mobile devices.
On mobile, include touch-friendly features such as swipe gestures to navigate between pages.
User Authentication:

Implement a login and signup system with email and password, including form validation and error messages.
Add a password recovery option where users can reset their password via email.
Visual Design & UI:

The platform should have a modern, clean design with a focus on usability and easy navigation.
Use CSS to create an attractive layout with defined sections for the news feed, profile, friends list, and notifications.
Include light and dark themes for user preference, with a toggle in the settings.
Performance Optimization:

Optimize the platform for fast loading times, even with large numbers of posts and images in the feed.
Use efficient code and lazy loading for images and videos to improve performance.
Real-Time Updates:

Implement real-time updates for posts, notifications, and messages using JavaScript, so users don’t have to refresh the page to see new content.