/* Document Sidebar Optimizations - Performance Focused */

/* Sentiment Distribution - GPU accelerated */
.sentiment-distribution-container {
    margin-top: 8px;
    will-change: transform; /* GPU acceleration hint */
}

.sentiment-bar-container {
    padding: 8px 0;
}

.sentiment-bar {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transform: translateZ(0); /* Force GPU layer */
}

.sentiment-counts {
    font-size: 0.8rem;
}

.sentiment-legend {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Color indicators - optimized */
.color-box {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 4px;
    flex-shrink: 0;
}

.color-box.positive { background-color: #4CAF50; }
.color-box.neutral { background-color: #FFC107; }
.color-box.negative { background-color: #F44336; }

/* Document Filter - streamlined */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-status {
    font-size: 0.75rem;
    color: var(--secondary);
    margin-top: 6px;
    opacity: 0.8;
}

/* Post item optimizations - reduced repaints */
.post-item {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 12px;
    border-radius: 6px;
    background-color: var(--third);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
    will-change: transform;
}

.post-item:hover {
    transform: translateY(-2px) translateZ(0);
    border-color: #007bff;
    cursor: pointer;
}

/* Post structure - optimized layout */
.post-header {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.post-avatar {
    width: 30px;
    height: 30px;
    background-color: #4A6FA5;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    flex-shrink: 0;
}

.post-user-info {
    flex-grow: 1;
    min-width: 0; /* Allow text truncation */
}

.post-username {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-date {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Sentiment indicator - optimized */
.post-sentiment {
    margin-left: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.post-sentiment.positive {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.post-sentiment.neutral {
    background-color: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

.post-sentiment.negative {
    background-color: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

/* Trend indicators - simplified */
.trend-indicator {
    font-size: 0.7rem;
    opacity: 0.7;
}

.trend-indicator .bi-arrow-up { color: #4CAF50; }
.trend-indicator .bi-arrow-down { color: #F44336; }

/* Post content - optimized typography */
.post-content {
    padding: 10px 12px;
}

.post-content p {
    margin-bottom: 8px;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Post stats - streamlined */
.post-stats {
    padding: 6px 12px;
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.2);
}

.post-badges {
    padding: 4px 12px 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Responsive optimizations */
@media (max-width: 768px) {
    .post-header {
        padding: 6px 10px;
    }
    
    .post-avatar {
        width: 26px;
        height: 26px;
        margin-right: 8px;
    }
    
    .post-username {
        font-size: 0.85rem;
    }
    
    .post-date {
        font-size: 0.65rem;
    }
    
    .post-sentiment {
        width: 20px;
        height: 20px;
    }
    
    .post-content {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .post-stats {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
    
    .sentiment-legend {
        gap: 6px;
    }
    
    .legend-item {
        font-size: 0.7rem;
    }
}