/* Facebook-style Home Page Layout */

.facebook-layout {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    position: relative;
}

/* Top Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
}

/* Diagnostic override: ensure top-nav and profile button are above overlays */
.top-nav {
    z-index: 99999 !important;
}

.icon-btn {
    position: relative;
    z-index: 100000 !important;
    pointer-events: auto !important;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #1877f2;
    cursor: pointer;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: #f0f2f5;
    border-radius: 50px;
    padding: 8px 12px;
    width: 240px;
}

.search-icon {
    margin-right: 8px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 15px;
}

.nav-center {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex: 1;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    text-decoration: none;
    color: #65676b;
    border-bottom: 3px solid transparent;
    transition: background-color 0.2s;
    border-radius: 50%;
    background-color: #e4e6eb;
}

.nav-icon:hover {
    background-color: #f0f2f5;
    border-radius: 8px;
}

.nav-icon.active {
    color: #1877f2;
    border-bottom-color: #1877f2;
}

.nav-icon .icon {
    font-size: 24px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
    position: relative;
}

.icon-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    background-color: #e4e6eb;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    overflow: hidden;
}

.icon-btn:has(.profile-picture) {
    background-color: transparent;
}

.icon-btn:hover {
    background-color: #d8dadf;
}

.icon-btn:has(.profile-picture):hover {
    background-color: transparent;
}

.icon-btn .icon {
    font-size: 20px;
}

.icon-btn .profile-picture {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    padding: 8px 0;
    z-index: 1000;
}

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

.profile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-weight: 600;
    color: #050505;
    text-decoration: none;
    transition: background-color 0.2s;
}

.profile-item:hover {
    background-color: #f0f2f5;
}

.profile-dropdown hr {
    border: none;
    border-top: 1px solid #e4e6eb;
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #050505;
    text-decoration: none;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f0f2f5;
}

.dropdown-item.admin-link {
    color: #1877F2;
    font-weight: 600;
}

.dropdown-item.admin-link:hover {
    background-color: #e7f3ff;
}

/* Main Content Area */
.main-content {
    padding-top: 56px;
    display: flex;
    max-width: 1440px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Feed */
.feed {
    flex: 1;
    padding: 20px 32px;
    margin-left: auto;
    margin-right: auto;
    max-width: 680px;
}

.create-post {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.post-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.post-input {
    flex: 1;
    background-color: #f0f2f5;
    border: none;
    border-radius: 50px;
    padding: 12px 16px;
    font-size: 15px;
    outline: none;
}

.post-input:hover {
    background-color: #e4e6eb;
}

.create-post hr {
    border: none;
    border-top: 1px solid #e4e6eb;
    margin: 12px 0;
}

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

.post-action-btn {
    flex: 1;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    color: #65676b;
    font-weight: 600;
    transition: background-color 0.2s;
}

.post-action-btn:hover {
    background-color: #f0f2f5;
}

.post {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

.post-author {
    font-weight: 600;
    color: #050505;
}

.post-time {
    font-size: 13px;
    color: #65676b;
}

.post-content {
    color: #050505;
    font-size: 15px;
    line-height: 1.4;
}

/* Right Sidebar */
.right-sidebar {
    width: 280px;
    padding: 20px 16px;
    position: fixed;
    top: 56px;
    right: 0;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

.right-sidebar h3 {
    margin-bottom: 12px;
    color: #65676b;
    font-size: 16px;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #050505;
    transition: background-color 0.2s;
}

.contact-item:hover {
    background-color: #e4e6eb;
}

/* Responsive Design */
@media (max-width: 1100px) {
    .right-sidebar {
        display: none;
    }

    .feed {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .nav-center {
        display: none;
    }

    .search-box {
        width: 180px;
    }

    .feed {
        padding: 20px 16px;
    }
}

/* Post Interactions */
.post-interactions {
    display: flex;
    border-top: 1px solid #e4e6eb;
    padding-top: 8px;
    margin-top: 12px;
}

.reaction-btn-container {
    position: relative;
    flex: 1;
}

/* Extend hover area to cover the gap */
.reaction-btn-container::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 12px;
    display: none;
}

.reaction-btn-container:hover::before {
    display: block;
}

.reaction-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: white;
    border-radius: 50px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
    padding: 4px 8px;
    display: none;
    gap: 4px;
    margin-bottom: 8px;
    z-index: 10;
}

.reaction-btn-container:hover .reaction-picker,
.reaction-picker:hover {
    display: flex;
}

.reaction-option {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: transform 0.2s;
}

.reaction-option:hover {
    transform: scale(1.3);
}

.interaction-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    color: #65676b;
    transition: background-color 0.2s;
}

.interaction-btn:hover {
    background-color: #f0f2f5;
}

.interaction-btn.active {
    color: #1877f2;
}

.reactions-summary {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    font-size: 13px;
    color: #65676b;
}

.reaction-emoji {
    font-size: 16px;
}

.reaction-count {
    margin-left: 4px;
}

/* Comments Section */
.comments-section {
    border-top: 1px solid #e4e6eb;
    padding-top: 12px;
    margin-top: 12px;
}

.add-comment {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.comment-input {
    flex: 1;
    background-color: #f0f2f5;
    border: none;
    border-radius: 18px;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}

.comment-submit-btn {
    background-color: #1877f2;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.comment-submit-btn:hover {
    background-color: #166fe5;
}

.comment {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    color: #050505;
}

.comment-time {
    font-size: 12px;
    color: #65676b;
}

.comment-text {
    background-color: #f0f2f5;
    border-radius: 18px;
    padding: 8px 12px;
    font-size: 14px;
    color: #050505;
    display: inline-block;
}

.comment-reactions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
}

.reaction-emoji-small {
    padding: 2px 6px;
    background-color: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
}

.comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.comment-action-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #65676b;
    cursor: pointer;
    transition: color 0.2s;
}

.comment-action-btn:hover {
    color: #050505;
}

.comment-action-btn.active {
    color: #1877f2;
}

.replies {
    margin-left: 40px;
    margin-top: 12px;
}

.reply {
    margin-bottom: 8px;
}

.reply-input {
    margin-top: 8px;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.loading-container,
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #65676b;
}

.loading-text {
    text-align: center;
    color: #65676b;
    padding: 12px;
    font-size: 14px;
}

.load-more-container {
    text-align: center;
    padding: 20px;
}

.load-more-btn {
    background-color: #f0f2f5;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.load-more-btn:hover:not(:disabled) {
    background-color: #e4e6eb;
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

