/* Mobile Responsive - Application-like Design */

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-500);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: var(--primary-600);
    transform: scale(1.1);
}

.mobile-menu-toggle.active {
    background: var(--red-500);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Sidebar Menu */
.mobile-sidebar-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
    transition: left 0.3s ease;
    padding: 1rem;
}

.mobile-sidebar-menu.active {
    left: 0;
}

.mobile-sidebar-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1rem;
}

.mobile-sidebar-menu-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.mobile-sidebar-close {
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-sidebar-close:hover {
    color: var(--gray-900);
}

/* Sticky Sidebars on Desktop */
@media (min-width: 1024px) {
    .sidebar-left {
        position: sticky;
        top: 80px; /* Height of header + some spacing */
        align-self: flex-start;
        overflow-x: hidden;
    }
    
    .sidebar-right {
        position: sticky;
        top: 80px;
        align-self: flex-start;
        overflow-x: hidden;
    }
    
    .sidebar-left.sticky-active {
        position: sticky !important;
        top: 80px !important;
        overflow-x: hidden !important;
    }
    
    .sidebar-right.sticky-active {
        position: sticky !important;
        top: 80px !important;
        overflow-x: hidden !important;
    }
    
    /* Compact sidebar - no scroll needed */
    .sidebar-compact {
        overflow-x: hidden;
    }
    
}

/* Mobile Styles */
@media (max-width: 1023px) {
    /* Hide desktop sidebars */
    .sidebar-left,
    .sidebar-right {
        display: none;
    }

    /* Compact sidebar becomes horizontal on mobile */
    .sidebar-compact {
        display: none; /* Hidden on mobile, use mobile menu instead */
    }
    
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Full width feed on mobile */
    .feed {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Feed container - full width */
    #postsContainer {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Mobile menu content */
    .mobile-sidebar-content {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .mobile-sidebar-content .card {
        margin: 0;
        box-shadow: none;
        border: 1px solid var(--gray-200);
    }
    
    /* Mobile navigation tabs */
    .mobile-nav-tabs {
        display: flex;
        gap: 0.5rem;
        padding: 0.5rem;
        background: white;
        border-bottom: 1px solid var(--gray-200);
        position: sticky;
        top: 0;
        z-index: 100;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-nav-tab {
        flex: 1;
        min-width: 100px;
        padding: 0.75rem 1rem;
        background: var(--gray-100);
        border: none;
        border-radius: 8px;
        color: var(--gray-700);
        font-weight: 500;
        font-size: 0.875rem;
        cursor: pointer;
        transition: all 0.2s ease;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .mobile-nav-tab.active {
        background: var(--primary-500);
        color: white;
    }
    
    .mobile-nav-tab svg {
        width: 18px;
        height: 18px;
    }
    
    /* Mobile bottom navigation */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid var(--gray-200);
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
        z-index: 999;
        padding: 0.5rem 0;
    }
    
    .mobile-bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        padding: 0.5rem;
        color: var(--gray-600);
        text-decoration: none;
        font-size: 0.75rem;
        transition: color 0.2s ease;
    }
    
    .mobile-bottom-nav-item.active {
        color: var(--primary-500);
    }
    
    .mobile-bottom-nav-item svg {
        width: 22px;
        height: 22px;
    }
    
    /* Add padding to feed for bottom nav */
    .feed {
        padding-bottom: 70px;
    }
    
    /* Mobile card adjustments */
    .card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .create-post-card {
        margin-bottom: 1rem;
    }
    
    /* Mobile post card - 100% width, no padding except content area */
    .post-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border-bottom: 1px solid var(--gray-200);
    }
    
    /* Post header and content keep padding */
    .post-card .post-header,
    .post-card .post-content {
        padding: 1rem;
    }
    
    /* Post actions keep padding */
    .post-card .post-actions {
        padding: 0.75rem 1rem;
    }
    
    /* Post comments section keep padding */
    .post-card .post-comments-section {
        padding: 0 1rem 1rem;
    }
    
    /* Les médias prennent 100% de la largeur en responsive - NO PADDING */
    .post-card .post-media,
    .post-card .post-media-gallery,
    .post-card .post-image,
    .post-card .post-video {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
    
    .post-card .post-media img,
    .post-card .post-media video,
    .post-card .post-image img,
    .post-card .post-video video,
    .post-card .post-media-image,
    .post-card .post-media-video {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        display: block;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
    
    .post-card .post-youtube,
    .post-card .youtube-embed {
        width: 100% !important;
        margin: 1rem 0 !important;
        padding-bottom: 56.25% !important;
        height: 0 !important;
        border-radius: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    .post-card .post-youtube iframe,
    .post-card .youtube-embed iframe {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        border: 0 !important;
        z-index: 1 !important;
    }
    
    /* Post media gallery items - full width */
    .post-card .post-media-item {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Mobile create post form */
    .create-post-form {
        gap: 0.75rem;
    }
    
    .post-tools {
        gap: 0.5rem;
    }
    
    .tool-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .tool-label {
        display: none;
    }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1023px) {
    .feed {
        max-width: 100%;
    }
    
    .mobile-sidebar-menu {
        width: 320px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .mobile-menu-toggle {
        width: 48px;
        height: 48px;
        bottom: 70px; /* Above bottom nav */
    }
    
    .mobile-sidebar-menu {
        width: 100vw;
    }
    
    .feed {
        padding: 0.25rem;
    }
    
    .card {
        padding: 0.75rem;
    }
}

/* Smooth scrolling for mobile */
@media (max-width: 1023px) {
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

