/* --- Global Reset & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #000000; /* Dark background for Instagram feel */
    color: #ffffff; /* White text */
    display: flex; /* Use flexbox for main layout */
    min-height: 100vh; /* Full viewport height */
    overflow-x: hidden; /* Prevent horizontal scroll from layout shifts */
}

a {
    text-decoration: none;
    color: #ffffff; /* Default link color */
}

/* --- Sidebar Styles --- */
.sidebar {
    position: fixed; /* Fixed sidebar */
    top: 0;
    left: 0;
    width: 240px; /* Increased width for better text visibility */
    height: 100%;
    background-color: #000000;
    display: flex;
    flex-direction: column;
    padding: 20px 10px;
    border-right: 1px solid #262626; /* Subtle border */
    z-index: 100; /* Ensure it stays on top */
    transition: width 0.3s ease; /* Smooth transition for width change */
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Align logo to start */
    margin-bottom: 30px;
    padding: 10px 0;
    height: 92px; /* Similar height to Instagram's logo area */
}

.sidebar-logo img {
    width: 32px; /* Standard icon size */
    margin-right: 10px;
}

.sidebar-logo .logo-text {
    /* If Billabong font is not loaded, it will fall back to sans-serif */
    /* font-family: 'Billabong', cursive; */
    font-size: 28px;
    font-weight: bold;
    color: #ffffff;
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden;
    width: auto; /* Allow text to take natural width */
    opacity: 1; /* Show by default */
    transition: opacity 0.3s ease, width 0.3s ease;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Reduced gap */
    flex-grow: 1; /* Allow menu to take available space */
}

.sidebar-menu .nav-item {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between icon and text */
    padding: 12px 16px; /* Larger clickable area */
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    color: #f0f0f0; /* Lighter white for menu items */
    font-size: 16px;
    font-weight: 500;
}

.sidebar-menu .nav-item i {
    font-size: 22px; /* Larger icons */
    transition: transform 0.2s ease;
}

.sidebar-menu .nav-item:hover {
    background-color: #1a1a1a; /* Darker hover background */
    transform: translateX(5px); /* Slight slide on hover */
}

.sidebar-menu .nav-item.active {
    font-weight: bold;
    color: #ffffff; /* White for active */
}

.sidebar-menu .nav-item.active i {
    transform: scale(1.05); /* Slight scale for active icon */
}

.message-badge {
    background-color: #e02d69; /* Instagram's notification color */
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: auto; /* Push badge to the right */
    transition: opacity 0.3s ease;
}

/* For "More" item, add a subtle border-top */
.sidebar-menu .nav-item:nth-last-child(2) {
    margin-top: auto; /* Push "More" and "Also from Meta" to bottom */
    border-top: 1px solid #262626;
    padding-top: 15px;
}
.sidebar-menu .nav-item:nth-last-child(1) {
    padding-bottom: 20px;
}


/* --- Main Content Area --- */
.main-content {
    margin-left: 240px; /* Space for fixed sidebar */
    flex-grow: 1; /* Allow content to grow */
    padding: 30px;
    max-width: 935px; /* Instagram's typical content width */
    width: 100%;
    margin: 0 auto; /* Center content horizontally, but override left margin */
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease; /* Smooth transition for margin change */
}

/* Explicitly set margin-left to ensure it overrides */
body .main-content {
    margin-left: 240px;
}


/* Profile Header */
.insta-profile-header {
    margin-bottom: 40px;
}

.profile-main-section {
    display: flex;
    align-items: center;
    gap: 80px; /* Space between pic and details */
    margin-bottom: 40px;
}

.profile-pic-wrapper {
    width: 180px; /* Larger wrapper for profile pic */
    height: 180px;
    border-radius: 50%;
    padding: 4px; /* Border effect */
    background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent shrinking */
}

.profile-pic {
    width: 170px; /* Actual image size */
    height: 170px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #000; /* Inner border to match Instagram */
}

.profile-details-wrapper {
    flex-grow: 1;
}

.profile-username-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.profile-username-actions h2 {
    font-size: 28px;
    font-weight: 400; /* Lighter font weight */
    color: #ffffff;
}

.profile-action-btn {
    background-color: #262626;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.profile-action-btn:hover {
    background-color: #363636;
}

.settings-link .settings-icon { /* Target the icon inside the link */
    font-size: 24px;
    color: #f0f0f0;
    cursor: pointer;
    margin-left: 10px;
    transition: color 0.2s ease;
}

.settings-link .settings-icon:hover {
    color: #ffffff;
}

.stats {
    display: flex;
    gap: 40px; /* Increased gap */
    font-size: 16px;
    margin-bottom: 20px;
}

.stats div strong {
    font-weight: 600;
    color: #ffffff;
    margin-right: 4px;
}

.stats div span {
    color: #a8a8a8; /* Lighter gray for labels */
}



.bio {
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 8px;
}

.website-link {
    font-size: 16px;
    color: #f0f0f0; /* Link color */
    display: flex;
    align-items: center;
    gap: 8px;
}

.website-link a {
    color: #a8a8a8; /* Link text color */
    font-weight: 600;
    transition: color 0.2s ease;
}

.website-link a:hover {
    color: #ffffff;
}

.website-link i {
    color: #a8a8a8;
}

/* Highlights Section */
.highlights-section {
    display: flex;
    overflow-x: auto; /* Allow horizontal scrolling for many highlights */
    gap: 20px;
    padding-bottom: 20px; /* Space for scrollbar */
    margin-bottom: 40px;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.highlights-section::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari and Opera */
}

.highlight-item {
    text-align: center;
    flex-shrink: 0; /* Prevent items from shrinking */
    width: 80px; /* Fixed width for consistency */
}

.highlight-item img {
    width: 76px; /* Image size */
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #363636; /* Subtle border */
    transition: transform 0.2s ease;
}

.highlight-item a:hover img {
    transform: scale(1.05); /* Slight zoom on hover */
}

.highlight-item p {
    font-size: 13px;
    margin-top: 8px;
    color: #ffffff;
    font-weight: 500;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    justify-content: center; /* Center the tabs */
    border-top: 1px solid #262626;
    padding-top: 20px;
    margin-bottom: 20px;
    gap: 60px; /* Space between tabs */
}

.profile-tab-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #a8a8a8; /* Lighter text for inactive tabs */
    padding: 10px 0;
    border-top: 1px solid transparent; /* For active state underline */
    margin-top: -1px; /* Overlap border-top of parent */
    transition: color 0.2s ease, border-top-color 0.2s ease;
}

.profile-tab-item i {
    font-size: 14px; /* Smaller icons for tabs */
}

/* Active Tab (using default .active class) */
.profile-tab-item.active {
    color: #ffffff; /* White for active tab */
    border-top-color: #ffffff; /* White line for active tab */
}

.profile-tab-item:hover {
    color: #e0e0e0;
}


/* Gallery Section (Posts Content) */
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns grid */
    gap: 5px; /* Smaller gap between images */
    margin-bottom: 40px;
}

.gallery img {
    width: 100%;
    height: 300px; /* Fixed height for gallery images */
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.gallery img:hover {
    opacity: 0.8;
    transform: scale(1.01);
}

/* To simulate tab content switching without JS: */
/* By default, hide all but the active tab content */
/* .tab-content:not(.active-tab-content) {
    display: none;
} */
/* If you want to use the :target pseudo-class (requires changing href to #id)
   you can hide all and only show :target.
   However, this would mean the URL changes and browser history is affected.
   For a simple visual, keeping it visible or using the :active class is more common.
*/


/* Footer Styles */
.footer {
    padding: 30px 0;
    font-size: 12px;
    color: #a8a8a8;
    text-align: center;
    border-top: 1px solid #262626;
}

.footer-links-top {
    display: flex;
    flex-wrap: wrap; /* Allow links to wrap */
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.footer-links-top a {
    color: #a8a8a8;
    transition: color 0.2s ease;
}

.footer-links-top a:hover {
    color: #ffffff;
}

.footer-copyright {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
}


/* --- Responsive Design --- */

/* Sidebar collapse/expand behavior for larger screens (CSS only, no click toggle) */
/* This will simply make the sidebar smaller on smaller large screens */
@media (min-width: 769px) and (max-width: 1200px) {
    .sidebar {
        width: 70px; /* Smaller width when "collapsed" */
    }

    .sidebar-logo .logo-text {
        opacity: 0;
        width: 0; /* Hide text */
    }

    .sidebar-menu .nav-item {
        justify-content: center; /* Center icon when text is hidden */
        padding: 12px 0;
    }

    .sidebar-menu .nav-item .nav-text {
        display: none; /* Hide text */
    }

    .sidebar-logo img {
        margin-right: 0; /* No margin when only icon is shown */
    }

    .message-badge {
        opacity: 0; /* Hide badge when sidebar is collapsed */
    }
     .sidebar-menu .nav-item:nth-last-child(2),
     .sidebar-menu .nav-item:nth-last-child(1) {
        border-top: none; /* Remove border if sidebar collapses */
        padding-top: 12px; /* Reset padding */
    }

    .main-content {
        margin-left: 70px; /* Adjust main content margin */
    }
}


/* Tablets and smaller desktops */
@media (max-width: 1024px) {
    .main-content {
        max-width: 800px;
        padding: 20px;
    }
    .profile-main-section {
        gap: 60px;
    }
    .profile-pic-wrapper {
        width: 160px;
        height: 160px;
    }
    .profile-pic {
        width: 150px;
        height: 150px;
    }
    .profile-username-actions h2 {
        font-size: 26px;
    }
    .stats {
        gap: 30px;
    }
    .highlights-section {
        gap: 15px;
        padding-bottom: 15px;
    }
    .highlight-item img {
        width: 70px;
        height: 70px;
    }
    .gallery img {
        height: 250px; /* Adjust height for smaller screens */
    }
    .profile-tabs {
        gap: 40px;
    }
}

/* Smaller Tablets & Large Phones (e.g., landscape) */
@media (max-width: 768px) {
    body {
        flex-direction: column; /* Stack sidebar on top for small screens */
    }
    .sidebar {
        position: static; /* No longer fixed */
        width: 100%; /* Full width */
        height: auto;
        border-right: none;
        border-bottom: 1px solid #262626; /* Add bottom border */
        padding: 10px 20px;
        flex-direction: row; /* Layout items in a row */
        justify-content: space-between; /* Space out items */
        align-items: center;
    }
    /* Hide the full menu on small screens by default */
    /* You might want a hamburger menu icon to toggle this with JS, but without, it's hidden */
    .sidebar-menu {
        display: none; 
    }

    .main-content {
        margin-left: 0; /* Remove sidebar margin */
        padding: 15px;
    }
    .profile-main-section {
        flex-direction: column; /* Stack profile pic and details */
        text-align: center;
        gap: 30px;
        margin-bottom: 30px;
    }
    .profile-pic-wrapper {
        width: 140px;
        height: 140px;
    }
    .profile-pic {
        width: 130px;
        height: 130px;
    }
    .profile-details-wrapper {
        width: 100%;
    }
    .profile-username-actions {
        justify-content: center;
        flex-wrap: wrap; /* Allow buttons to wrap */
        gap: 10px;
    }
    .stats {
        justify-content: center; /* Center stats */
        gap: 20px;
    }
    .bio, .website-link {
        text-align: center;
    }
    .highlights-section {
        justify-content: flex-start; /* Align highlights to start */
        padding-left: 15px; /* Add some padding */
    }
    .gallery {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on smaller screens */
    }
    .gallery img {
        height: 200px;
    }
    .profile-tabs {
        gap: 20px;
    }
    .footer-links-top, .footer-copyright {
        flex-direction: column; /* Stack footer links */
        gap: 5px;
        text-align: center;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .sidebar {
        padding: 8px 10px;
    }
    .sidebar-logo img {
        width: 28px;
    }
    .sidebar-logo .logo-text {
        font-size: 20px;
    }
    .main-content {
        padding: 10px;
    }
    .profile-main-section {
        gap: 20px;
        margin-bottom: 20px;
    }
    .profile-pic-wrapper {
        width: 100px;
        height: 100px;
    }
    .profile-pic {
        width: 95px;
        height: 95px;
    }
    .profile-username-actions h2 {
        font-size: 22px;
    }
    .profile-action-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    .settings-icon {
        font-size: 20px;
    }
    .stats {
        font-size: 14px;
        gap: 15px;
    }
    .bio, .website-link {
        font-size: 14px;
    }
    .highlights-section {
        padding-bottom: 10px;
        gap: 10px;
    }
    .highlight-item {
        width: 70px;
    }
    .highlight-item img {
        width: 65px;
        height: 65px;
    }
    .highlight-item p {
        font-size: 11px;
    }
    .profile-tabs {
        gap: 10px;
        padding-top: 15px;
    }
    .profile-tab-item {
        font-size: 12px;
        gap: 5px;
    }
    .profile-tab-item i {
        font-size: 12px;
    }
    .gallery {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }
    .gallery img {
        height: 250px; /* Keep a decent height for single image */
    }
    .footer {
        padding: 20px 10px;
        font-size: 11px;
    }
}


/* (Existing CSS from previous response goes here) */

/* Add the new styles below the existing ones */

/* --- Home Page Specific Styles (home.html) --- */
.home-feed {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center feed content */
    max-width: 600px; /* Typical feed width */
    margin: 0 auto; /* Center the feed */
    padding-top: 20px; /* Space from top */
}

/* Stories Bar */
.stories-bar {
    display: flex;
    overflow-x: auto; /* Enable horizontal scrolling for stories */
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #262626;
    margin-bottom: 20px;
    width: 100%; /* Take full width */
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.stories-bar::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari and Opera */
}

.story-item {
    text-align: center;
    flex-shrink: 0; /* Prevent shrinking */
    cursor: pointer;
}

.story-item img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent; /* Default transparent border */
    background-image: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5); /* Instagram story gradient */
    background-origin: border-box;
    background-clip: content-box, border-box;
    transition: transform 0.2s ease;
}

.story-item img:hover {
    transform: scale(1.05);
}

.story-item p {
    font-size: 12px;
    color: #a8a8a8;
    margin-top: 5px;
    white-space: nowrap; /* Prevent name wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Add ellipsis if name is too long */
    max-width: 70px; /* Limit width */
}

/* Posts Feed */
.posts-feed {
    width: 100%;
}

.post {
    background-color: #000000; /* Post background */
    border: 1px solid #262626;
    border-radius: 8px;
    margin-bottom: 30px;
    padding-bottom: 10px; /* Space for footer details */
}

.post-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
}

.post-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.post-info {
    flex-grow: 1;
}

.post-username {
    font-weight: 600;
    color: #ffffff;
    display: block; /* Make username take full line */
    font-size: 14px;
}

.post-location {
    font-size: 12px;
    color: #a8a8a8;
}

.post-options {
    font-size: 18px;
    color: #a8a8a8;
    cursor: pointer;
}

.post-media img {
    width: 100%;
    max-height: 700px; /* Max height for media */
    object-fit: contain; /* Ensure image fits without cropping much */
    display: block;
    background-color: #1a1a1a; /* Placeholder background */
}

.post-actions {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    font-size: 24px;
    color: #f0f0f0;
}

.post-actions i {
    cursor: pointer;
    transition: color 0.2s ease;
}

.post-actions i:hover {
    color: #ffffff;
}

.post-actions .saved-icon {
    margin-left: auto; /* Push bookmark icon to the right */
}

.post-likes {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    padding: 0 16px 8px;
}

.post-likes strong {
    font-weight: 700;
}

.post-caption {
    font-size: 14px;
    color: #ffffff;
    padding: 0 16px 8px;
    line-height: 1.5;
}

.post-caption .post-username {
    display: inline; /* Keep username inline with caption */
    margin-right: 5px;
}

.post-comments {
    font-size: 13px;
    color: #a8a8a8;
    padding: 0 16px 8px;
}

.post-comments p {
    margin-bottom: 4px;
}

.post-comments .view-comments {
    color: #737373;
    cursor: pointer;
}

.post-comments .comment-username {
    font-weight: 600;
    color: #ffffff;
    margin-right: 5px;
}

.post-time {
    font-size: 10px;
    color: #737373;
    text-transform: uppercase;
    padding: 0 16px 12px;
}


/* --- Search Page Specific Styles (search.html) --- */
.search-page-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    max-width: 700px; /* Adjust width for search page content */
    margin: 0 auto;
}

.search-bar-container {
    width: 100%;
    position: relative;
    margin-bottom: 30px;
}

.search-input {
    width: 100%;
    padding: 12px 15px 12px 45px; /* Adjust padding for icon */
    border: none;
    border-radius: 10px;
    background-color: #262626;
    color: #ffffff;
    font-size: 16px;
    outline: none;
    transition: background-color 0.2s ease;
}

.search-input::placeholder {
    color: #a8a8a8;
}

.search-input:focus {
    background-color: #363636;
}

.search-bar-container .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a8a8a8;
    font-size: 18px;
}

.suggested-searches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Responsive grid */
    gap: 15px;
    width: 100%;
}

.suggested-item {
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    text-align: center;
    transition: background-color 0.2s ease;
}

.suggested-item:hover {
    background-color: #262626;
}

.suggested-item img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.suggested-item .suggested-info strong {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.suggested-item .suggested-info span {
    color: #a8a8a8;
    font-size: 12px;
}

/* --- Notifications Page Specific Styles (notifications.html) --- */
.notifications-page-content {
    padding-top: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.page-title {
    font-size: 28px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 30px;
}

.notification-group {
    margin-bottom: 30px;
}

.notification-group h2 {
    font-size: 16px;
    color: #a8a8a8;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #1a1a1a;
}
.notification-item:last-child {
    border-bottom: none; /* No border for the last item in a group */
}

.notification-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.notification-item p {
    flex-grow: 1;
    font-size: 14px;
    color: #f0f0f0;
    line-height: 1.4;
}

.notification-item p strong {
    font-weight: 600;
    color: #ffffff;
}

.notification-time {
    color: #737373;
    font-size: 12px;
    margin-left: 5px;
}

.notification-thumbnail {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.follow-back-btn {
    background-color: #0095f6; /* Instagram blue */
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.follow-back-btn:hover {
    background-color: #1877f2; /* Darker blue on hover */
}

/* Responsive adjustments for new content */
@media (max-width: 768px) {
    .home-feed, .search-page-content, .notifications-page-content {
        padding-left: 15px;
        padding-right: 15px;
    }

    .post-media img {
        max-height: 500px;
    }

    .suggested-searches-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .suggested-item img {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .home-feed, .search-page-content, .notifications-page-content {
        padding-left: 10px;
        padding-right: 10px;
    }
    .stories-bar .story-item img {
        width: 60px;
        height: 60px;
    }
    .stories-bar .story-item p {
        font-size: 11px;
    }
    .post-header {
        padding: 10px 12px;
    }
    .post-actions {
        font-size: 20px;
        padding: 10px 12px;
    }
    .post-avatar {
        width: 28px;
        height: 28px;
    }
    .post-username, .post-location, .post-likes, .post-caption, .post-comments {
        font-size: 13px;
    }
    .search-input {
        padding: 10px 15px 10px 40px;
        font-size: 14px;
    }
    .search-bar-container .search-icon {
        font-size: 16px;
    }
    .suggested-searches-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    .suggested-item img {
        width: 50px;
        height: 50px;
    }
    .notification-avatar {
        width: 38px;
        height: 38px;
    }
    .notification-item p {
        font-size: 13px;
    }
    .notification-thumbnail {
        width: 40px;
        height: 40px;
    }
    .follow-back-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* --- New Global styles for page titles and sections --- */
.page-title {
    font-size: 28px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 30px;
    text-align: center; /* Center page titles */
}


/* --- Explore Page Specific Styles (explore.html) --- */
.explore-page-content {
    padding-top: 20px;
    max-width: 935px; /* Similar to profile gallery */
    margin: 0 auto;
}
.explore-grid {
    /* Uses existing .gallery styles */
}


/* --- Reels Page Specific Styles (reels.html) --- */
.reels-page-content {
    padding-top: 20px;
    max-width: 400px; /* Reels are typically vertical and narrower */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reels-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.reel-item {
    position: relative;
    width: 100%;
    /* Aspect ratio for reels */
    padding-bottom: 177.77%; /* 9:16 aspect ratio (height / width * 100%) */
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
}

.reel-item video,
.reel-item img { /* If using image as placeholder */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.reel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 40%); /* Gradient at bottom */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
    color: #fff;
}

.reel-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reel-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.reel-user-info span {
    font-weight: 600;
}

.reel-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Align actions to the right */
    gap: 20px;
    font-size: 24px;
}

.reel-actions i {
    cursor: pointer;
    text-shadow: 0 0 5px rgba(0,0,0,0.5); /* Subtle shadow for icons */
    display: flex; /* For text next to heart/comment */
    flex-direction: column;
    align-items: center;
    font-size: 24px;
}
.reel-actions i span {
    font-size: 12px;
    margin-top: 5px;
    font-weight: normal;
}


/* --- Messages Page Specific Styles (messages.html) --- */
.messages-page-content {
    padding-top: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.message-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #262626; /* Separator for list */
}

.message-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #262626;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.message-preview:hover {
    background-color: #1a1a1a;
}

.message-preview:last-child {
    border-bottom: none;
}

.message-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message-info {
    flex-grow: 1;
}

.message-info strong {
    display: block;
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
}

.message-info p {
    color: #a8a8a8;
    font-size: 14px;
    margin-top: 4px;
}

.message-time {
    font-size: 12px;
    color: #737373;
    margin-left: 5px;
}

.message-preview.unread .message-info p {
    color: #ffffff; /* Brighter for unread */
    font-weight: 600;
}

.message-camera {
    font-size: 22px;
    color: #737373;
    cursor: pointer;
    flex-shrink: 0;
}
.message-camera:hover {
    color: #a8a8a8;
}


/* --- Create Page Specific Styles (create.html) --- */
.create-page-content {
    padding-top: 20px;
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.create-box {
    background-color: #1a1a1a;
    border: 1px dashed #363636;
    border-radius: 8px;
    padding: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 500px;
    min-height: 300px; /* Minimum height for drag area */
}

.create-box .upload-icon {
    font-size: 80px;
    color: #a8a8a8;
    margin-bottom: 20px;
}

.create-box p {
    font-size: 18px;
    color: #ffffff;
    margin-bottom: 20px;
}

.select-from-computer-btn {
    background-color: #0095f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.select-from-computer-btn:hover {
    background-color: #1877f2;
}


/* --- Dashboard Page Specific Styles (dashboard.html) --- */
.dashboard-page-content {
    padding-top: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.dashboard-section {
    margin-bottom: 40px;
}

.dashboard-section h2 {
    font-size: 22px;
    color: #ffffff;
    margin-bottom: 20px;
    border-bottom: 1px solid #262626;
    padding-bottom: 10px;
}

.insight-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.card {
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.card h3 {
    font-size: 14px;
    color: #a8a8a8;
    margin-bottom: 10px;
}

.card p {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
}

.dashboard-link {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.dashboard-link:hover {
    background-color: #262626;
}

.dashboard-link i {
    font-size: 20px;
    color: #a8a8a8;
}


/* --- More Page Specific Styles (more.html) --- */
.more-page-content {
    padding-top: 20px;
    max-width: 400px; /* Narrower for options list */
    margin: 0 auto;
}

.more-options-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #262626;
    border-bottom: 1px solid #262626;
    margin-bottom: 20px;
}

.more-option-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.more-option-item:hover {
    background-color: #1a1a1a;
}

.more-option-item i {
    font-size: 20px;
    color: #a8a8a8;
}

.more-option-item.logout-item {
    color: #0095f6; /* Blue for logout */
    font-weight: 600;
    justify-content: center; /* Center the logout text */
}
.more-option-item.logout-item:hover {
    color: #1877f2;
}

.divider {
    border: none;
    border-top: 1px solid #262626;
    margin: 10px 0;
}


/* Responsive adjustments for new content */
@media (max-width: 480px) {
    .home-feed .post-media img {
        max-height: 300px;
    }
    .reel-item {
        padding-bottom: 150%; /* Adjust aspect ratio for smaller screens if needed */
    }
    .reels-grid {
        gap: 10px;
    }
    .reel-actions {
        font-size: 20px;
        gap: 15px;
    }
    .message-avatar {
        width: 48px;
        height: 48px;
    }
    .message-info strong {
        font-size: 14px;
    }
    .message-info p {
        font-size: 13px;
    }
    .create-box {
        padding: 30px;
        min-height: 250px;
    }
    .create-box .upload-icon {
        font-size: 60px;
    }
    .create-box p {
        font-size: 16px;
    }
    .dashboard-section h2 {
        font-size: 18px;
    }
    .insight-cards {
        grid-template-columns: 1fr; /* Stack cards on mobile */
    }
    .card p {
        font-size: 20px;
    }
    .more-option-item {
        font-size: 14px;
        padding: 12px;
    }
    .more-option-item i {
        font-size: 18px;
    }
}
.reels-grid{
    display: flex;
    flex-direction: column;
    margin-left: 750px;
    gap: 20px;
    width: 100%;
}

/* (Existing CSS from previous response goes here) */

/* Add or modify the styles below the existing ones */

/* --- General Layout for Home Page (home.html) --- */
.main-content.home-layout {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding-top: 20px;
    max-width: 935px;
    margin: 0 auto;
}

/* ... (feed-column and other styles remain the same) ... */

.suggestions-column {
    width: 320px;
    flex-shrink: 0;
    padding-top: 20px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    padding-bottom: 20px; /* IMPORTANT: Add padding-bottom to ensure space for the footer below suggestions */
    display: flex; /* Make it a flex container to arrange its children vertically */
    flex-direction: column; /* Stack children (user summary, suggestions, footer) vertically */
    height: fit-content; /* Ensure it takes only the height it needs */
}

/* ... (user-profile-summary, suggestions-for-you, suggestion-item, follow-btn styles remain the same) ... */

/* Footer for the home page suggestions column */
.main-content.home-layout .footer {
    width: 100%; /* Ensure footer takes full width of its column */
    background-color: transparent; /* Remove background color from previous general footer style */
    border-top: none; /* Remove border from previous general footer style */
    padding: 20px 0; /* Add some vertical padding specific to this footer */
    box-sizing: border-box; /* Include padding in width */
    position: relative; /* Ensure it stays within its normal flow, not fixed */
    left: auto; /* Reset left property if it was set */
    bottom: auto; /* Reset bottom property if it was set */
    transform: none; /* Reset transform property if it was set */
    text-align: left; /* Align footer text to left within its column */
    font-size: 11px; /* Smaller font size for footer links in suggestions column */
    color: #737373; /* Match text color with other suggestions text */
    margin-top: auto; /* Push the footer to the bottom of the suggestions-column if content is short */
}

.main-content.home-layout .footer .footer-links-top {
    margin-bottom: 10px; /* Space between links and copyright */
}

.main-content.home-layout .footer .footer-links-top a {
    color: #737373; /* Ensure link color matches new context */
    font-size: 11px;
    margin-right: 10px;
    display: inline-block; /* Ensure links wrap correctly */
    margin-bottom: 5px; /* Space between wrapped links */
}

.main-content.home-layout .footer .footer-copyright {
    margin-top: 5px; /* Adjust spacing */
    display: block; /* Ensure it's a block element */
    font-size: 11px;
    color: #737373;
}
.main-content.home-layout .footer .footer-copyright span:first-child {
    margin-right: 10px;
}


/* Responsive adjustments for home page layout */
@media (max-width: 1000px) {
    .main-content.home-layout {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    /* ... (feed-column styles remain the same) ... */

    .suggestions-column {
        width: 100%;
        max-width: 600px;
        margin-top: 40px;
        padding-top: 0;
        position: relative; /* Remove sticky behavior when stacked */
        top: auto;
        padding-bottom: 0; /* Remove padding-bottom when stacked, as footer will be below */
    }

    /* Adjust footer styles when stacked */
    .main-content.home-layout .footer {
        padding-top: 20px; /* Add padding from suggestions content above */
        margin-top: 20px; /* Space between stacked columns */
        text-align: center; /* Center footer text when stacked */
        background-color: transparent; /* Ensure no background */
        border-top: none; /* No border */
        position: relative;
        left: auto;
        bottom: auto;
        transform: none;
    }
}
/* ... (Other responsive adjustments remain the same) ... */
/* (Existing CSS from previous response goes here) */

/* Add or modify the styles below the existing ones */

/* --- General Layout for Home Page (home.html) --- */
.main-content.home-layout { /* Changed from home-feed */
    display: flex; /* Use flexbox for feed and suggestions side by side */
    justify-content: center; /* Center the columns */
    gap: 30px; /* Space between feed and suggestions */
    padding-top: 20px;
    max-width: 935px; /* Adjust max width for overall layout */
    margin: 0 auto;
}

.feed-column {
    flex-grow: 1; /* Allow feed column to grow */
    max-width: 600px; /* Max width for the feed content */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center stories and posts within its column */
}

/* Stories Bar - keep existing styles */
.stories-bar {
    width: 100%;
    margin-bottom: 20px;
}

/* Posts Feed - keep existing styles */
.posts-feed {
    width: 100%;
}

/* --- Suggestions Column Styles (suggestions-column) --- */
.suggestions-column {
    width: 320px; /* Fixed width for the suggestions column */
    flex-shrink: 0; /* Prevent shrinking */
    padding-top: 20px; /* Align with content */
    position: sticky; /* Make it sticky as you scroll */
    top: 20px; /* Distance from top */
    align-self: flex-start; /* Align to the start of the cross-axis */
    padding-bottom: 20px; /* Padding for the footer */
    display: flex;
    flex-direction: column;
    height: fit-content; /* Adjust height to content */
}

.user-profile-summary {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.summary-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.summary-info {
    flex-grow: 1;
}

.summary-info strong {
    display: block;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
}

.summary-info span {
    color: #a8a8a8;
    font-size: 12px;
}

.switch-account-btn {
    background: none;
    border: none;
    color: #0095f6;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.switch-account-btn:hover {
    background-color: rgba(0, 149, 246, 0.1);
}

.suggestions-for-you {
    margin-bottom: 20px;
}

.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.suggestions-header span {
    color: #a8a8a8;
    font-size: 14px;
    font-weight: 600;
}

.suggestions-header a {
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.suggestions-header a:hover {
    color: #a8a8a8;
}

.suggestion-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.suggestion-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.suggestion-info {
    flex-grow: 1;
}

.suggestion-info strong {
    display: block;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
}

.suggestion-info span {
    color: #737373;
    font-size: 12px;
}

.follow-btn {
    background: none;
    border: none;
    color: #0095f6;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.follow-btn:hover {
    background-color: rgba(0, 149, 246, 0.1);
}

/* Footer for the home page suggestions column */
.main-content.home-layout .footer {
    width: 100%; /* Ensure footer takes full width of its column */
    background-color: transparent; /* Remove background color */
    border-top: none; /* Remove border */
    padding: 20px 0; /* Add some vertical padding */
    box-sizing: border-box; /* Include padding in width */
    position: relative; /* Ensure it stays within its flow */
    left: auto;
    bottom: auto;
    transform: none;
    text-align: left; /* Align footer text to left */
    font-size: 11px; /* Smaller font size for footer in suggestions */
    color: #737373;
}

.main-content.home-layout .footer .footer-links-top a {
    color: #737373;
    font-size: 11px;
    margin-right: 10px;
}

.main-content.home-layout .footer .footer-copyright {
    margin-top: 15px;
    display: block;
    font-size: 11px;
    color: #737373;
}
.main-content.home-layout .footer .footer-copyright span:first-child {
    margin-right: 10px;
}


/* Responsive adjustments for home page layout */
@media (max-width: 1000px) { /* Adjust breakpoint for suggestions column */
    .main-content.home-layout {
        flex-direction: column; /* Stack columns on smaller screens */
        align-items: center;
        gap: 0; /* Remove gap when stacked */
    }

    .feed-column {
        width: 100%;
        max-width: 600px; /* Maintain max-width for feed */
    }

    .suggestions-column {
        width: 100%;
        max-width: 600px; /* Match feed width on mobile */
        margin-top: 40px; /* Space between stacked columns */
        padding-top: 0;
        position: relative; /* Remove sticky behavior when stacked */
        top: auto;
        padding-bottom: 0;
    }

    .main-content.home-layout .footer {
        padding-top: 0;
        margin-top: 20px; /* Space above footer when stacked */
        text-align: center;
    }
}

@media (max-width: 768px) {
    /* Keep existing responsive styles for other pages */
    /* Adjust specific elements for home layout if needed */
    .stories-bar, .posts-feed {
        padding: 0 15px; /* Add horizontal padding to feed content */
        box-sizing: border-box;
    }
    .suggestions-column {
        padding: 0 15px; /* Add horizontal padding to suggestions */
        box-sizing: border-box;
    }
    .user-profile-summary, .suggestions-for-you {
        padding: 0 15px;
        box-sizing: border-box;
    }
    .main-content.home-layout .footer {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    /* Keep existing responsive styles */
    .stories-bar, .posts-feed {
        padding: 0 10px;
    }
    .suggestions-column {
        padding: 0 10px;
    }
    .user-profile-summary, .suggestions-for-you {
        padding: 0 10px;
    }
    .main-content.home-layout .footer {
        padding: 20px 10px;
    }
}
