/* ============================================
   Community Section Styles
   Content-First, Minimal Social Design
   ============================================ */

/* Community Page Container */
.community-page {
    min-height: 100vh;
    background: #F7F8FC;
}

/* ============================================
   Community Header
   ============================================ */
.community-header {
    background: white;
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.community-header-content {
    margin-bottom: 1.5rem;
}

.community-title h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #2d3748;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.community-title h1 i {
    color: #667eea;
}

.community-title p {
    font-size: 1rem;
    color: #718096;
    margin: 0;
}

/* Community Stats */
.community-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.community-stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f7f8fc;
    border-radius: 12px;
}

.community-stat-item i {
    font-size: 1.5rem;
    color: #667eea;
}

.community-stat-item div {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
}

@media (max-width: 767px) {
    .community-header {
        padding: 1.5rem 0 1rem;
    }

    .community-title h1 {
        font-size: 1.5rem;
    }

    .community-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .community-stat-item {
        padding: 0.75rem 0.25rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        background: white;
        border: 1px solid #f3f4f6;
    }

    .community-stat-item div {
        align-items: center;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }
}

/* ============================================
   Filters
   ============================================ */
.community-filters {
    background: white;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 50;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-tab {
    padding: 0.625rem 1.25rem;
    border-radius: 50px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-tab:hover {
    background: #e5e7eb;
}

.filter-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.type-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.type-filter {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background: white;
    border: 2px solid #e5e7eb;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.type-filter:hover {
    border-color: #667eea;
    color: #667eea;
}

.type-filter.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

@media (max-width: 767px) {
    .community-filters {
        padding: 0.75rem 0;
    }

    .filter-tabs {
        margin-bottom: 0.75rem;
    }

    .filter-tab {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .type-filter {
        padding: 0.4rem 0.875rem;
        font-size: 0.8rem;
    }
}

/* ============================================
   Community Feed
   ============================================ */
.community-feed {
    padding: 2rem 0;
}

.feed-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .feed-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .feed-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Feed Card */
.feed-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.feed-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* Card Header (User Info) */
.feed-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.username {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
}

.upload-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

.content-type-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 0.9rem;
}

/* Card Content */
.feed-card-content {
    padding: 1rem;
}

.feed-cover {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin-bottom: 1rem;
}

.feed-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.feed-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.feed-author {
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 500;
    margin: 0;
}

.feed-description {
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.5;
    margin: 0;
}

.feed-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

.meta-item i {
    font-size: 0.75rem;
}

/* Card Actions */
.feed-card-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid #f3f4f6;
}

.feed-action-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-read {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-read:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-download {
    background: #f3f4f6;
    color: #6b7280;
}

.btn-download:hover {
    background: #e5e7eb;
}

.btn-more {
    flex: 0;
    width: 40px;
    padding: 0;
    background: #f3f4f6;
    color: #6b7280;
}

.btn-more:hover {
    background: #e5e7eb;
}

/* ============================================
   More Options Modal
   ============================================ */
.more-options-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.more-options-modal.active {
    opacity: 1;
    visibility: visible;
}

.more-options-content {
    background: white;
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 500px;
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.more-options-modal.active .more-options-content {
    transform: translateY(0);
}

.option-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    background: white;
    color: #2d3748;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.option-btn:hover {
    background: #f3f4f6;
}

.option-btn i {
    width: 24px;
    font-size: 1.1rem;
    color: #667eea;
}

.option-danger {
    color: #ef4444;
}

.option-danger i {
    color: #ef4444;
}

.option-btn:last-child {
    margin-bottom: 0;
    margin-top: 0.5rem;
    background: #f3f4f6;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.empty-state i {
    font-size: 4rem;
    color: #cbd5e0;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
    color: #718096;
    margin-bottom: 1.5rem;
}

/* ============================================
   Mobile Optimizations
   ============================================ */
@media (max-width: 767px) {
    .community-feed {
        padding: 1.5rem 0;
    }

    .feed-grid {
        gap: 1rem;
    }

    .feed-card {
        border-radius: 12px;
    }

    .feed-card-header {
        padding: 0.875rem;
    }

    .feed-card-content {
        padding: 0.875rem;
    }

    .feed-card-actions {
        padding: 0.875rem;
        gap: 0.375rem;
    }

    .feed-action-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .btn-more {
        width: 36px;
    }
}

/* ============================================
   Accessibility
   ============================================ */
.feed-action-btn:focus,
.option-btn:focus,
.filter-tab:focus,
.type-filter:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* ============================================
   Loading State
   ============================================ */
.feed-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feed-card {
    animation: fadeInUp 0.4s ease;
}

.feed-card:nth-child(1) {
    animation-delay: 0.05s;
}

.feed-card:nth-child(2) {
    animation-delay: 0.1s;
}

.feed-card:nth-child(3) {
    animation-delay: 0.15s;
}

.feed-card:nth-child(4) {
    animation-delay: 0.2s;
}

.feed-card:nth-child(5) {
    animation-delay: 0.25s;
}

.feed-card:nth-child(6) {
    animation-delay: 0.3s;
}