/* index.css */

.home-main-content {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    padding-top: 70px; /* Space for fixed header */
    max-width: 1300px;
    margin: 0 auto;
    gap: 20px;
}

/* Sidebars */
.sidebar {
    position: sticky;
    top: 70px; /* Adjust to header height */
    height: calc(100vh - 80px); /* Approx height to fill screen */
    overflow-y: auto;
    padding: 10px;
    background-color: var(--background-color);
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.left-sidebar {
    flex: 0 0 280px;
}

.right-sidebar {
    flex: 0 0 320px;
}

.sidebar-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-section h4 {
    font-size: 17px;
    color: var(--secondary-text);
    margin-bottom: 15px;
    padding: 5px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.sidebar-item:hover {
    background-color: var(--facebook-gray);
}

.sidebar-item .sidebar-icon {
    font-size: 22px;
    color: var(--facebook-blue);
    width: 28px;
    text-align: center;
}

.sidebar-profile-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.footer-links a {
    color: var(--secondary-text);
    font-size: 13px;
    text-decoration: none;
    margin-right: 5px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Main Content */
.main-feed-content {
    flex-grow: 1;
    max-width: 600px;
}

/* Stories Section */
.stories-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow-small);
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    position: relative;
}

.stories-section::-webkit-scrollbar {
    display: none;
}

.story {
    flex: 0 0 110px;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.story-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.story-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--facebook-blue);
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.story span {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-weight: 600;
    font-size: 14px;
    z-index: 2;
}

.create-story {
    background-color: var(--card-background);
    color: var(--text-color);
    text-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 15px;
}

.create-story-thumb {
    width: 100%;
    height: 70%;
    object-fit: cover;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.create-story-plus {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--facebook-blue);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    position: absolute;
    bottom: 30px;
    border: 3px solid #fff;
}

.create-story span {
    position: relative;
    bottom: auto;
    left: auto;
    color: var(--text-color);
    margin-top: 10px;
    font-weight: 500;
    font-size: 13px;
}

.scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-small);
    z-index: 10;
}

.scroll-right {
    right: 10px;
}

.scroll-left {
    left: 10px;
}

/* Create Post Section (Home & Profile) */
.create-post-section {
    padding: 15px;
}

.post-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.post-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.post-input-container input {
    flex-grow: 1;
    border: none;
    background-color: var(--facebook-gray);
    border-radius: 50px;
    padding: 10px 15px;
    font-size: 16px;
    color: var(--text-color);
    outline: none;
    cursor: pointer;
}

.post-options {
    display: flex;
    justify-content: space-around;
}

.post-options button {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--secondary-text);
    transition: background-color 0.2s ease;
}

.post-options button:hover {
    background-color: var(--facebook-gray);
}

.post-options button i {
    font-size: 20px;
}

/* Dynamic Posts */
.post {
    margin-bottom: 15px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.post-header .post-profile-pic {
    width: 48px;
    height: 48px;
}

.post-author {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color);
}

.post-time {
    font-size: 13px;
    color: var(--secondary-text);
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-options-button {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--secondary-text);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.post-options-button:hover {
    background-color: var(--facebook-gray);
}

.post-content .post-text {
    font-size: 15px;
    color: var(--text-color);
    margin-bottom: 10px;
    line-height: 1.4;
}

.post-content .post-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 10px;
}

.post-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--secondary-text);
}

.likes-count {
    display: flex;
    align-items: center;
    gap: 5px;
}

.likes-count i {
    color: var(--facebook-blue);
    font-size: 16px;
}

.comments-shares-count {
    display: flex;
    gap: 5px;
}

.post-actions {
    display: flex;
    justify-content: space-around;
    padding-top: 5px;
}

.action-btn {
    background: none;
    border: none;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--secondary-text);
    transition: background-color 0.2s ease;
}

.action-btn:hover {
    background-color: var(--facebook-gray);
}

.action-btn i {
    font-size: 18px;
}

/* Friend Requests */
.friend-request-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 5px;
}

.friend-request-item .profile-pic {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
}

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

.request-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 16px;
}

.mutual-friends {
    font-size: 14px;
    color: var(--secondary-text);
    margin-top: 2px;
}

.request-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.request-actions button {
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 14px;
}

.accept-btn {
    background-color: var(--facebook-blue);
    color: #fff;
}

.accept-btn:hover {
    background-color: #2e69ee;
}

.decline-btn {
    background-color: var(--facebook-gray);
    color: var(--text-color);
}

.decline-btn:hover {
    background-color: #e4e6eb;
}

.see-all-requests {
    display: block;
    text-align: center;
    padding: 10px;
    background-color: var(--facebook-gray);
    border-radius: 6px;
    color: var(--facebook-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: background-color 0.2s ease;
}

.see-all-requests:hover {
    background-color: #e4e6eb;
}

/* Contacts */
.contact-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.contact-item:hover {
    background-color: var(--facebook-gray);
    border-radius: 6px;
}

.contact-item .profile-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    position: relative;
}

.contact-item span {
    font-size: 15px;
    color: var(--text-color);
}

.contact-item.online .profile-pic::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: var(--online-status-dot);
    border: 2px solid #fff;
    border-radius: 50%;
}

.contact-item.away .status-time {
    font-size: 13px;
    color: var(--secondary-text);
    margin-left: auto;
    margin-right: 10px;
}

/* Community Chats & Group Info */
.community-chats .chat-item,
.group-info .group-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.community-chats .chat-item:hover,
.group-info .group-item:hover {
    background-color: var(--facebook-gray);
    border-radius: 6px;
}

.community-chats .chat-item .profile-pic,
.group-info .group-item .profile-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.community-chats .chat-item .chat-info {
    flex-grow: 1;
}

.community-chats .chat-item .chat-name,
.group-info .group-item span {
    font-weight: 500;
    color: var(--text-color);
    font-size: 15px;
}

.community-chats .chat-item .last-message {
    font-size: 13px;
    color: var(--secondary-text);
}

/* Responsive for Home Page */
@media (max-width: 1200px) {
    .home-main-content {
        padding: 15px;
    }
    .left-sidebar {
        flex: 0 0 250px;
    }
    .right-sidebar {
        flex: 0 0 280px;
    }
}

@media (max-width: 992px) {
    .left-sidebar {
        display: none;
    }
    .right-sidebar {
        flex: 0 0 280px;
    }
    .main-feed-content {
        max-width: 100%;
    }
    .home-main-content {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .right-sidebar {
        display: none;
    }
    .home-main-content {
        padding-left: 10px;
        padding-right: 10px;
    }
    .stories-section {
        padding: 5px;
        border-radius: 0;
        margin-left: -10px;
        margin-right: -10px;
    }
    .story {
        flex: 0 0 100px;
        height: 160px;
    }
    .create-post-section .post-options button {
        font-size: 13px;
        padding: 8px 10px;
    }
}

@media (max-width: 576px) {
    .home-main-content {
        padding: 5px;
        padding-top: 60px;
    }
    .stories-section {
        border-radius: 0;
        margin-left: -5px;
        margin-right: -5px;
    }
    .story {
        flex: 0 0 90px;
        height: 150px;
    }
}