/**
 * Social Feed Aggregator Styles
 */

/* Feed Container */
.sfa-feed {
    margin: 20px 0;
}

/* Feed Grid */
.sfa-feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Responsive grid */
@media (max-width: 768px) {
    .sfa-feed-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .sfa-feed-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Feed Item */
.sfa-feed-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sfa-feed-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Feed Link */
.sfa-feed-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Feed Image */
.sfa-feed-image {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 aspect ratio */
    overflow: hidden;
    background: #f0f0f0;
}

.sfa-feed-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Feed Overlay */
.sfa-feed-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.sfa-feed-item:hover .sfa-feed-overlay {
    background: rgba(0, 0, 0, 0.4);
}

/* Platform Icon */
.sfa-platform-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sfa-feed-item:hover .sfa-platform-icon {
    opacity: 1;
    transform: scale(1);
}

.sfa-platform-icon svg {
    width: 20px;
    height: 20px;
}

/* Platform Colors */
.sfa-platform-instagram svg { color: #E4405F; }
.sfa-platform-pinterest svg { color: #E60023; }
.sfa-platform-facebook svg { color: #1877F2; }
.sfa-platform-tiktok svg { color: #000000; }
.sfa-platform-twitter svg { color: #000000; }
.sfa-platform-twitch svg { color: #9146FF; }
.sfa-platform-youtube svg { color: #FF0000; }

/* Video Indicator */
.sfa-video-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sfa-feed-item:hover .sfa-video-indicator {
    opacity: 1;
    transform: scale(1);
}

.sfa-video-indicator svg {
    width: 32px;
    height: 32px;
    color: #333;
}

/* Feed Caption */
.sfa-feed-caption {
    padding: 15px;
    background: #fff;
}

.sfa-feed-caption p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Error and Empty States */
.sfa-error,
.sfa-empty {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.sfa-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.sfa-empty {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
}

/* Widget Specific Styles */
.widget .sfa-feed-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.widget .sfa-feed-caption {
    display: none; /* Hide captions in widgets to save space */
}

/* Loading State */
.sfa-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

.sfa-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: sfa-spin 1s linear infinite;
}

@keyframes sfa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.sfa-feed-link:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .sfa-feed-overlay,
    .sfa-platform-icon,
    .sfa-video-indicator {
        display: none;
    }
}
