.posts-feed-page {
    min-height: calc(100vh - 72px);
    padding-bottom: 3rem;
    background: var(--body-bg);
}

.posts-feed-page .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.feed-layout,
.feed-content,
.posts-section {
    min-width: 0;
    width: 100%;
}

.feed-header {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 16px;
}

.feed-header h1 {
    margin: 0 0 1rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.feed-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 40px;
    padding: 0.625rem 1.25rem;
    background: var(--sidebar-bg);
    border: 1px solid var(--post-border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.filter-btn:hover {
    background: var(--input-bg);
    border-color: var(--accent-color);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    border-color: var(--accent-color);
    color: var(--button-primary-text);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.filter-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.posts-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-secondary);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-secondary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
    position: relative;
    max-width: 600px;
    margin: 5% auto;
}

.modal-content,
.share-modal {
    background: var(--post-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.share-modal {
    width: min(600px, calc(100vw - 2rem));
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    margin: 50px auto;
}

.modal-header,
.modal-footer {
    display: flex;
    align-items: center;
    padding: 1.5rem;
}

.modal-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--post-border);
}

.modal-header h3,
.modal-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
    background: var(--sidebar-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.share-modal .modal-body {
    overflow-y: auto;
}

.modal-footer {
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid var(--post-border);
}

.share-modal-label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.share-destination,
.share-communities-list,
.form-group {
    margin-bottom: 1.5rem;
}

.share-type-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.share-type-option,
.community-option {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.share-type-option input[type="radio"],
.community-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.share-type-content,
.community-option-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--sidebar-bg);
    border: 2px solid var(--post-border);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.share-type-content {
    padding: 1rem;
    border-radius: 12px;
}

.share-type-option input[type="radio"]:checked + .share-type-content,
.community-option input[type="radio"]:checked + .community-option-content {
    border-color: var(--accent-color);
    background: rgba(52, 152, 219, 0.08);
    box-shadow: 0 0 0 1px var(--accent-color);
}

.communities-scroll {
    max-height: 280px;
    overflow-y: auto;
    background: var(--post-bg);
    border: 2px solid var(--post-border);
    border-radius: 12px;
}

.community-option:not(:last-child) {
    border-bottom: 1px solid var(--post-border);
}

.community-option-content {
    position: relative;
    padding: 0.875rem 1rem;
    border: 0;
    border-radius: 0;
}

.community-option-avatar,
.community-option-placeholder {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 10px;
}

.community-option-avatar {
    object-fit: cover;
}

.community-option-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

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

.community-option-name {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.community-option-members {
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.share-input,
.share-modal textarea,
.form-control {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font: inherit;
    outline: none;
    resize: vertical;
}

.share-input:focus,
.share-modal textarea:focus,
.form-control:focus {
    border-color: var(--accent-color);
}

.share-post-preview,
.share-preview {
    padding: 1rem;
    background: var(--sidebar-bg);
    border: 1px solid var(--post-border);
    border-radius: 12px;
}

.post-preview-poll {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .posts-feed-page .container {
        padding: 0 0.75rem;
    }

    .feed-header {
        padding: 1rem;
        border-radius: 12px;
    }

    .feed-filters {
        gap: 0.5rem;
    }

    .filter-btn {
        flex: 1 1 calc(50% - 0.5rem);
        justify-content: center;
        padding: 0.625rem 0.75rem;
    }

    .share-type-options {
        grid-template-columns: 1fr;
    }

    .share-modal {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        margin: 0.5rem auto;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}
