/* Social Media Feed Frontend Styles */

/* Container Styles */
.smf-feed {
    margin: 20px 0;
    padding: 0;
}

.smf-feed.smf-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.smf-feed.smf-columns-1 { grid-template-columns: 1fr; }
.smf-feed.smf-columns-2 { grid-template-columns: repeat(2, 1fr); }
.smf-feed.smf-columns-3 { grid-template-columns: repeat(3, 1fr); }
.smf-feed.smf-columns-4 { grid-template-columns: repeat(4, 1fr); }
.smf-feed.smf-columns-5 { grid-template-columns: repeat(5, 1fr); }
.smf-feed.smf-columns-6 { grid-template-columns: repeat(6, 1fr); }

.smf-feed.smf-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.smf-feed.smf-masonry {
    column-count: 3;
    column-gap: 20px;
}

/* Post Styles */
.smf-post {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    break-inside: avoid;
    margin-bottom: 20px;
}

.smf-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Platform Header */
.smf-post-platform {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.smf-post-platform i {
    font-size: 16px;
}

/* Media Styles */
.smf-post-media {
    position: relative;
    overflow: hidden;
}

.smf-image-container {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
}

.smf-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.smf-post:hover .smf-image-container img {
    transform: scale(1.05);
}

.smf-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.smf-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.smf-play-button,
.smf-video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.smf-play-button:hover,
.smf-video-overlay:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Content Styles */
.smf-post-content {
    padding: 16px;
}

.smf-post-caption {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 12px;
}

.smf-post-caption p {
    margin: 0 0 8px 0;
}

/* Meta Information */
.smf-post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #6c757d;
}

.smf-post-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.smf-post-meta i {
    font-size: 12px;
}

/* Actions */
.smf-post-actions {
    border-top: 1px solid #e9ecef;
    padding-top: 12px;
}

.smf-view-original {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #007cba;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.smf-view-original:hover {
    color: #005a87;
    text-decoration: none;
}

.smf-view-original i {
    font-size: 11px;
}

/* Platform Specific Styles */
.smf-post-instagram {
    border-left: 4px solid #E4405F;
}

.smf-post-facebook {
    border-left: 4px solid #1877F2;
}

/* No Posts Message */
.smf-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Loading State */
.smf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6c757d;
}

.smf-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: smf-spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes smf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .smf-feed.smf-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .smf-feed.smf-masonry {
        column-count: 1;
    }
    
    .smf-post {
        margin-bottom: 15px;
    }
    
    .smf-post-content {
        padding: 12px;
    }
    
    .smf-post-meta {
        gap: 12px;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .smf-feed {
        margin: 15px 0;
    }
    
    .smf-post-platform {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .smf-post-content {
        padding: 10px;
    }
    
    .smf-post-caption {
        font-size: 13px;
    }
    
    .smf-play-button,
    .smf-video-overlay {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .smf-post {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .smf-post-platform {
        background: #4a5568;
        border-bottom-color: #718096;
        color: #e2e8f0;
    }
    
    .smf-post-caption {
        color: #e2e8f0;
    }
    
    .smf-post-meta {
        color: #a0aec0;
    }
    
    .smf-post-actions {
        border-top-color: #718096;
    }
    
    .smf-view-original {
        color: #63b3ed;
    }
    
    .smf-view-original:hover {
        color: #90cdf4;
    }
    
    .smf-no-posts {
        background: #4a5568;
        border-color: #718096;
        color: #a0aec0;
    }
}

/* Animation Classes */
.smf-fade-in {
    animation: smf-fadeIn 0.5s ease-in;
}

@keyframes smf-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.smf-slide-up {
    animation: smf-slideUp 0.6s ease-out;
}

@keyframes smf-slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Accessibility */
.smf-post:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.smf-view-original:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print Styles */
@media print {
    .smf-post {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .smf-post-actions {
        display: none;
    }
    
    .smf-video-container,
    .smf-play-button,
    .smf-video-overlay {
        display: none;
    }
}
