/* ===== Community System Styles ===== */

.comm-header {
    padding: 0 32px;
    margin-bottom: 24px;
}

.comm-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.comm-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

/* Actions Bar */
.comm-actions {
    display: flex;
    gap: 10px;
    padding: 0 32px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.comm-create-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-gradient);
    color: var(--btn-primary-text, #fff);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.comm-create-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.comm-search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.comm-search-input:focus {
    border-color: var(--accent-primary);
}

/* Grid */
.comm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding: 0 32px 40px;
}

/* Community Card */
.comm-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
}

.comm-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.comm-card-banner {
    height: 80px;
    position: relative;
    overflow: hidden;
}

.comm-card-banner.genre-action {
    background: linear-gradient(135deg, #ef4444, #f97316);
}

.comm-card-banner.genre-romance {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
}

.comm-card-banner.genre-fantasy {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.comm-card-banner.genre-comedy {
    background: linear-gradient(135deg, #fbbf24, #f97316);
}

.comm-card-banner.genre-scifi {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
}

.comm-card-banner.genre-horror {
    background: linear-gradient(135deg, #1f2937, #4b5563);
}

.comm-card-banner.genre-default {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.3));
}

.comm-card-emoji {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    opacity: 0.7;
}

.comm-card-body {
    padding: 16px;
}

.comm-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.comm-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comm-card-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.comm-card-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.comm-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
}

.comm-card-tag {
    padding: 3px 8px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.comm-card-join-btn {
    width: 100%;
    padding: 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--accent-gradient);
    color: var(--btn-primary-text, #fff);
    border: none;
}

.comm-card-join-btn:hover {
    box-shadow: 0 4px 12px var(--accent-glow);
}

.comm-card-join-btn.joined {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Detail View */
.comm-detail {
    display: none;
    padding: 0 32px 40px;
}

.comm-detail.active {
    display: block;
}

.comm-detail-back {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.comm-detail-back:hover {
    color: var(--accent-primary);
}

.comm-detail-header {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.comm-detail-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.comm-detail-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

.comm-detail-desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* Discussion Thread */
.comm-threads {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comm-thread {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    transition: all 0.2s;
}

.comm-thread:hover {
    border-color: var(--accent-primary);
}

.comm-thread-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.comm-thread-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.comm-thread-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.comm-thread-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

.comm-thread-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.comm-thread-input {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.comm-thread-input input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.comm-thread-input button {
    padding: 10px 20px;
    background: var(--accent-gradient);
    color: var(--btn-primary-text, #fff);
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

/* Modal */
.comm-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 500;
    align-items: center;
    justify-content: center;
}

.comm-modal-overlay.active {
    display: flex;
}

.comm-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 420px;
    max-width: 90vw;
    padding: 24px;
}

.comm-modal h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.comm-modal label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    margin-top: 12px;
}

.comm-modal input,
.comm-modal textarea,
.comm-modal select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    resize: vertical;
}

.comm-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.comm-modal-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

/* Empty State */
.comm-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.comm-empty-icon {
    font-size: 48px;
    opacity: 0.4;
    margin-bottom: 12px;
}

.comm-empty h3 {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

@media (max-width: 768px) {

    .comm-header,
    .comm-actions,
    .comm-grid,
    .comm-detail {
        padding-left: 16px;
        padding-right: 16px;
    }

    .comm-grid {
        grid-template-columns: 1fr;
    }
}