/**
 * Simple Facebook Feed - Frontend Styles
 */

/* Feed Container */
.sff-feed {
    margin: 20px 0;
    font-family: inherit;
}

/* List Layout */
.sff-layout-list .sff-post {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.sff-layout-list .sff-post:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Grid Layout */
.sff-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.sff-layout-grid .sff-post {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.sff-layout-grid .sff-post:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Post Images */
.sff-post-image {
    margin-bottom: 15px;
}

.sff-post-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* Post Content */
.sff-post-content {
    line-height: 1.6;
}

/* Post Date */
.sff-post-date {
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.sff-post-date time {
    font-weight: 500;
}

.sff-time-ago {
    opacity: 0.8;
    margin-left: 10px;
}

/* Post Message */
.sff-post-message {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.5;
}

.sff-post-message p {
    margin-bottom: 10px;
}

.sff-post-message a {
    color: #1877f2;
    text-decoration: none;
}

.sff-post-message a:hover {
    text-decoration: underline;
}

/* Post Story */
.sff-post-story {
    margin-bottom: 15px;
    font-style: italic;
    color: #666;
}

/* Hashtags */
.sff-hashtag {
    color: #1877f2;
    font-weight: 500;
}

/* Post Meta */
.sff-post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
    color: #666;
}

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

/* Icons */
.sff-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

.sff-icon-like::before {
    content: "👍";
}

.sff-icon-comment::before {
    content: "💬";
}

.sff-icon-share::before {
    content: "🔗";
}

/* View on Facebook Link */
.sff-view-on-facebook {
    color: #1877f2;
    text-decoration: none;
    font-weight: 500;
    margin-left: auto;
}

.sff-view-on-facebook:hover {
    text-decoration: underline;
}

/* Error States */
.sff-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
}

.sff-no-posts {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sff-layout-grid {
        grid-template-columns: 1fr;
    }

    .sff-post-meta {
        font-size: 13px;
        gap: 10px;
    }

    .sff-view-on-facebook {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .sff-feed {
        margin: 15px 0;
    }

    .sff-layout-list .sff-post {
        margin-bottom: 25px;
        padding-bottom: 15px;
    }

    .sff-layout-grid .sff-post {
        padding: 12px;
    }

    .sff-post-message {
        font-size: 15px;
    }

    .sff-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .sff-post-meta span {
        margin-right: 15px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .sff-layout-grid .sff-post {
        background: #1a1a1a;
        border-color: #333;
        color: #e0e0e0;
    }

    .sff-layout-list .sff-post {
        border-bottom-color: #333;
    }

    .sff-post-date,
    .sff-post-story,
    .sff-post-meta {
        color: #ccc;
    }

    .sff-post-meta {
        border-top-color: #333;
    }

    .sff-error {
        background: #2d1b1f;
        color: #f8d7da;
        border-color: #5a2d32;
    }
}

/* Loading Animation */
.sff-loading {
    text-align: center;
    padding: 40px;
}

.sff-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1877f2;
    border-radius: 50%;
    animation: sff-spin 1s linear infinite;
}

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

/* Print Styles */
@media print {
    .sff-post-meta {
        display: none;
    }

    .sff-view-on-facebook {
        display: none;
    }

    .sff-layout-grid {
        display: block;
    }

    .sff-layout-grid .sff-post {
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Accessibility */
.sff-post:focus-within {
    outline: 2px solid #1877f2;
    outline-offset: 2px;
}

.sff-view-on-facebook:focus {
    outline: 2px solid #1877f2;
    outline-offset: 2px;
    border-radius: 2px;
}