/* Optimized CSS for better performance */

/* Critical CSS - Load first */
:root {
    --yellow-color: #fbbf24;
    --blue-color: #1e40af;
}

/* Base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Navbar optimization */
.navbar {
    background: linear-gradient(135deg, var(--blue-color) 0%, var(--yellow-color) 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Sidebar optimization */
.modern-sidebar {
    position: fixed;
    left: 0;
    top: 80px;
    height: calc(100vh - 80px);
    width: 50px;
    background: linear-gradient(135deg, var(--blue-color) 0%, var(--yellow-color) 100%);
    transition: width 0.3s ease;
    z-index: 998;
    overflow: hidden;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.modern-sidebar.expanded {
    width: 200px;
}

/* Post optimization */
.post-card {
    margin-bottom: 20px;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.post-images {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
}

.post-images img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #f8f9fa;
}

/* Responsive optimization */
@media (max-width: 768px) {
    .modern-sidebar {
        width: 40px;
    }
    
    .modern-sidebar.expanded {
        width: 160px;
    }
    
    .navbar-brand img {
        width: 28px;
        height: 28px;
    }
}

/* Performance optimizations */
.post-card,
.sidebar-item,
.nav-link {
    will-change: transform;
}

.post-images img {
    will-change: transform;
}

/* Reduce repaints */
.modern-sidebar,
.navbar {
    contain: layout style paint;
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
