/* Enhanced Feed Styles - Responsive Design & Animations */

/* ══════════════════════════════════════════════════════════════════════════════ */
/* FEED CONTAINER & LAYOUT */
/* ══════════════════════════════════════════════════════════════════════════════ */

#feedContainer {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
}

.feed-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.feed-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.feed-item.memory {
    border-left: 4px solid #ff6b6b;
}

.feed-item.post {
    border-left: 4px solid #4ecdc4;
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* FEED ITEM HEADER */
/* ══════════════════════════════════════════════════════════════════════════════ */

.feed-item-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid #f0f0f0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-time {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.verified-badge {
    color: #1da1f2;
    font-size: 14px;
}

.feed-item-actions {
    display: flex;
    gap: 8px;
}

.feed-item-actions button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.feed-item-actions button:hover {
    background: #f8f9fa;
    color: #333;
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* CONTENT SCORE BADGE */
/* ══════════════════════════════════════════════════════════════════════════════ */

.content-score {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.feed-item:hover .content-score {
    opacity: 1;
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* FEED ITEM CONTENT */
/* ══════════════════════════════════════════════════════════════════════════════ */

.feed-item-content {
    padding: 16px 20px;
}

.feed-item-content p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    color: #333;
    font-size: 15px;
}

.feed-media {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.feed-media:hover {
    transform: scale(1.02);
}

.audio-player {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 12px;
}

.audio-player i {
    font-size: 24px;
    margin-bottom: 8px;
}

.audio-player audio {
    width: 100%;
    margin-top: 12px;
}

.location-info {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 14px;
    margin-top: 8px;
}

.location-info i {
    margin-right: 6px;
    color: #ff6b6b;
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* FEED ITEM FOOTER */
/* ══════════════════════════════════════════════════════════════════════════════ */

.feed-item-footer {
    padding: 12px 20px 16px;
    border-top: 1px solid #f0f0f0;
}

.engagement-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #666;
}

.engagement-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.action-buttons button:hover {
    background: #f8f9fa;
    color: #333;
}

.action-buttons button.liked {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* PULL TO REFRESH */
/* ══════════════════════════════════════════════════════════════════════════════ */

#pullToRefresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#pullToRefresh i {
    font-size: 24px;
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* LOADING STATES */
/* ══════════════════════════════════════════════════════════════════════════════ */

#feedLoader {
    text-align: center;
    padding: 40px;
    display: none;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

#feed-sentinel {
    width: 100%;
    height: 1px;
    margin: 20px 0;
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* RESPONSIVE DESIGN */
/* ══════════════════════════════════════════════════════════════════════════════ */

/* Mobile Devices */
@media (max-width: 768px) {
    #feedContainer {
        padding: 0 12px;
    }
    
    .feed-item {
        margin-bottom: 16px;
        border-radius: 8px;
    }
    
    .feed-item-header {
        padding: 12px 16px;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
    }
    
    .user-info h4 {
        font-size: 14px;
    }
    
    .post-time {
        font-size: 12px;
    }
    
    .feed-item-content {
        padding: 12px 16px;
    }
    
    .feed-item-content p {
        font-size: 14px;
    }
    
    .feed-media {
        max-height: 300px;
    }
    
    .feed-item-footer {
        padding: 10px 16px 12px;
    }
    
    .engagement-stats {
        font-size: 12px;
        gap: 12px;
    }
    
    .action-buttons button {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .content-score {
        top: 8px;
        right: 8px;
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    #feedContainer {
        padding: 0 8px;
    }
    
    .feed-item-header {
        padding: 10px 12px;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
        margin-right: 10px;
    }
    
    .feed-item-actions {
        gap: 4px;
    }
    
    .feed-item-actions button {
        width: 32px;
        height: 32px;
        padding: 6px;
    }
    
    .feed-item-content {
        padding: 10px 12px;
    }
    
    .feed-item-footer {
        padding: 8px 12px 10px;
    }
    
    .engagement-stats {
        flex-direction: column;
        gap: 4px;
        font-size: 11px;
    }
    
    .action-buttons {
        gap: 6px;
    }
    
    .action-buttons button {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    #feedContainer {
        padding: 0 20px;
    }
    
    .feed-item {
        margin-bottom: 24px;
    }
}

/* Large Desktops */
@media (min-width: 1200px) {
    #feedContainer {
        max-width: 900px;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* DARK MODE SUPPORT */
/* ══════════════════════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
    .feed-item {
        background: #1a1a1a;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .feed-item-header {
        border-bottom-color: #333;
    }
    
    .user-info h4 {
        color: #fff;
    }
    
    .post-time {
        color: #999;
    }
    
    .feed-item-content p {
        color: #e0e0e0;
    }
    
    .feed-item-footer {
        border-top-color: #333;
    }
    
    .engagement-stats {
        color: #999;
    }
    
    .action-buttons button {
        color: #999;
    }
    
    .action-buttons button:hover {
        background: #2a2a2a;
        color: #fff;
    }
    
    .location-info {
        color: #999;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* ACCESSIBILITY & REDUCED MOTION */
/* ══════════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .feed-item,
    .feed-item-actions button,
    .action-buttons button,
    .feed-media,
    .content-score,
    #pullToRefresh {
        transition: none;
        animation: none;
    }
    
    .feed-item:hover {
        transform: none;
    }
    
    .feed-media:hover {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .feed-item {
        border: 2px solid #000;
    }
    
    .feed-item.memory {
        border-left-color: #000;
    }
    
    .feed-item.post {
        border-left-color: #000;
    }
    
    .action-buttons button:focus {
        outline: 2px solid #000;
        outline-offset: 2px;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* PRINT STYLES */
/* ══════════════════════════════════════════════════════════════════════════════ */

@media print {
    .feed-item-actions,
    .action-buttons,
    .content-score,
    #pullToRefresh,
    #feedLoader {
        display: none !important;
    }
    
    .feed-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 20px;
    }
    
    .feed-media {
        max-height: 300px;
    }
}