/* HiAsian Community & Comments System Styles */

.community-section {
    margin-top: 36px;
    margin-bottom: 48px;
}

.community-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

@media (max-width: 576px) {
    .community-card {
        padding: 16px;
        border-radius: 12px;
    }
}

/* Header */
.community-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.community-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.community-title-wrap i {
    font-size: 22px;
}

.community-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.community-counter {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent);
    padding: 3px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
}

/* Sort */
.community-sort-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.btn-sort {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    color: var(--muted);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-sort:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-sort.active {
    background: rgba(38, 163, 214, 0.12);
    color: var(--accent);
    border-color: rgba(38, 163, 214, 0.35);
}

/* Composer */
.community-composer-wrap {
    margin-top: 24px;
    margin-bottom: 28px;
}

.composer-flex {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.composer-avatar-box {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #151b27;
    border: 1.5px solid var(--accent);
}

.composer-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.composer-input-box {
    flex: 1;
    min-width: 0;
}

.composer-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: #fff;
    padding: 12px 16px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.composer-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.composer-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.spoiler-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.spoiler-checkbox-label input {
    cursor: pointer;
    accent-color: var(--accent);
}

.spoiler-checkbox-label:hover {
    color: #fff;
}

.btn-post-comment {
    background: var(--accent);
    color: #04201c;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-post-comment:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-cancel-composer {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-cancel-composer:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Logged out banner */
.composer-logged-out-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--line);
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.composer-logged-out-card i {
    font-size: 26px;
    color: var(--accent);
}

.logged-out-text {
    flex: 1;
    min-width: 220px;
}

.logged-out-text strong {
    display: block;
    color: #fff;
    font-size: 14px;
    margin-bottom: 2px;
}

.logged-out-text span {
    font-size: 12px;
    color: var(--muted);
}

.btn-auth-trigger {
    background: rgba(38, 163, 214, 0.15);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-auth-trigger:hover {
    background: var(--accent);
    color: #04201c;
}

/* Comments List */
.comments-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item-card {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 20px;
    position: relative;
    transition: border-color 0.15s ease;
}

.comment-item-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
}

.comment-item-card.is-pinned {
    border-color: rgba(38, 163, 214, 0.4);
    background: rgba(38, 163, 214, 0.03);
}

.pinned-indicator {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    background: rgba(38, 163, 214, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.comment-item-card.is-reply {
    background: rgba(0, 0, 0, 0.28);
    border-left: 2px solid var(--accent);
    padding: 14px 16px;
    margin-top: 10px;
}

/* Card Top */
.comment-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.comment-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.comment-author-avatar-wrap {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #151b27;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
}

.comment-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-display-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    transition: color 0.15s ease;
}

.comment-display-name:hover {
    color: var(--accent);
}

.comment-user-id-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 6px;
    border-radius: 4px;
}

.comment-user-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}

.comment-user-badge.admin {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.comment-user-badge.rank {
    background: rgba(38, 163, 214, 0.1);
    color: var(--accent);
    border: 1px solid rgba(38, 163, 214, 0.25);
}

.comment-timestamp {
    font-size: 11px;
    color: #64748b;
    display: block;
    margin-top: 1px;
}

/* 3-dots Menu */
.comment-menu-dropdown {
    position: relative;
}

.btn-comment-menu {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 15px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.btn-comment-menu:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.comment-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #161c28;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    padding: 6px 0;
    z-index: 20;
    display: none;
}

.comment-dropdown-menu.show {
    display: block;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.menu-item.text-danger:hover {
    color: #ef4444;
}

/* Comment Body */
.comment-text-body {
    font-size: 14px;
    color: #e2e8f0;
    line-height: 1.65;
    word-break: break-word;
    margin-bottom: 12px;
    white-space: pre-line;
}

/* Spoiler Wrapper */
.spoiler-wrapper {
    background: rgba(0, 0, 0, 0.35);
    border: 1px dashed rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.spoiler-warning-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #ef4444;
}

.spoiler-content {
    font-size: 14px;
    color: #e2e8f0;
    margin-top: 8px;
    line-height: 1.65;
    white-space: pre-line;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.spoiler-wrapper.is-blurred .spoiler-content {
    filter: blur(6px);
    opacity: 0.2;
    pointer-events: none;
}

.spoiler-wrapper:not(.is-blurred) {
    border-style: solid;
    border-color: var(--line);
    background: rgba(0, 0, 0, 0.15);
}

.spoiler-wrapper:not(.is-blurred) .spoiler-warning-bar {
    color: var(--muted);
    font-size: 11px;
}

/* Actions Bar */
.comment-card-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-action-like {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--muted);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-action-like:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-action-like.liked {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-action-reply {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.15s ease;
}

.btn-action-reply:hover {
    color: var(--accent);
}

/* Replies Section */
.comment-replies-wrap {
    margin-top: 14px;
    padding-left: 20px;
    border-left: 1.5px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 576px) {
    .comment-replies-wrap {
        padding-left: 10px;
    }
}

.btn-toggle-replies {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-toggle-replies:hover {
    filter: brightness(1.2);
}

.replies-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.reply-composer {
    margin-top: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
}

.reply-textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 13px;
    resize: vertical;
    outline: none;
}

.btn-post-reply {
    background: var(--accent);
    color: #04201c;
    border: none;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

/* Empty State */
.community-empty-state {
    text-align: center;
    padding: 50px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.community-empty-state i {
    font-size: 38px;
    color: var(--muted);
}

.community-empty-state h4 {
    font-size: 16px;
    color: #fff;
    margin: 0;
}

.community-empty-state p {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

/* Skeletons */
.comments-skeleton {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.skeleton-comment-item {
    height: 90px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Pagination */
.community-pagination-wrap {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.btn-load-more {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-load-more:hover {
    background: rgba(38, 163, 214, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

/* Modals */
.community-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.community-modal-dialog {
    width: 100%;
    max-width: 440px;
}

.community-modal-content {
    background: #131924;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.modal-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.btn-close-modal:hover {
    color: #fff;
}

.modal-desc {
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.report-reasons-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-reason-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #cbd5e1;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.report-reason-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.report-reason-item input {
    accent-color: var(--accent);
}

.report-textarea {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--line);
    color: #fff;
    font-size: 12px;
    border-radius: 6px;
    padding: 8px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-modal-cancel {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-modal-submit {
    background: var(--accent);
    color: #04201c;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.btn-modal-danger {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}