/* Feed Page Styles */

.feed-section {
    padding: 2rem 0;
    min-height: 100vh;
    background: var(--bg-primary);
}

.feed-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 2rem;
}

/* Sidebar Styles */
.feed-sidebar,
.feed-right-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.sidebar-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-card h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-card h3 i {
    color: var(--green-primary);
}

/* Tags */
.tags-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tag-item {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.tag-item:hover {
    background: var(--green-light);
    color: var(--green-primary);
}

/* Contributors */
.contributors-list,
.hot-topics-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contributor-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.contributor-item:hover {
    background: var(--bg-tertiary);
}

.contributor-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.contributor-info {
    flex: 1;
}

.contributor-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.contributor-stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Contests */
.contests-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contest-item {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.contest-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.contest-time {
    font-size: 0.8rem;
    color: var(--green-primary);
}

/* Feed Main */
.feed-main {
    max-width: 700px;
}

/* Feed Filters */
.feed-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.filter-btn {
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--green-primary);
    color: var(--green-primary);
}

.filter-btn.active {
    background: var(--green-primary);
    color: white;
    border-color: var(--green-primary);
}

/* Feed Posts */
.feed-posts {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feed-post {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.feed-post:hover {
    border-color: var(--green-primary);
    box-shadow: var(--shadow-lg);
}

/* Post Header */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.author-avatar.official {
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-secondary) 100%);
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.verified-badge {
    color: var(--green-primary);
    font-size: 1rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.post-dot {
    font-weight: 700;
}

.post-category {
    color: var(--green-primary);
    font-weight: 600;
}

.post-menu-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.post-menu-btn:hover {
    background: var(--bg-tertiary);
}

/* Post Content */
.post-content {
    margin-bottom: 1rem;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.post-text {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.post-list {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.post-list li {
    margin-bottom: 0.5rem;
}

.post-list strong {
    color: var(--text-primary);
}

.post-actions-inline {
    margin-top: 1rem;
}

/* Post Media */
.post-media {
    margin: 1rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.post-media.video {
    background: var(--bg-tertiary);
}

.video-thumbnail {
    position: relative;
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1) 0%, rgba(34, 197, 94, 0.1) 100%);
}

.video-thumbnail i {
    font-size: 4rem;
    color: var(--green-primary);
}

.video-duration {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.video-info {
    padding: 1rem;
    background: var(--bg-secondary);
}

.video-platform {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.video-platform i {
    color: #ff0000;
}

.post-media.image {
    background: var(--bg-tertiary);
}

.image-placeholder {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.image-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Problem Card */
.post-problem-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.problem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.problem-platform {
    background: var(--green-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.problem-difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

.problem-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.problem-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.problem-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.problem-stats i {
    color: var(--green-primary);
}

.problem-link {
    color: var(--green-primary);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.problem-link:hover {
    text-decoration: underline;
}

/* Code Block */
.post-code {
    margin: 1rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-color);
}

.code-language {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.code-copy-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.code-copy-btn:hover {
    background: var(--bg-secondary);
    color: var(--green-primary);
}

.post-code pre {
    margin: 0;
    padding: 1rem;
    background: var(--bg-secondary);
    overflow-x: auto;
}

.post-code code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.post-tag {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    color: var(--green-primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.post-tag:hover {
    background: var(--green-light);
}

/* Leaderboard */
.post-leaderboard {
    margin: 1rem 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.leaderboard-rank {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-weight: 700;
    color: white;
    min-width: 50px;
    text-align: center;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.leaderboard-score {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Post Footer */
.post-footer {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.post-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.post-action:hover {
    background: var(--bg-tertiary);
    color: var(--green-primary);
}

.post-action.active {
    color: var(--green-primary);
}

.post-action i {
    font-size: 1.1rem;
}

/* Right Sidebar */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: var(--green-light);
    color: var(--green-primary);
}

.quick-action-btn i {
    font-size: 1.2rem;
}

/* Hot Topics */
.hot-topic-item {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hot-topic-item:hover {
    background: var(--green-light);
}

.hot-topic-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.hot-topic-stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Promo Card */
.promo-card {
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-secondary) 100%);
    border: none;
    color: white;
}

.promo-card h3 {
    color: white;
}

.promo-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.promo-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

/* Load More */
.feed-load-more {
    text-align: center;
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .feed-container {
        grid-template-columns: 240px 1fr 280px;
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .feed-container {
        grid-template-columns: 1fr;
    }

    .feed-sidebar,
    .feed-right-sidebar {
        display: none;
    }

    .feed-main {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .feed-section {
        padding: 1rem 0;
    }

    .feed-filters {
        flex-wrap: wrap;
    }

    .filter-btn {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    .feed-post {
        padding: 1rem;
    }

    .post-title {
        font-size: 1.25rem;
    }

    .post-footer {
        flex-wrap: wrap;
    }

    .post-action {
        flex: 1;
        min-width: 45%;
        justify-content: center;
    }

    .video-thumbnail {
        padding: 2rem;
    }

    .video-thumbnail i {
        font-size: 3rem;
    }

    .leaderboard-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Scrollbar Styling */
.feed-sidebar::-webkit-scrollbar,
.feed-right-sidebar::-webkit-scrollbar {
    width: 6px;
}

.feed-sidebar::-webkit-scrollbar-track,
.feed-right-sidebar::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.feed-sidebar::-webkit-scrollbar-thumb,
.feed-right-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.feed-sidebar::-webkit-scrollbar-thumb:hover,
.feed-right-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--green-primary);
}
