.community-header {
    margin-bottom: 24px;
}

.community-header .btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.community-header .btn-filter:hover {
    background: var(--bg-gray);
    border-color: var(--primary);
    color: var(--primary);
}

.community-header .btn-filter i {
    font-size: 16px;
}

.detail-layout {
    display: block;
    max-width: 100%;
}

.detail-content-area {
    min-width: 0;
}

.detail-main {
    background: white;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 24px;
}

.detail-header {
    padding: 32px 32px 24px;
    border-bottom: 1px solid #f1f3f5;
}

.post-category-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    background-color: #f8f9fa;
    color: #495057;
}

.detail-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.4;
    color: #212529;
    margin-bottom: 24px;
    word-break: keep-all;
}

.detail-meta-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-author-large {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.detail-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.avatar-large {
    width: 48px;
    height: 48px;
    background: #f1f3f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 24px;
    flex-shrink: 0;
}

.author-text {
    flex: 1;
    min-width: 0;
}

.author-text h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 2px;
    color: #343a40;
}

.author-text span {
    font-size: 13px;
    color: #868e96;
}

.detail-author-info .btn-reaction {
    margin-left: auto;
    flex-shrink: 0;
}

.detail-footer-actions {
    padding: 16px 32px 32px;
    border-top: 1px solid #f1f3f5;
    display: flex;
    justify-content: flex-end;
}

.detail-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action:hover {
    background: #f8f9fa;
    color: #212529;
}

.detail-body {
    padding: 40px 32px;
    font-size: 16px;
    line-height: 1.8;
    color: #343a40;
    min-height: 200px;
}

.detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.detail-body img:hover {
    opacity: 0.9;
}

@media (min-width: 769px) {
    .detail-body img {
        max-width: min(100%, 800px) !important;
        width: auto !important;
        display: block;
        margin: 20px auto;
    }
}


.btn-reaction {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
    min-width: auto;
}

.btn-reaction i {
    font-size: 18px;
    color: #adb5bd;
    transition: all 0.2s;
}

.btn-reaction span {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s;
}

.btn-reaction:hover {
    background: transparent;
}

.btn-reaction:hover i {
    color: #ff6f0f;
}

.btn-reaction:hover span {
    color: #ff6f0f;
}

.btn-reaction.active,
.btn-reaction.liked {
    background: transparent;
}

.btn-reaction.active i,
.btn-reaction.liked i {
    color: #ff6f0f;
}

.btn-reaction.active span,
.btn-reaction.liked span {
    color: #ff6f0f;
}

.btn-reaction.liked i.bi-heart-fill {
    color: #ff6f0f;
}

.detail-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #eee;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comments-wrapper {
    background: white;
    border-radius: 20px;
    padding: 32px;
    border: 1px solid #eee;
    margin-top: 16px;
}

.section-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
}

.comment-form-large {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s;
}

.comment-form-large:focus-within {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(255, 111, 15, 0.1);
}

.comment-form-large textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    background: transparent;
    font-size: 15px;
    resize: vertical;
    margin-bottom: 16px;
    padding: 12px;
    color: var(--text-dark);
    font-family: var(--font-body);
    line-height: 1.6;
}

.comment-form-large textarea::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

.comment-form-large textarea:focus {
    outline: none;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-footer span {
    font-size: 13px;
    color: #868e96;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-footer span i {
    font-size: 14px;
    color: #adb5bd;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.comment-item {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.2s;
    border: 1px solid #e9ecef;
}

.comment-item:hover {
    background: #f1f3f5;
    border-color: #dee2e6;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment-content {
    font-size: 15px;
    line-height: 1.6;
    color: #495057;
    word-break: break-word;
    white-space: pre-wrap;
    flex: 1;
    min-width: 0;
    min-height: calc(15px * 1.6 * 3);
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.comment-author {
    font-size: 14px;
    font-weight: 700;
    color: #343a40;
    flex-shrink: 0;
}

.comment-date {
    font-size: 12px;
    color: #868e96;
    flex-shrink: 0;
}

.comment-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.comment-content img:hover {
    opacity: 0.9;
}

.comment-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-comment-like,
.btn-comment-edit,
.btn-comment-delete,
.btn-comment-report {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-comment-like:hover,
.btn-comment-edit:hover,
.btn-comment-delete:hover,
.btn-comment-report:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.btn-comment-like i {
    font-size: 14px;
    color: #adb5bd;
    transition: color 0.2s;
}

.btn-comment-like:hover i {
    color: #ff6f0f;
}

.btn-comment-like.active,
.btn-comment-like.liked {
    border-color: #ff6f0f;
    background: #fff8f5;
}

.btn-comment-like.active i,
.btn-comment-like.liked i {
    color: #ff6f0f;
}

.btn-comment-like.liked i.bi-heart-fill {
    color: #ff6f0f;
}

.comment-like-count {
    font-size: 12px;
    font-weight: 600;
}

.btn-comment-edit {
    color: #0066cc;
    border-color: #0066cc;
}

.btn-comment-edit:hover {
    background: #e6f2ff;
    border-color: #0052a3;
}

.btn-comment-delete {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-comment-delete:hover {
    background: #fff5f5;
    border-color: #c82333;
}

.btn-comment-report {
    color: #868e96;
    border-color: #dee2e6;
}

.btn-comment-report:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.comment-bubble {
    flex: 1;
    min-width: 0;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.author-name {
    font-weight: 700;
    color: #343a40;
}

.comment-time {
    color: #868e96;
}

.comment-text {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    word-break: break-word;
}

#imageModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    cursor: pointer;
    backdrop-filter: blur(5px);
}

#imageModal #closeImageModal {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10001;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

#imageModal #closeImageModal:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

#imageModal #modalImage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-item:hover {
    background: #f8f9fa;
}

.sidebar-item-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: #e9ecef;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-item-info {
    flex: 1;
    min-width: 0;
}

.sidebar-item-info h5 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #343a40;
}

.sidebar-item-info span {
    font-size: 12px;
    color: #868e96;
}


@media (max-width: 768px) {
    .detail-main {
        border-radius: 0;
        box-shadow: none;
        border: 1px solid var(--border);
        margin-bottom: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .detail-header {
        padding: 16px 0;
        border-bottom: 1px solid var(--border);
    }

    .post-category-badge {
        font-size: 12px;
        padding: 4px 8px;
        margin-bottom: 12px;
    }

    .detail-title {
        font-size: 18px;
        font-weight: 700;
        line-height: 1.5;
        margin-bottom: 16px;
    }

    .detail-meta-row {
        flex-direction: column;
        gap: 12px;
    }

    .detail-author-large {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }

    .detail-author-info {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
    }

    .avatar-large {
        width: 36px;
        height: 36px;
        font-size: 18px;
        flex-shrink: 0;
    }

    .author-text {
        flex: 1;
        min-width: 0;
    }

    .author-text h4 {
        font-size: 14px;
    }

    .author-text span {
        font-size: 12px;
    }

    .detail-author-info .btn-reaction {
        margin-left: auto;
        padding: 6px 10px;
        min-width: auto;
        gap: 4px;
    }

    .detail-author-info .btn-reaction i {
        font-size: 16px;
    }

    .detail-author-info .btn-reaction span {
        font-size: 12px;
    }

    .detail-footer-actions {
        padding: 12px 0 20px;
        border-top: 1px solid #f1f3f5;
        display: flex;
        justify-content: flex-end;
    }

    .detail-actions {
        justify-content: flex-end;
        margin-top: 0;
        border-top: none;
        padding-top: 0;
    }

    .btn-action {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .detail-body {
        padding: 16px 0;
        font-size: 15px;
        line-height: 1.7;
    }

    .detail-body img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        margin: 12px 0;
    }

    .detail-footer {
        padding: 16px;
        border-top: 1px solid var(--border);
    }

    .detail-stats {
        gap: 16px;
    }

    .stat-item {
        font-size: 13px;
    }

    .stat-item i {
        font-size: 14px;
    }

    .comments-wrapper {
        border-radius: 0;
        border: none;
        border-top: 1px solid var(--border);
        padding: 16px;
    }

    .comments-header {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .comment-form-large {
        margin-bottom: 20px;
    }

    .comment-form-large textarea {
        min-height: 100px;
        font-size: 14px;
        padding: 10px;
    }

    .comment-form-large .btn-primary {
        padding: 10px 16px;
        font-size: 14px;
    }

    .comment-item {
        padding: 12px 0;
    }

    .comment-header {
        margin-bottom: 8px;
        gap: 8px;
    }

    .comment-content {
        font-size: 14px;
        line-height: 1.6;
        flex: 1;
        min-width: 0;
        min-height: calc(14px * 1.6 * 3);
        padding: 6px 10px;
        border: none;
        border-radius: 0;
        background: transparent;
    }

    .comment-author {
        font-size: 13px;
        flex-shrink: 0;
    }

    .comment-date {
        font-size: 11px;
        flex-shrink: 0;
    }

    .comment-actions {
        gap: 8px;
    }

    .comment-actions button {
        font-size: 12px;
        padding: 4px 8px;
    }
}

.related-posts-section {
    margin-top: 40px;
    background: white;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 32px;
}

.related-posts-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--primary);
}

.related-posts-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.related-posts-title i {
    color: var(--primary);
    font-size: 24px;
}

.related-posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.related-post-item {
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-gray);
    cursor: pointer;
    transition: all 0.2s ease;
}

.related-post-item:hover {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(255, 111, 15, 0.1);
    transform: translateX(4px);
}

.related-post-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 6px;
}

.related-post-title:hover {
    color: var(--primary);
}

.related-comment-count {
    font-size: 13px;
    color: var(--text-gray);
    font-weight: 400;
}

.related-post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.related-post-author {
    color: var(--primary);
    font-weight: 500;
}

.related-post-date {
    color: var(--text-gray);
}

.related-post-separator {
    color: var(--text-light);
}

.related-post-views,
.related-post-comments,
.related-post-likes {
    display: flex;
    align-items: center;
    gap: 4px;
}

.related-post-views i,
.related-post-comments i {
    font-size: 14px;
    color: var(--text-light);
}

.related-post-likes i {
    font-size: 14px;
    color: var(--primary);
}

.main-content {
    align-items: center;
}

.content-container {
    margin: 0;
    width: 1200px;
}

@media (max-width: 768px) {
    .community-header {
        margin-bottom: 16px;
        padding: 0 16px;
    }

    .community-header .btn-filter {
        padding: 8px 12px;
        font-size: 13px;
    }

    .related-posts-section {
        margin-top: 24px;
        padding: 20px 16px;
        border-radius: 16px;
    }

    .related-posts-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .related-posts-title {
        font-size: 18px;
    }

    .related-posts-title i {
        font-size: 20px;
    }

    .related-posts-list {
        gap: 12px;
    }

    .related-post-item {
        padding: 12px 16px;
    }

    .related-post-title {
        font-size: 15px;
        margin-bottom: 6px;
    }

    .related-post-meta {
        font-size: 12px;
        gap: 6px;
    }
}