/* Facebook-Style Responsive CSS */

/* Global Card Styling */
.card {
    margin: 0px !important;
    max-width: 1200px;
}

/* Mobile-specific styles */
@media (max-width: 767px) {
    /* Adjust padding and margins for mobile */
    .card {
        border-radius: 0 !important;
        margin-left: -15px !important;
        margin-right: -15px !important;
        width: calc(100% + 30px) !important;
    }
    
    .facebook-main-content {
        padding: 0;
    }
    
    /* Content area spacing for mobile */
    .container {
        padding: 0;
    }
    
    .content {
        padding: 5px !important;
    }
    
    /* Bottom spacing for fixed bottom nav */
    .page-content {
        padding-bottom: 60px !important;
    }
    
    /* Compact post display */
    .post-item {
        margin-bottom: 8px !important;
    }
    
    .post-header {
        padding: 8px !important;
    }
    
    .post-content {
        padding: 0 8px 8px !important;
    }
    
    .post-actions {
        padding: 5px !important;
    }
    
    /* Compact comment section */
    .comment-box {
        padding: 8px !important;
    }
    
    /* Create post compact styling */
    .create-post {
        margin-bottom: 10px !important;
        padding: 8px !important;
    }
    
    .create-post-input {
        font-size: 14px !important;
    }
}

/* Sidebar styling */
.facebook-left-sidebar {
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 0;
    background: white;
    scrollbar-width: thin;
}

.facebook-left-sidebar::-webkit-scrollbar {
    width: 6px;
}

.facebook-left-sidebar::-webkit-scrollbar-thumb {
    background-color: #c1c7cd;
    border-radius: 10px;
}

.facebook-left-sidebar::-webkit-scrollbar-track {
    background-color: transparent;
}

.left-sidebar-wrapper {
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 5px 0;
    margin-bottom: 5px;
}

.sidebar-menu-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #1c1e21;
    transition: background-color 0.15s;
}

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

.profile-menu-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #1c1e21;
}

.profile-name {
    font-weight: 600;
    font-size: 15px;
}

.sidebar-profile {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

.sidebar-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-category-title {
    padding: 12px 10px 8px 10px;
    margin-top: 8px;
    border-top: 1px solid #ced0d4;
}

.sidebar-category-title span {
    font-size: 17px;
    font-weight: 600;
    color: #65676b;
}

.sidebar-footer {
    margin-top: 20px;
    padding: 10px;
    font-size: 12px;
    color: #65676b;
}

.sidebar-footer-links {
    margin-bottom: 5px;
    line-height: 1.3;
}

.footer-link {
    color: #65676b;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}

.footer-link:hover {
    text-decoration: underline;
}

/* Mobile sidebar */
.facebook-mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background-color: #fff;
    z-index: 2000;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.facebook-mobile-sidebar.show {
    transform: translateX(0);
}

.mobile-sidebar-header {
    border-bottom: 1px solid #e4e6eb;
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 2;
}

.close-sidebar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f0f2f5;
    color: #65676b;
    text-decoration: none;
}

.close-sidebar:hover {
    background-color: #e4e6eb;
}

.mobile-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 5px 10px;
}

/* Match mobile sidebar styling with desktop */
.mobile-sidebar-content .sidebar-menu-list {
    margin-bottom: 5px;
}

.mobile-sidebar-content .profile-menu-item {
    border-radius: 8px;
    margin-bottom: 10px;
}

.mobile-sidebar-content .sidebar-header {
    padding: 5px;
}

/* Mobile FB UI adjustments */
@media (max-width: 767px) {
    .facebook-mobile-overlay {
        transition: opacity 0.3s ease;
    }
    
    .sidebar-category-title {
        font-size: 16px;
        padding: 10px 5px;
    }
}

.mobile-sidebar-content {
    padding: 15px 10px;
}

/* Right sidebar styling */
.facebook-right-sidebar {
    position: sticky;
    top: 150px;
    height: calc(100vh - 150px);
    overflow-y: auto;
    padding: 0 10px;
}

.right-sidebar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px 0;
}

.sidebar-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
}

.sidebar-section-title a {
    color: #65676b;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.sidebar-section-title a:hover {
    background-color: #f0f2f5;
}

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

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

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

.contact-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: #31a24c;
    border-radius: 50%;
    border: 2px solid #ffffff;
}

.contact-name {
    font-size: 14px;
    font-weight: 500;
}

/* Sponsored section */
.sponsored-item {
    text-decoration: none;
    color: #050505;
}

.sponsored-info {
    padding: 0 5px;
}

/* Pages section */
.pages-actions {
    padding-left: 55px;
    margin-top: 5px;
}

.pages-actions a {
    text-decoration: none;
    color: #65676b;
    border-radius: 4px;
}

.pages-actions a:hover {
    background-color: #f0f2f5;
}

/* Footer styling */
.footer-links {
    font-size: 12px;
    color: #65676b;
    padding: 5px;
}

.footer-link {
    text-decoration: none;
    color: #65676b;
    margin-right: 3px;
    margin-left: 3px;
}

.footer-link:hover {
    text-decoration: underline;
}

.copyright {
    font-size: 12px;
    color: #65676b;
    padding: 5px;
}

/* Desktop search styling */
.facebook-search-lg {
    flex: 1;
    max-width: 300px;
    background-color: #f0f2f5;
    border-radius: 50px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
}

.facebook-search-lg input {
    border: none;
    background: transparent;
    outline: none;
    padding-left: 8px;
    color: #050505;
    width: 100%;
}

/* Filter options */
.post-filter-options {
    display: flex;
    gap: 10px;
}

.filter-option {
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: #65676b;
    transition: all 0.2s;
    background-color: #f0f2f5;
}

.filter-option:hover {
    background-color: #e4e6eb;
}

.filter-option.active {
    background-color: #e7f3ff;
    color: #1877f2;
}

/* Main content area */
.facebook-main-content {
    padding: 0 10px;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .facebook-left-sidebar,
    .facebook-right-sidebar {
        display: none;
    }
    
    .facebook-main-content {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Medium sized screens */
@media (min-width: 992px) and (max-width: 1199px) {
    .facebook-right-sidebar {
        display: none;
    }

    .facebook-main-content {
        flex: 0 0 75%;
        max-width: 75%;
    }

    .facebook-left-sidebar {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .facebook-main-content {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .facebook-left-sidebar,
    .facebook-right-sidebar {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* 📱 COMPREHENSIVE RESPONSIVE DESIGN ENHANCEMENTS */

/* 📱 MOBILE-FIRST BASE STYLES (320px+) */
/* Touch-friendly enhancements */
@media (max-width: 767px) {
    /* Enhanced touch targets */
    .facebook-icon,
    .facebook-tab,
    .mobile-category-item,
    .quick-access-item {
        min-height: 44px;
        min-width: 44px;
    }

    /* Safe area support for notch devices */
    .facebook-topbar,
    .facebook-tabs,
    .page-content {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    /* Bottom safe area for devices with home indicator */
    .facebook-tabs {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}

/* 📱 TABLET OPTIMIZATION (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .facebook-main-content {
        flex: 0 0 70%;
        max-width: 70%;
    }

    .facebook-left-sidebar {
        flex: 0 0 30%;
        max-width: 30%;
    }

    .facebook-right-sidebar {
        display: none;
    }

    /* Enhanced spacing for tablet */
    .card {
        margin: 10px !important;
        border-radius: 12px !important;
    }

    .post-item {
        margin-bottom: 12px !important;
    }

    .post-header {
        padding: 12px !important;
    }

    .post-content {
        padding: 0 12px 12px !important;
    }

    .post-actions {
        padding: 8px 12px !important;
    }

    .create-post {
        padding: 12px !important;
    }

    .comment-box {
        padding: 12px !important;
    }
}

/* 💻 DESKTOP LAYOUT (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .facebook-main-content {
        flex: 0 0 60%;
        max-width: 60%;
    }

    .facebook-left-sidebar {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .facebook-right-sidebar {
        flex: 0 0 15%;
        max-width: 15%;
        display: block;
    }

    /* Enhanced desktop spacing */
    .card {
        margin: 15px !important;
        border-radius: 16px !important;
    }

    .post-item {
        margin-bottom: 16px !important;
        border-radius: 12px;
    }

    .post-header {
        padding: 16px !important;
    }

    .post-content {
        padding: 0 16px 16px !important;
    }

    .post-actions {
        padding: 12px 16px !important;
    }

    .create-post {
        padding: 16px !important;
        border-radius: 12px;
    }

    .comment-box {
        padding: 16px !important;
    }
}

/* 🖥️ LARGE DESKTOP (1200px+) */
@media (min-width: 1200px) {
    .facebook-main-content {
        flex: 0 0 55%;
        max-width: 55%;
    }

    .facebook-left-sidebar {
        flex: 0 0 22%;
        max-width: 22%;
    }

    .facebook-right-sidebar {
        flex: 0 0 23%;
        max-width: 23%;
        display: block;
    }

    /* Premium spacing for large screens */
    .card {
        margin: 20px !important;
        border-radius: 20px !important;
    }

    .post-item {
        margin-bottom: 20px !important;
        border-radius: 16px;
    }

    .post-header {
        padding: 20px !important;
    }

    .post-content {
        padding: 0 20px 20px !important;
    }

    .post-actions {
        padding: 16px 20px !important;
    }

    .create-post {
        padding: 20px !important;
        border-radius: 16px;
    }

    .comment-box {
        padding: 20px !important;
    }
}

/* 📱 SMALL MOBILE ENHANCEMENTS (320px - 480px) */
@media (max-width: 480px) {
    /* Extra compact for small screens */
    .card {
        margin: -10px -10px 10px -10px !important;
        width: calc(100% + 20px) !important;
        border-radius: 0 !important;
    }

    .post-item {
        margin-bottom: 6px !important;
    }

    .post-header {
        padding: 6px !important;
    }

    .post-content {
        padding: 0 6px 6px !important;
    }

    .post-actions {
        padding: 4px !important;
    }

    .create-post {
        margin-bottom: 8px !important;
        padding: 6px !important;
    }

    .comment-box {
        padding: 6px !important;
    }

    .page-content {
        padding-bottom: 70px !important; /* Account for bottom nav */
    }
}

/* 📱 EXTRA SMALL MOBILE (320px - 375px) */
@media (max-width: 375px) {
    /* Ultra-compact for very small screens */
    .card {
        margin: -8px -8px 8px -8px !important;
        width: calc(100% + 16px) !important;
    }

    .post-header {
        padding: 4px !important;
    }

    .post-content {
        padding: 0 4px 4px !important;
    }

    .post-actions {
        padding: 2px !important;
    }

    .create-post {
        padding: 4px !important;
    }

    .comment-box {
        padding: 4px !important;
    }

    .page-content {
        padding-bottom: 75px !important;
    }
}

/* 📱 LANDSCAPE MOBILE (480px - 767px and height < width) */
@media (max-width: 767px) and (orientation: landscape) {
    .facebook-topbar {
        height: 50px !important;
        min-height: 50px !important;
    }

    .facebook-tabs {
        height: 45px !important;
    }

    .page-content {
        padding-bottom: 50px !important;
    }

    .post-item {
        margin-bottom: 4px !important;
    }
}

/* ♿ ACCESSIBILITY ENHANCEMENTS */
@media (prefers-reduced-motion: reduce) {
    .card,
    .post-item,
    .facebook-icon,
    .facebook-tab {
        transition: none !important;
    }
}

@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000 !important;
    }

    .facebook-icon {
        border: 1px solid #000;
    }

    .facebook-tab {
        border: 1px solid #000;
    }
}

/* 🌙 DARK MODE SUPPORT */
@media (prefers-color-scheme: dark) {
    .facebook-left-sidebar,
    .facebook-right-sidebar {
        background: #18191a;
        border-color: #3a3b3c;
    }

    .sidebar-menu-item:hover {
        background-color: #3a3b3c;
    }
}

/* 📱 TOUCH DEVICE SPECIFIC */
@media (hover: none) and (pointer: coarse) {
    /* Increase all touch targets for touch devices */
    .facebook-icon,
    .facebook-tab,
    .mobile-category-item,
    .quick-access-item,
    .sidebar-menu-item {
        min-height: 48px;
        min-width: 48px;
    }

    /* Larger tap targets for better usability */
    .post-actions button,
    .comment-actions button {
        min-height: 44px;
        min-width: 44px;
        padding: 8px;
    }
}

/* 🖥️ ULTRA-WIDE DISPLAY SUPPORT (1440px+) */
@media (min-width: 1440px) {
    .facebook-main-content {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .facebook-left-sidebar {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .facebook-right-sidebar {
        flex: 0 0 25%;
        max-width: 25%;
    }

    /* Enhanced spacing for ultra-wide */
    .card {
        margin: 5px !important;
        max-width: 1000px;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* 📺 4K DISPLAY SUPPORT (1920px+) */
@media (min-width: 1920px) {
    .facebook-main-content {
        flex: 0 0 45%;
        max-width: 45%;
    }

    .facebook-left-sidebar {
        flex: 0 0 27%;
        max-width: 27%;
    }

    .facebook-right-sidebar {
        flex: 0 0 28%;
        max-width: 28%;
    }

    .card {
        margin: 2px !important;
        max-width: 1200px;
    }

    .post-item {
        font-size: 18px;
    }
}
